/* Family History: phase 1 design mock.
   Paper and ink. One accent per branch, used as a rule, a line or a ring,
   never as a fill behind text. Tokens here become src/lib/styles/tokens.css. */

@font-face {
	font-family: 'Fraunces';
	src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2');
	font-weight: 300 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Fraunces';
	src: url('fonts/fraunces-latin-wght-italic.woff2') format('woff2');
	font-weight: 300 800;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: 'Source Sans 3';
	src: url('fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
	font-weight: 300 800;
	font-style: normal;
	font-display: swap;
}

:root {
	color-scheme: light;
	--paper: #f6f1e8;
	--paper-2: #efe7d8;
	--card: #fbf8f2;
	--ink: #1d1a17;
	--ink-2: #4a433b;
	--ink-3: #6f665b;
	--rule: #d8cdb9;
	--shadow: 0 1px 2px rgb(60 45 20 / 0.08), 0 8px 24px rgb(60 45 20 / 0.08);

	/* branches */
	--sullivan: #2f6b4f; /* Kerry bog green */
	--sewell: #3b3f7a; /* Cumberland slate indigo: the Sewells */
	--acadian: #2a5d8a; /* Atlantic blue: the Acadians */
	--yahn: #a26a12; /* oil-field ochre: Yahn and Haseloff */
	--mccarthy: #a2402c; /* brick: the McCarthys of Cork and Boston */
	--brennan: #b0447a; /* Natick rose: the Brennans and Scanlons */

	--land: #e6dcc8;
	--land-edge: #c9b99a;
	--sea: #f1ebdf;
	--grat: #e3d9c6;

	--serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
	--sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.33rem;
	--step-2: 1.66rem;
	--step-3: 2.07rem;
	--step-4: 2.59rem;
	--step-5: 3.24rem;

	--measure: 66ch;
	--gutter: 16px;
	--ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (min-width: 760px) {
	:root {
		--step-0: 1.125rem;
		--step-4: 3.2rem;
		--step-5: 4.6rem;
		--gutter: 32px;
	}
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		color-scheme: dark;
		--paper: #15130f;
		--paper-2: #1d1a15;
		--card: #201c17;
		--ink: #efe8dc;
		--ink-2: #c9bfae;
		--ink-3: #9d9382;
		--rule: #3a342b;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
		--sullivan: #6fbf95;
		--sewell: #9b9ff0;
		--acadian: #7fb2e0;
		--yahn: #e0aa52;
		--mccarthy: #e48a72;
		--brennan: #f29ac6;
		--land: #2a261f;
		--land-edge: #4a4235;
		--sea: #181611;
		--grat: #221f19;
	}
}
:root[data-theme='dark'] {
	color-scheme: dark;
	--paper: #15130f;
	--paper-2: #1d1a15;
	--card: #201c17;
	--ink: #efe8dc;
	--ink-2: #c9bfae;
	--ink-3: #9d9382;
	--rule: #3a342b;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
	--sullivan: #6fbf95;
	--sewell: #9b9ff0;
	--acadian: #7fb2e0;
	--yahn: #e0aa52;
	--mccarthy: #e48a72;
	--brennan: #f29ac6;
	--land: #2a261f;
	--land-edge: #4a4235;
	--sea: #181611;
	--grat: #221f19;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: var(--step-0);
	line-height: 1.6;
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
	text-underline-offset: 0.18em;
}
a:hover {
	text-decoration-color: currentColor;
}
:focus-visible {
	outline: 2px solid var(--acadian);
	outline-offset: 3px;
	border-radius: 2px;
}

.skip {
	position: absolute;
	left: -999px;
}
.skip:focus {
	left: var(--gutter);
	top: 8px;
	background: var(--card);
	padding: 6px 10px;
	z-index: 10;
}

/* ---------- top bar ---------- */
.bar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 12px var(--gutter);
	background: color-mix(in srgb, var(--paper) 88%, transparent);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--rule);
	font-family: var(--sans);
	font-size: 0.95rem;
}
.wordmark {
	font-family: var(--serif);
	font-weight: 600;
	font-size: 1.15rem;
	letter-spacing: 0.01em;
	text-decoration: none;
	margin-right: auto;
}
.wordmark em {
	font-weight: 400;
	color: var(--ink-3);
}
.bar nav {
	display: none;
	gap: 22px;
}
.bar nav a {
	text-decoration: none;
	color: var(--ink-2);
}
.bar nav a[aria-current='page'] {
	color: var(--ink);
	box-shadow: inset 0 -2px 0 var(--ink);
}
.icon-btn {
	inline-size: 40px;
	block-size: 40px;
	display: grid;
	place-items: center;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: transparent;
	color: var(--ink-2);
	cursor: pointer;
}
@media (min-width: 900px) {
	.bar nav {
		display: flex;
	}
	.menu-btn {
		display: none;
	}
}

