/* ─────────────────────────────────────────────────────────────────────────
   NyayVaani — marketing site
   Design language: "Cross-Examined" — quiet precision, international.
   Every token here is specified in docs/design-language.md. OKLCH only.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
	/* Type */
	--font-serif: "Century Schoolbook", "C059", Georgia, "Times New Roman", serif;
	--font-sans:
		system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono:
		ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
		"Liberation Mono", monospace;

	/* Scale — marketing density (airy) */
	--text-display: clamp(2.7rem, 6.4vw, 4.6rem);
	--text-h2: clamp(1.85rem, 3.6vw, 2.7rem);
	--text-h3: 1.3rem;
	--text-lede: clamp(1.08rem, 1.5vw, 1.22rem);
	--text-body: 1rem;
	--text-small: 0.875rem;
	--text-label: 0.78rem;

	--leading-display: 1.04;
	--leading-heading: 1.14;
	--leading-body: 1.65;

	--tracking-label: 0.09em;
	--tracking-display: -0.015em;

	/* Radius — precision, not friendliness */
	--radius-1: 3px; /* chips, pins, small controls */
	--radius-2: 6px; /* buttons, cells */
	--radius-3: 10px; /* panels, exhibits */

	--container: 1120px;
	--gutter: clamp(1.25rem, 5vw, 3rem);
	--section-pad: clamp(5rem, 13vh, 9.5rem);

	/* Motion */
	--ease-precise: cubic-bezier(0.3, 0, 0.15, 1);
	--dur-quick: 160ms;
}

/* Light — "paper" */
:root,
:root[data-theme="light"] {
	color-scheme: light;
	--paper: oklch(98.5% 0.002 95);
	--paper-2: oklch(96.6% 0.004 95);
	--paper-3: oklch(93.8% 0.005 95);
	--line: oklch(88% 0.006 95);
	--line-strong: oklch(76% 0.008 90);
	--ink: oklch(23% 0.012 75);
	--ink-2: oklch(42% 0.014 75);
	--ink-3: oklch(52% 0.013 75);
	--accent: oklch(43% 0.14 25);
	--accent-strong: oklch(36% 0.135 25);
	--accent-contrast: oklch(98.5% 0.002 95);
	--wash: oklch(43% 0.14 25 / 0.07);
	--mark: oklch(43% 0.14 25 / 0.13);
	--shadow:
		0 1px 2px oklch(23% 0.012 75 / 0.05),
		0 12px 32px -12px oklch(23% 0.012 75 / 0.12);
}

/* Dark — "ink" (warm dark, never pure black) */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		color-scheme: dark;
		--paper: oklch(19.5% 0.008 75);
		--paper-2: oklch(23% 0.009 75);
		--paper-3: oklch(26.5% 0.01 75);
		--line: oklch(31% 0.01 75);
		--line-strong: oklch(40% 0.012 75);
		--ink: oklch(92.5% 0.006 90);
		--ink-2: oklch(75% 0.01 85);
		--ink-3: oklch(66% 0.01 80);
		--accent: oklch(71% 0.115 25);
		--accent-strong: oklch(78% 0.1 25);
		--accent-contrast: oklch(16% 0.02 25);
		--wash: oklch(71% 0.115 25 / 0.1);
		--mark: oklch(71% 0.115 25 / 0.17);
		--shadow:
			0 1px 2px oklch(0% 0 0 / 0.3), 0 12px 32px -12px oklch(0% 0 0 / 0.5);
	}
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--paper: oklch(19.5% 0.008 75);
	--paper-2: oklch(23% 0.009 75);
	--paper-3: oklch(26.5% 0.01 75);
	--line: oklch(31% 0.01 75);
	--line-strong: oklch(40% 0.012 75);
	--ink: oklch(92.5% 0.006 90);
	--ink-2: oklch(75% 0.01 85);
	--ink-3: oklch(66% 0.01 80);
	--accent: oklch(71% 0.115 25);
	--accent-strong: oklch(78% 0.1 25);
	--accent-contrast: oklch(16% 0.02 25);
	--wash: oklch(71% 0.115 25 / 0.1);
	--mark: oklch(71% 0.115 25 / 0.17);
	--shadow:
		0 1px 2px oklch(0% 0 0 / 0.3), 0 12px 32px -12px oklch(0% 0 0 / 0.5);
}

/* ── Reset & base ───────────────────────────────────────────────────────── */

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--text-body);
	line-height: var(--leading-body);
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--accent-strong);
}

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

::selection {
	background: var(--mark);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: var(--accent-contrast);
	padding: 0.6rem 1rem;
	z-index: 100;
}

