/* ==========================================================================
   Homepage layout: Quarterly
   --------------------------------------------------------------------------
   A magazine issue. The cover picture runs full-bleed with the headline
   panel laid over its lower edge in the scheme's pastel --panel; a
   golden-ratio construction draws itself over the picture. Then a contents
   page, topic tabs and alternating feature spreads.
   ========================================================================== */

/* 1. Cover ------------------------------------------------------------------ */
.qcover { position: relative; padding-bottom: clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--ink); }
.qcover__media { position: relative; margin: 0; height: clamp(360px, 66vh, 720px); overflow: hidden; border-bottom: 1px solid var(--ink); background: var(--surface-2); }
.qcover__img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }

.qcover__phi { position: absolute; top: 6%; right: 4%; width: min(34vw, 420px); height: auto; }
.qcover__squares rect { fill: none; stroke: color-mix(in srgb, var(--ink) 60%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; animation: q-square .5s ease forwards; }
.qcover__squares rect:nth-child(1) { animation-delay: .2s; }
.qcover__squares rect:nth-child(2) { animation-delay: .45s; }
.qcover__squares rect:nth-child(3) { animation-delay: .7s; }
.qcover__squares rect:nth-child(4) { animation-delay: .95s; }
.qcover__squares rect:nth-child(5) { animation-delay: 1.2s; }
.qcover__squares rect:nth-child(6) { animation-delay: 1.45s; }
@keyframes q-square { to { opacity: 1; } }
/* The spiral is drawn in viewBox units: with non-scaling-stroke Chrome
   measures pathLength in screen pixels on a scaled SVG and draws the wrong
   stretch of the dash. */
.qcover__phi path[pathLength] { stroke: var(--accent); stroke-width: .75; vector-effect: none; transition-delay: 1.4s; transition-duration: 2.8s; }
.qcover__phi-label { position: absolute; top: calc(6% + min(34vw, 420px) * .62 + 10px); right: 4%; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 2px 8px; }

.qcover__panel {
	position: relative;
	z-index: 2;
	width: min(760px, 100%);
	margin-top: clamp(-120px, -8vw, -60px);
	padding: clamp(24px, 3.4vw, 44px);
	background: var(--panel);
	border: 1px solid var(--ink);
}
.qcover__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 16px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.qcover__title { font-size: clamp(2.2rem, 4.8vw, 4rem); font-weight: 400; line-height: 1.02; letter-spacing: -.025em; }
.qcover__title a { background: linear-gradient(currentColor, currentColor) left 96% / 0 2px no-repeat; transition: background-size .45s var(--ease); }
.qcover__title a:hover { background-size: 100% 2px; }
.qcover__dek { max-width: 56ch; margin-top: 16px; font-family: var(--font-text); font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.55; color: var(--ink-2); }
.qcover__foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--ink); }
.qcover__num { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 400; line-height: 1; color: var(--accent); }
.qcover__numlabel { font-size: 1rem; font-style: italic; color: var(--ink-2); }

@media (max-width: 700px) {
	.qcover__phi, .qcover__phi-label { display: none; }
	.qcover__media { height: 52vw; min-height: 240px; }
	.qcover__panel { margin-top: -40px; }
}

/* 2. In this issue ---------------------------------------------------------- */
.qtoc__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; padding-bottom: 16px; border-bottom: 3px double var(--ink); }
.qtoc__title { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 400; font-style: italic; }
.qtoc__dates { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.qtoc__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 4vw, 64px); margin: 0; padding: 0; list-style: none; }
.qtoc__item { border-bottom: 1px solid var(--line-2); }
.qtoc__link { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 20px 0; }
.qtoc__index { font-family: var(--font-display); font-size: 1.4rem; color: var(--tag, var(--accent)); }
.qtoc__text { display: grid; gap: 6px; }
.qtoc__name { font-family: var(--font-display); font-size: clamp(1.2rem, 1.7vw, 1.45rem); line-height: 1.2; transition: color .2s; }
.qtoc__meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qtoc__num { font-family: var(--font-display); font-size: clamp(1.1rem, 1.6vw, 1.4rem); font-weight: 400; color: var(--ink-2); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.qtoc__link:hover .qtoc__name { color: var(--tag, var(--accent)); }
.qtoc__link:hover .qtoc__num { color: var(--ink); }
@media (max-width: 820px) {
	.qtoc__list { grid-template-columns: 1fr; }
	.qtoc__link { grid-template-columns: 40px minmax(0, 1fr); }
	.qtoc__num { grid-column: 2; }
}

/* 3. Topic tabs -------------------------------------------------------------- */
.qtabs__list { display: flex; gap: 8px; margin-bottom: 30px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.qtabs__tab {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: none;
	padding: 8px 16px 8px 8px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink-2);
	font-family: var(--font-body);
	font-size: .92rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .2s, background-color .2s, color .2s;
}
.qtabs__tab .topicmark { width: 30px; height: 30px; border-color: var(--tag); }
.qtabs__tab .topicmark svg { width: 17px; height: 17px; }
.qtabs__tab:hover { border-color: var(--ink); color: var(--ink); }
.qtabs__tab[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.qtabs__tab[aria-selected="true"] .topicmark { background: var(--tag); color: var(--bg); border-color: var(--tag); }
.qtabs__panel { animation: q-panel .45s var(--ease); }
@keyframes q-panel { from { opacity: 0; transform: translateY(8px); } }
.qtabs__desc { max-width: 70ch; margin-bottom: 28px; font-family: var(--font-text); font-size: 1.1rem; color: var(--ink-2); }
.qtabs__desc a { font-family: var(--font-body); font-size: .9rem; font-weight: 600; white-space: nowrap; color: var(--ink); border-bottom: 1px solid var(--accent); }

/* 4. Features ---------------------------------------------------------------- */
.qfeat__row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 4.5vw, 72px); align-items: center; padding: clamp(28px, 4vw, 48px) 0; border-bottom: 1px solid var(--line-2); }
.qfeat__row:last-child { border-bottom: 0; }
.qfeat__row--flip .qfeat__media { order: 2; }
.qfeat__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--ink); }
.qfeat__img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.qfeat__row:hover .qfeat__img { transform: scale(1.03); }
.qfeat__body { display: grid; gap: 14px; justify-items: start; }
.qfeat__num { font-family: var(--font-display); font-size: clamp(2.8rem, 5vw, 4.6rem); font-weight: 300; line-height: 1; letter-spacing: -.03em; color: var(--tag, var(--accent)); }
.qfeat__title { font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-weight: 400; line-height: 1.08; }
.qfeat__title a:hover { color: var(--accent); }
.qfeat__dek { font-family: var(--font-text); font-size: 1.08rem; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 820px) {
	.qfeat__row { grid-template-columns: 1fr; }
	.qfeat__row--flip .qfeat__media { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.qcover__squares rect { animation: none; opacity: 1; }
	.qtabs__panel { animation: none; }
}