/* ---------- type ---------- */
.kicker {
	font-family: var(--sans);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: var(--step--1);
	font-weight: 600;
	color: var(--ink-3);
	margin: 0 0 0.6rem;
}
h1,
h2,
h3 {
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: -0.01em;
	margin: 0;
	text-wrap: balance;
}
h1 {
	font-size: var(--step-5);
	font-variation-settings: 'SOFT' 50, 'WONK' 0;
}
h2 {
	font-size: var(--step-3);
}
h3 {
	font-size: var(--step-1);
}
.lede {
	font-size: var(--step-1);
	line-height: 1.45;
	color: var(--ink-2);
	max-width: 34ch;
	text-wrap: pretty;
}
.prose {
	max-width: var(--measure);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.prose p {
	margin: 0 0 1.1em;
	text-wrap: pretty;
	hyphens: auto;
}
.prose p.dropcap::first-letter {
	float: left;
	font-size: 4.1em;
	line-height: 0.82;
	padding: 0.06em 0.08em 0 0;
	font-weight: 500;
	color: var(--acadian);
}
.prose blockquote {
	margin: 1.8em 0;
	padding: 0 0 0 1.1em;
	border-left: 3px solid var(--acadian);
	font-style: italic;
	font-size: var(--step-1);
	line-height: 1.45;
	color: var(--ink-2);
}
.prose blockquote cite {
	display: block;
	font-family: var(--sans);
	font-style: normal;
	font-size: var(--step--1);
	color: var(--ink-3);
	margin-top: 0.5em;
}
.sans {
	font-family: var(--sans);
}
.muted {
	color: var(--ink-3);
}
sup a {
	font-family: var(--sans);
	font-size: 0.7em;
	text-decoration: none;
	color: var(--acadian);
	padding: 0 1px;
}

/* ---------- branch accents ---------- */
[data-branch='sullivan'] {
	--accent: var(--sullivan);
}
[data-branch='sewell'] {
	--accent: var(--sewell);
}
[data-branch='acadian'] {
	--accent: var(--acadian);
}
[data-branch='yahn'] {
	--accent: var(--yahn);
}
[data-branch='mccarthy'] {
	--accent: var(--mccarthy);
}
[data-branch='brennan'] {
	--accent: var(--brennan);
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 600;
	color: var(--ink-2);
}
.chip::before {
	content: '';
	inline-size: 10px;
	block-size: 10px;
	border-radius: 50%;
	background: var(--accent, var(--ink-3));
}

.badge {
	display: inline-block;
	font-family: var(--sans);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 999px;
	border: 1px solid currentColor;
	white-space: nowrap;
}
.badge.proven {
	color: var(--sullivan);
}
.badge.likely {
	color: var(--yahn);
}
.badge.story {
	color: var(--mccarthy);
}

/* ---------- record images ---------- */
.record {
	margin: 2.2em 0;
}
.record img {
	background: #fff;
	border: 1px solid var(--rule);
	box-shadow: var(--shadow);
	border-radius: 2px;
	filter: sepia(0.12) contrast(1.02);
}
:root[data-theme='dark'] .record img {
	filter: sepia(0.12) brightness(0.88);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) .record img {
		filter: sepia(0.12) brightness(0.88);
	}
}
.record figcaption {
	font-family: var(--sans);
	font-size: var(--step--1);
	line-height: 1.45;
	color: var(--ink-2);
	margin-top: 0.8em;
	max-width: var(--measure);
}
.record figcaption .credit {
	display: block;
	color: var(--ink-3);
	margin-top: 0.3em;
}
.record.bleed {
	max-width: 1100px;
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.transcription {
	font-family: var(--sans);
	font-size: var(--step--1);
	margin-top: 0.8em;
}
.transcription summary {
	cursor: pointer;
	color: var(--acadian);
	font-weight: 600;
}
.transcription p {
	font-family: var(--serif);
	font-style: italic;
	font-size: var(--step-0);
	color: var(--ink-2);
	margin: 0.6em 0 0;
}

/* ---------- monogram tile (no photo) ---------- */
.monogram {
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 5;
	border-radius: 4px;
	background:
		radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent, var(--ink-3)) 14%, transparent), transparent 60%),
		var(--paper-2);
	border: 1px solid var(--rule);
	box-shadow: inset 0 0 0 6px var(--paper-2), inset 0 0 0 7px color-mix(in srgb, var(--accent, var(--ink-3)) 45%, transparent);
	font-size: 3.4rem;
	font-weight: 400;
	font-style: italic;
	color: var(--accent, var(--ink-3));
}