.skip-link:focus-visible {
	left: 0.75rem;
	top: 0.75rem;
}

.container {
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* ── Shared voice ───────────────────────────────────────────────────────── */

.label {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--ink-3);
}

.kicker {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--accent);
}

/* Pilcrow section anchors — the page anchors its own sections the way the
   product anchors citations: to the paragraph. */
.pilcrow {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	color: var(--ink-3);
	text-decoration: none;
	border: 1px solid var(--line);
	border-radius: var(--radius-1);
	padding: 0.15rem 0.45rem;
	transition:
		color var(--dur-quick) var(--ease-precise),
		border-color var(--dur-quick) var(--ease-precise);
}

.pilcrow:hover {
	color: var(--accent);
	border-color: var(--accent);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in oklch, var(--paper) 88%, transparent);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}

.site-header .container {
	display: flex;
	align-items: center;
	gap: 2rem;
	min-height: 3.75rem;
}

.wordmark {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-serif);
	font-size: 1.22rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	/* The inlined wordmark paints its lettering with `currentColor` and its
	   anchor rule with `--nv-accent`. Both are supplied here, so the mark
	   re-themes with the rest of the page — including the runtime toggle. */
	color: var(--ink);
	--nv-accent: var(--accent);
	text-decoration: none;
}

.wordmark:hover {
	color: var(--ink);
}

.wordmark svg {
	display: block;
	height: 1.375rem;
	width: auto;
}

.site-nav {
	display: flex;
	gap: 1.5rem;
	margin-left: auto;
}

.site-nav a {
	font-size: var(--text-small);
	color: var(--ink-2);
	text-decoration: none;
}

.site-nav a:hover {
	color: var(--accent);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
	display: inline-block;
	font-family: var(--font-sans);
	font-size: var(--text-small);
	font-weight: 600;
	line-height: 1;
	padding: 0.78rem 1.35rem;
	border-radius: var(--radius-2);
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--dur-quick) var(--ease-precise),
		color var(--dur-quick) var(--ease-precise),
		border-color var(--dur-quick) var(--ease-precise);
}

.btn-primary {
	background: var(--accent);
	color: var(--accent-contrast);
}

.btn-primary:hover {
	background: var(--accent-strong);
	color: var(--accent-contrast);
}

.btn-quiet {
	color: var(--ink);
	border-color: var(--line-strong);
	background: transparent;
}

.btn-quiet:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.btn-sm {
	padding: 0.55rem 0.95rem;
}

.theme-toggle {
	appearance: none;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: var(--radius-2);
	color: var(--ink-2);
	width: 2.1rem;
	height: 2.1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition:
		color var(--dur-quick) var(--ease-precise),
		border-color var(--dur-quick) var(--ease-precise);
}

.theme-toggle:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.theme-toggle svg {
	width: 1rem;
	height: 1rem;
}

/* One icon shows at a time */
:root[data-theme="dark"] .icon-moon,
:root:not([data-theme]) .icon-moon {
	display: none;
}
:root[data-theme="light"] .icon-moon {
	display: block;
}
:root[data-theme="light"] .icon-sun {
	display: none;
}
@media (prefers-color-scheme: light) {
	:root:not([data-theme]) .icon-sun {
		display: none;
	}
	:root:not([data-theme]) .icon-moon {
		display: block;
	}
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
	padding-top: clamp(4rem, 10vh, 7rem);
	padding-bottom: clamp(3rem, 7vh, 5rem);
}

.hero-copy {
	max-width: 46rem;
}

.hero .kicker {
	display: block;
	margin-bottom: 1.4rem;
}

.hero h1 {
	font-family: var(--font-serif);
	font-size: var(--text-display);
	font-weight: 700;
	line-height: var(--leading-display);
	letter-spacing: var(--tracking-display);
	text-wrap: balance;
}

.hero .lede {
	margin-top: 1.6rem;
	font-size: var(--text-lede);
	line-height: 1.6;
	color: var(--ink-2);
	max-width: 38rem;
}

.hero-ctas {
	margin-top: 2.2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
}

.hero-facts {
	margin-top: 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	padding: 0;
	list-style: none;
}

.hero-facts li {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	letter-spacing: 0.04em;
	color: var(--ink-3);
}

.hero-facts li::before {
	content: "¶ ";
	color: var(--accent);
}

/* ── The Exhibit ────────────────────────────────────────────────────────── */

.exhibit-wrap {
	padding-bottom: var(--section-pad);
}

.exhibit {
	position: relative;
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-3);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.exhibit-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	justify-content: space-between;
	align-items: center;
	padding: 0.8rem 1.5rem;
	border-bottom: 1px solid var(--line);
}

