/* B — Index / Stage, set in the typewriter register of A, with C's contact card. */

:root {
	--bg: #f2f2ef;
	--fg: #101010;
	--mute: #6f6f6b;
	--ghost: #8c8c88;
	--line: #101010;
	--header: 72px;
	--gutter: 24px;
	--small-tracking: 0;
	--mono: "Courier Prime", "Courier New", Courier, monospace;
	--head: "Inconsolata", "Courier Prime", "Courier New", monospace;
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--t-color: 120ms;
	--t-width: 200ms;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e0e0e;
		--fg: #f1f1ee;
		--mute: #9a9a95;
		--ghost: #5f5f5b;
		--line: color-mix(in srgb, #f1f1ee 60%, transparent);
		--small-tracking: 0.005em;
	}
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--t-color: 0ms;
		--t-width: 0ms;
	}
	html { scroll-behavior: auto; }
}

* { box-sizing: border-box; }

html {
	background: var(--bg);
	color: var(--fg);
	font-family: var(--mono);
	font-size: 16px;
	line-height: 1.5;
	font-variant-numeric: tabular-nums lining-nums;
	hyphens: auto;
	-webkit-hyphens: auto;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	caret-color: var(--fg);
	accent-color: var(--fg);
	-webkit-font-smoothing: antialiased;
}

body {
	margin: 0;
	background: var(--bg);
	min-height: 100vh;
}

::selection {
	background: var(--fg);
	color: var(--bg);
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	letter-spacing: inherit;
	text-transform: inherit;
}

:focus-visible {
	outline: 1.5px solid var(--fg);
	outline-offset: 3px;
	border-radius: 1px;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* Type roles */

/* Caps lines: 12px, tracked 0.05em — the typewriter's only emphasis besides bold. */
.meta {
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin: 0;
}

/* Headlines: Inconsolata, a humanist mono with a real width axis. Rests at wdth 112 like B's Archivo did. */
.title {
	font-family: var(--head);
	font-size: clamp(44px, 7vw, 104px);
	font-weight: 700;
	font-stretch: 112%;
	letter-spacing: -0.01em;
	line-height: 1;
	padding-top: 0.06em;
	margin: 0;
	hyphens: manual;
	-webkit-hyphens: manual;
	text-wrap: balance;
	transition: font-stretch var(--t-width) var(--ease-out);
}
.title-about { font-size: clamp(36px, 4.8vw, 72px); }

/* Markers: a page (draft exists) or a thought bubble (idea). Inline, one ink. */
.marker {
	display: inline-block;
	vertical-align: -0.15em;
	width: 1em;
	height: 1em;
	flex: none;
}
.marker svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.25;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.marker svg circle { fill: currentColor; stroke: none; }
.meta .marker { margin-right: 0.45em; vertical-align: -0.2em; width: 1.15em; height: 1.15em; }

/* Header */

.top {
	position: sticky;
	top: 0;
	z-index: 2;
	height: var(--header);
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	column-gap: var(--gutter);
	align-items: center;
	padding-inline: var(--gutter);
	background: var(--bg);
	border-bottom: 1px solid var(--line);
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
}

.top a { text-decoration: none; }
.mark { grid-column: 1 / 4; }
.top nav {
	grid-column: 4 / 11;
	display: flex;
	gap: 28px;
}
.top nav a, .top nav button {
	color: var(--ghost);
	transition: color var(--t-color) linear;
}
.top nav a[aria-current="true"] { color: var(--fg); }
@media (hover: hover) and (pointer: fine) {
	.top nav a:hover, .top nav button:hover { color: var(--fg); }
}
.clock {
	grid-column: 11 / 13;
	justify-self: end;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Page grid */

.page {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	column-gap: var(--gutter);
	padding-inline: var(--gutter);
	align-items: start;
}

/* Stage */

.stage {
	grid-column: 1 / 8;
	position: sticky;
	top: var(--header);
	padding-top: 40px;
	padding-bottom: 32px;
	min-height: calc(100vh - var(--header));
}

.stage .title { margin-bottom: 22px; }
.stage .meta { color: var(--mute); }
.logline {
	max-width: 48ch;
	margin: 22px 0 0;
}

.synopsis {
	overflow: hidden;
	max-width: 48ch;
}
.synopsis > div { padding-top: 28px; }
.synopsis .meta { margin-bottom: 8px; }
.synopsis p { margin: 0 0 12px; }
.synopsis a { font-weight: 700; }

/* Unlock */

.unlock {
	margin-top: 48px;
	max-width: 36ch;
	display: grid;
}
.unlock-label, .unlock-open {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.5;
	color: var(--mute);
	margin: 0 0 6px;
	display: block;
}
.unlock-open button {
	color: var(--fg);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}
.unlock-input {
	font: inherit;
	color: var(--fg);
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--line);
	border-radius: 0;
	padding: 6px 0 8px;
	margin: 0;
	width: 100%;
	outline: none;
	letter-spacing: 0.12em;
}
.unlock-input:focus-visible { outline: none; border-bottom-width: 1.5px; padding-bottom: 7.5px; }
.unlock[data-state="open"] .unlock-input,
.unlock[data-state="open"] .unlock-label { display: none; }
.unlock[data-state="open"] .unlock-open { display: block; }
.unlock-phone { display: none; }

/* Index */

.index {
	grid-column: 8 / 13;
	padding-top: calc(50vh - var(--header) - 24px);
	padding-bottom: 50vh;
}

.rows {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--line);
}