/* ---------- footer ---------- */
.foot {
	margin-top: 6rem;
	padding: 2.5rem var(--gutter) 3rem;
	border-top: 1px solid var(--rule);
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-3);
}
.foot-inner {
	max-width: 1100px;
	margin: 0 auto;
	display: grid;
	gap: 1rem;
}
@media (min-width: 760px) {
	.foot-inner {
		grid-template-columns: 2fr 1fr;
	}
}

/* ---------- atlas ---------- */
.atlas {
	width: 100%;
	height: auto;
	background: var(--sea);
	border-radius: 6px;
}
.atlas-graticule {
	fill: none;
	stroke: var(--grat);
	stroke-width: 0.7;
}
.atlas-land {
	fill: var(--land);
	stroke: var(--land-edge);
	stroke-width: 0.6;
}
.atlas-borders {
	fill: none;
	stroke: var(--land-edge);
	stroke-width: 0.5;
	stroke-dasharray: 2 2;
	opacity: 0.8;
}
.route {
	fill: none;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-dasharray: 1600;
	stroke-dashoffset: 0;
	animation: draw 2.4s var(--ease) both;
	animation-delay: calc(var(--i) * 260ms + 300ms);
	transition: opacity 400ms var(--ease);
}
.route-sullivan {
	stroke: var(--sullivan);
}
.route-sewell {
	stroke: var(--sewell);
}
.route-acadian {
	stroke: var(--acadian);
}
.route-yahn {
	stroke: var(--yahn);
}
.route-mccarthy {
	stroke: var(--mccarthy);
}
.route-brennan {
	stroke: var(--brennan);
}
.route.is-future {
	opacity: 0.08;
}
.atlas-places circle {
	fill: var(--paper);
	stroke: var(--ink-2);
	stroke-width: 1.4;
}
.atlas-labels text {
	font-family: var(--sans);
	font-size: 15px;
	font-weight: 600;
	fill: var(--ink-2);
	paint-order: stroke;
	stroke: var(--sea);
	stroke-width: 4px;
	stroke-linejoin: round;
}
/* The atlas scales down about 3x on a phone; SVG units scale with it, so the
   labels, lines and dots are drawn larger there to land at readable sizes. */
@media (max-width: 699px) {
	.atlas-labels text {
		font-size: 36px;
		stroke-width: 9px;
	}
	.atlas-labels text.minor {
		display: none;
	}
	.route {
		stroke-width: 5;
	}
	.atlas-places circle {
		r: 8;
		stroke-width: 3;
	}
}
@keyframes draw {
	from {
		stroke-dashoffset: 1600;
	}
}

/* ---------- motion ---------- */
.rise {
	animation: rise 700ms var(--ease) both;
}
.rise.d1 {
	animation-delay: 120ms;
}
.rise.d2 {
	animation-delay: 240ms;
}
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