.exhibit-body {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	padding: clamp(1.5rem, 3.5vw, 2.75rem);
}

.exhibit-q {
	display: flex;
	gap: 0.9rem;
	align-items: baseline;
	padding-bottom: 1.1rem;
	margin-bottom: 1.4rem;
	border-bottom: 1px solid var(--line);
}

.exhibit-q .q-mark {
	font-family: var(--font-mono);
	font-size: var(--text-small);
	color: var(--ink-3);
	flex: none;
}

.exhibit-q p {
	font-weight: 600;
	color: var(--ink);
}

.exhibit-answer {
	font-family: var(--font-serif);
	font-size: 1.06rem;
	line-height: 1.75;
	color: var(--ink);
}

.ans-seg {
	/* JS animates these; visible by default for no-JS / reduced motion */
	display: inline;
}

.verdict {
	font-weight: 700;
}

/* Citation pins */
.pin {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: 0.35em;
	min-width: 1.15rem;
	height: 1.15rem;
	padding-inline: 0.2rem;
	margin-inline: 0.15rem;
	font-family: var(--font-mono);
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1;
	color: var(--accent);
	background: var(--wash);
	border: 1px solid var(--accent);
	border-radius: var(--radius-1);
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--dur-quick) var(--ease-precise),
		color var(--dur-quick) var(--ease-precise);
}

.pin:hover,
.pin.is-active {
	background: var(--accent);
	color: var(--accent-contrast);
}

/* Source cards */
.exhibit-sources {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.source-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-2);
	padding: 1.1rem 1.25rem;
	transition: border-color var(--dur-quick) var(--ease-precise);
}

.source-card.is-active {
	border-color: var(--accent);
}

.source-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: 0.65rem;
}

.source-doc {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	letter-spacing: 0.03em;
	color: var(--ink-2);
}

.source-anchor {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	color: var(--accent);
	white-space: nowrap;
}

.source-quote {
	font-family: var(--font-serif);
	font-size: 0.94rem;
	line-height: 1.65;
	color: var(--ink-2);
}

.source-quote .mark {
	background-image: linear-gradient(var(--mark), var(--mark));
	background-repeat: no-repeat;
	background-size: 100% 100%;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
	border-bottom: 1px solid var(--accent);
	color: var(--ink);
	padding-inline: 0.1em;
}

/* Connector overlay (desktop only, drawn by JS) */
.exhibit-connectors {
	position: absolute;
	inset: 0;
	pointer-events: none;
	display: none;
}

.exhibit-connectors path {
	fill: none;
	stroke: var(--accent);
	stroke-width: 1.25;
	opacity: 0.55;
}

@media (min-width: 900px) {
	.exhibit-connectors {
		display: block;
	}
}

.exhibit-foot {
	padding: 0.7rem 1.5rem;
	border-top: 1px solid var(--line);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section {
	padding-block: var(--section-pad);
	border-top: 1px solid var(--line);
}

.section-head {
	max-width: 46rem;
}

.section-head .head-row {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin-bottom: 1.3rem;
}

.section h1,
.section h2 {
	font-family: var(--font-serif);
	font-size: var(--text-h2);
	font-weight: 700;
	line-height: var(--leading-heading);
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.section .lede {
	margin-top: 1.25rem;
	font-size: var(--text-lede);
	line-height: 1.65;
	color: var(--ink-2);
}

/* Definitions list — features written the way contracts define terms */
.definitions {
	margin-top: 3.25rem;
	display: grid;
	gap: 0;
	border-top: 1px solid var(--line);
}

.definitions > div {
	display: grid;
	grid-template-columns: minmax(10rem, 16rem) 1fr;
	gap: 1rem 3rem;
	padding-block: 1.6rem;
	border-bottom: 1px solid var(--line);
}

.definitions dt {
	font-family: var(--font-serif);
	font-size: var(--text-h3);
	font-weight: 700;
	color: var(--ink);
}

.definitions dt::before {
	content: "“";
	color: var(--accent);
}

.definitions dt::after {
	content: "”";
	color: var(--accent);
}

.definitions dd {
	color: var(--ink-2);
	max-width: 42rem;
}

@media (max-width: 720px) {
	.definitions > div {
		grid-template-columns: 1fr;
		gap: 0.4rem;
	}
}

/* Long-form prose — privacy / terms / colophon body copy */
.prose {
	margin-top: 1.75rem;
	max-width: 44rem;
	color: var(--ink-2);
	font-size: var(--text-body);
	line-height: 1.7;
}

.prose ul,
.prose ol {
	padding-left: 1.4rem;
}

.prose p + p,
.prose ul + p,
.prose p + ul,
.prose p + ol {
	margin-top: 1.1rem;
}

.prose h3 {
	margin-top: 2.5rem;
	margin-bottom: 0.6rem;
	font-family: var(--font-serif);
	font-size: var(--text-h3);
	font-weight: 700;
	color: var(--ink);
}

.prose li + li {
	margin-top: 0.4rem;
}

.prose a {
	color: var(--accent);
}

.prose strong {
	color: var(--ink);
}

/* ── Review table ───────────────────────────────────────────────────────── */

.review-table-wrap {
	margin-top: 3.25rem;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius-3);
	background: var(--paper-2);
	box-shadow: var(--shadow);
}

.review-table {
	width: 100%;
	min-width: 46rem;
	border-collapse: collapse;
	font-size: var(--text-small);
}

.review-table caption {
	text-align: left;
	padding: 0.8rem 1.25rem;
	border-bottom: 1px solid var(--line);
}

.review-table th {
	font-family: var(--font-mono);
	font-size: var(--text-label);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--ink-3);
	text-align: left;
	padding: 0.7rem 1.25rem;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

.review-table td {
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
	color: var(--ink-2);
}

.review-table tr:last-child td {
	border-bottom: none;
}

.review-table td:first-child {
	font-weight: 600;
	color: var(--ink);
	white-space: nowrap;
}

.cell-ref {
	display: inline-block;
	margin-left: 0.45rem;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--accent);
	white-space: nowrap;
}