.row {
	border-bottom: 1px solid var(--line);
	color: var(--mute);
	transition: color var(--t-color) linear;
}
.row[aria-current="true"] { color: var(--fg); }
@media (hover: hover) and (pointer: fine) {
	.row:hover { color: var(--fg); }
}

/* Rows are set entirely in the headline face, so the width axis is available for the signature. */
.row-main {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	width: 100%;
	text-align: left;
	padding: 14px 0;
	font-family: var(--head);
	font-size: 19px;
	line-height: 1.3;
}
.row-main .marker { margin-left: 8px; margin-right: auto; width: 0.9em; height: 0.9em; align-self: center; }
.row-title {
	font-weight: 500;
	font-stretch: 100%;
	transition: font-stretch var(--t-width) var(--ease-out);
	hyphens: manual;
	-webkit-hyphens: manual;
}
/* Signature: the active row's title relaxes from wdth 100 to 108, toward the stage title's 112. */
.row[aria-current="true"] .row-title { font-stretch: 108%; }
.row-end {
	display: flex;
	align-items: baseline;
	gap: 14px;
	flex: none;
	font-weight: 500;
}
.tag {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity 200ms linear;
}
.tag[data-shown] { opacity: 1; }

.row-meta, .row-logline, .row .synopsis { display: none; }

/* About row (phone only) */
.row-about { display: none; }

/* Stage: about — greeting, then portrait beside the one-line bio and the childhood photo. */

.about-line { margin: 0; max-width: 32ch; }
.about-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	column-gap: var(--gutter);
	margin-top: 32px;
	align-items: start;
}
.about-grid .portrait {
	grid-column: 1 / 4;
	width: 100%;
	max-height: min(60vh, 100vh - 380px);
	object-fit: cover;
	object-position: 50% 20%;
	filter: grayscale(1);
}
.about-grid .about-text {
	grid-column: 4 / 8;
	display: flex;
	flex-direction: column;
	gap: 28px;
}
.young { margin: 0; width: 160px; }
.young img {
	width: 160px;
	height: 165px;
	object-fit: cover;
	object-position: center;
	/* crop the baked-in 2px border */
	clip-path: inset(2px);
}
.young figcaption { color: var(--mute); margin-top: 8px; }

/* Contact: a modal title card, centred, no origin. The page dims behind it (see app.js). */

.contact {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 24px;
	border: 0;
	background: transparent;
	color: var(--fg);
	display: none;
	place-items: center;
	text-align: center;
	opacity: 0;
}
.contact[open] { display: grid; }
.contact::backdrop { background: transparent; }
.contact-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	max-width: 100%;
}
.contact-email {
	text-decoration: none;
	font-size: clamp(32px, 5vw, 72px);
	padding-top: 0;
	overflow-wrap: anywhere;
}
.contact-actions {
	margin: 10px 0 0;
	display: flex;
	gap: 28px;
	font-size: 12px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.contact-actions a, .contact-actions button { text-decoration: none; }
.contact-actions a, .contact-actions button, .contact-email {
	transition: transform 160ms var(--ease-out);
}
.contact-actions a:active, .contact-actions button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
	.contact-email:hover, .contact-actions a:hover, .contact-actions button:hover {
		text-decoration: underline;
		text-underline-offset: 0.3em;
		text-decoration-thickness: 1px;
		text-decoration-color: var(--mute);
	}
}
@media (prefers-reduced-motion: reduce) {
	.contact { opacity: 1 !important; }
}

/* Dark: body-small gets a touch of tracking (Courier Prime has no 450 weight to step up to) */
@media (prefers-color-scheme: dark) {
	.logline, .about-line, .synopsis p, .row-logline {
		letter-spacing: var(--small-tracking);
	}
}

/* Phone: stage dropped, the index is the page */

@media (max-width: 760px) {
	:root { --gutter: 16px; --header: 60px; }
	html { font-size: 15px; line-height: 1.55; }

	.top { font-size: 16px; }
	.mark { grid-column: 1 / 7; }
	.top nav { grid-column: 7 / 13; justify-self: end; }
	.top nav a { display: none; }
	.top nav button { color: var(--fg); }
	.clock { display: none; }

	.stage { display: none; }

	.index {
		grid-column: 1 / 13;
		padding-top: calc(30vh - var(--header) - 40px);
		padding-bottom: 24px;
	}
	.row { padding-bottom: 20px; }
	.row-main { padding: 18px 0 8px; font-size: 21px; }
	.row[aria-current="true"] .row-title { font-stretch: 100%; }
	.row-meta { display: block; color: inherit; }
	.row-logline { display: block; margin: 10px 0 0; max-width: 48ch; }
	.row .synopsis { display: block; }
	.synopsis > div { padding-top: 16px; }

	.unlock-phone {
		display: grid;
		margin: 40px 0 56px;
	}

	.row-about {
		display: block;
		color: var(--fg);
		padding-top: 20px;
		scroll-margin-top: var(--header);
	}
	.about-title {
		font-family: var(--head);
		font-size: clamp(32px, 9vw, 44px);
		font-weight: 700;
		font-stretch: 112%;
		letter-spacing: -0.01em;
		line-height: 1.02;
		padding-top: 0.06em;
		margin: 0 0 12px;
		hyphens: manual;
		-webkit-hyphens: manual;
		text-wrap: balance;
	}
	.row-about .portrait {
		width: 100%;
		max-height: 60vh;
		object-fit: cover;
		object-position: 50% 20%;
		filter: grayscale(1);
		margin: 24px 0;
	}
	.row-about .young { margin: 0 0 32px; }

	.contact { padding: 20px; }
}