.cell-flag {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--accent);
	border: 1px dashed var(--accent);
	border-radius: var(--radius-1);
	padding: 0.1rem 0.4rem;
	white-space: nowrap;
}

/* ── Engineering rows ───────────────────────────────────────────────────── */

.engineering-rows {
	margin-top: 3.25rem;
	border-top: 1px solid var(--line);
}

.eng-row {
	display: grid;
	grid-template-columns: minmax(10rem, 16rem) 1fr;
	gap: 0.75rem 3rem;
	padding-block: 1.8rem;
	border-bottom: 1px solid var(--line);
}

.eng-row h3 {
	font-family: var(--font-serif);
	font-size: var(--text-h3);
	font-weight: 700;
	line-height: 1.3;
}

.eng-row .eng-tag {
	display: block;
	margin-bottom: 0.5rem;
}

.eng-row p {
	color: var(--ink-2);
	max-width: 42rem;
}

.eng-row code {
	font-family: var(--font-mono);
	font-size: 0.86em;
	background: var(--paper-3);
	border-radius: var(--radius-1);
	padding: 0.08em 0.35em;
}

@media (max-width: 720px) {
	.eng-row {
		grid-template-columns: 1fr;
	}
}

/* ── CTA ────────────────────────────────────────────────────────────────── */

.cta {
	text-align: center;
}

.cta h2 {
	margin-inline: auto;
}

.cta .lede {
	max-width: 36rem;
	margin-inline: auto;
}

.cta .hero-ctas {
	justify-content: center;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
	border-top: 1px solid var(--line);
	padding-block: 3.5rem;
}

.colophon {
	font-family: var(--font-serif);
	color: var(--ink-2);
	max-width: 34rem;
}

.colophon .devanagari {
	color: var(--ink);
}

.colophon .ipa {
	color: var(--ink-3);
}

.colophon-lead {
	font-size: var(--text-h3);
	line-height: 1.5;
	max-width: 40rem;
}

.footer-links {
	margin-top: 1.4rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
	font-family: var(--font-mono);
	font-size: var(--text-small);
}

.footer-links a {
	color: var(--ink-2);
	text-decoration: none;
}

.footer-links a:hover {
	color: var(--accent);
}

.footer-meta {
	margin-top: 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2rem;
	justify-content: space-between;
	align-items: baseline;
}

.footer-meta .label {
	text-transform: none;
	letter-spacing: 0.03em;
}

/* ── Reveal states ──────────────────────────────────────────────────────── */
/* Nothing here is ever CSS-hidden. landing.js is the only thing that can
   apply a hidden starting state (via GSAP), and only when motion is allowed
   and GSAP is present — see the guard at the top of its "Motion" section.
   No-JS and prefers-reduced-motion visitors always see the full page. */

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.exhibit-body {
		grid-template-columns: 1fr;
	}
	.site-nav {
		display: none;
	}
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		/* biome-ignore lint/complexity/noImportantStyles: the standard reduced-motion reset — !important is required here to override any component-level transition/animation durations, not optional decoration. */
		transition-duration: 0.01ms !important;
		/* biome-ignore lint/complexity/noImportantStyles: see above. */
		animation-duration: 0.01ms !important;
	}
}
