/* The Data Engine, company site. Tokens and rules: ../DESIGN.md */

:root {
	color-scheme: light dark;

	--bg: oklch(1 0 0);
	--surface: oklch(0.955 0.006 70);
	--ink: oklch(0.21 0.018 60);
	--muted: oklch(0.44 0.02 60);
	--rule: oklch(0.86 0.01 70);
	--honey: oklch(0.78 0.16 72);
	--honey-deep: oklch(0.49 0.12 58);
	--teal: oklch(0.42 0.08 195);
	--night: oklch(0.19 0.015 60);
	--night-ink: oklch(0.96 0.005 70);
	--night-muted: oklch(0.72 0.012 70);
	--night-rule: oklch(0.32 0.015 60);
	--on-honey: oklch(0.21 0.018 60);
	--focus: var(--teal);

	--col: 72rem;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--section: clamp(4rem, 10vw, 8rem);
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);

	--z-header: 10;
	--z-skip: 20;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: oklch(0.17 0.012 60);
		--surface: oklch(0.22 0.014 60);
		--ink: oklch(0.96 0.005 70);
		--muted: oklch(0.74 0.012 70);
		--rule: oklch(0.32 0.015 60);
		--honey: oklch(0.82 0.15 78);
		--honey-deep: oklch(0.80 0.13 75);
		--teal: oklch(0.78 0.09 195);
		--night: oklch(0.12 0.01 60);
	}
}

/* Reset, the short version */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
	font-variation-settings: "wdth" 100, "wght" 400;
	font-size: 1.125rem;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { text-wrap: balance; letter-spacing: -0.02em; line-height: 1.05; }
h1 { font-variation-settings: "wdth" 120, "wght" 800; font-size: clamp(2.6rem, 6.5vw, 5.25rem); }
h2 { font-variation-settings: "wdth" 115, "wght" 800; font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
h3 { font-variation-settings: "wdth" 110, "wght" 700; font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.15; }
p { text-wrap: pretty; max-width: 62ch; }
.lede { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.45; max-width: 36ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; font-variation-settings: "wdth" 94, "wght" 500; line-height: 1.5; }

/* Layout primitives */
.wrap { width: min(var(--col), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--rule); }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Skip link */
.skip {
	position: absolute; left: var(--gutter); top: -4rem; z-index: var(--z-skip);
	background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 6px;
	text-decoration: none; transition: top 200ms var(--ease-out);
}
.skip:focus { top: 1rem; }

/* Header */
.site-header {
	position: sticky; top: 0; z-index: var(--z-header);
	background: color-mix(in oklch, var(--bg) 92%, transparent);
	backdrop-filter: none;
	border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; min-height: 4.5rem; }
@media (max-width: 36em) {
	.site-header .wrap { flex-wrap: wrap; padding-block: 0.75rem; min-height: 0; }
	.brand span { font-size: 1.05rem; }
	.nav { width: 100%; gap: 1.25rem; }
	.nav a.nav-contact { display: none; }
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ink); text-decoration: none; }
.brand img { width: 2.25rem; height: 2.25rem; }
.brand span { font-variation-settings: "wdth" 116, "wght" 800; letter-spacing: -0.02em; font-size: 1.2rem; white-space: nowrap; }
.nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.nav a { color: var(--ink); text-decoration: none; font-variation-settings: "wdth" 100, "wght" 500; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--honey); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: 2rem; align-items: end; }
@media (min-width: 60em) {
	.hero-grid { grid-template-columns: 7fr 5fr; gap: 3rem; }
}
.hero-figure-wrap { margin-top: clamp(2rem, 5vw, 3.5rem); }
.hero-title { max-width: 14ch; }
.hero-title em { font-style: normal; color: var(--honey-deep); }
.hero-aside { display: grid; gap: 0.75rem; align-self: end; }
.hero-aside p { max-width: 40ch; }

.hero-figure { margin: 0; position: relative; }
.hero-figure img {
	width: 100%; aspect-ratio: 2.4 / 1; object-fit: cover; object-position: 50% 45%;
	border-radius: 6px;
}
.hero-figure figcaption { margin-top: 0.75rem; }

/* Product index band (honey) */
.band-honey { background: var(--honey); color: var(--on-honey); }
.band-honey a { color: inherit; }
.band-honey .muted { color: oklch(0.32 0.04 60); }
@media (prefers-color-scheme: dark) { .band-honey .muted { color: oklch(0.30 0.04 60); } }
.index-list { display: grid; gap: 0; border-top: 1px solid oklch(0.21 0.02 60 / 0.25); }
.index-list li { border-bottom: 1px solid oklch(0.21 0.02 60 / 0.25); }
.index-list a {
	display: grid; gap: 0.35rem 2rem; padding: 1.4rem 0; text-decoration: none;
	grid-template-columns: 1fr; align-items: baseline;
}
@media (min-width: 48em) { .index-list a { grid-template-columns: 16rem 1fr auto; } }
.index-list h3 { font-variation-settings: "wdth" 116, "wght" 800; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.index-list .arrow { font-variation-settings: "wdth" 110, "wght" 700; justify-self: end; transition: transform 300ms var(--ease-out); }
.index-list a:hover .arrow { transform: translateX(0.35rem); }
.index-list a:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }

/* Product rows */
.product { display: grid; gap: 2rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.product + .product { border-top: 1px solid var(--rule); }
@media (min-width: 60em) {
	.product { grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 5rem); }
	.product.flip .product-media { order: -1; }
}
.product-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.25rem; }
.product-head img { width: 2.75rem; height: 2.75rem; border-radius: 22%; }
.product-head .kind { display: block; color: var(--muted); }
.product-body > * + * { margin-top: 1rem; }
.product-body ul { padding-left: 1.1rem; list-style: square; max-width: 58ch; }
.product-body li::marker { color: var(--honey-deep); }
.product-body li + li { margin-top: 0.35rem; }
.product-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1.5rem; }

.product-media { margin: 0; }
.shot {
	border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
	background: var(--surface);
}
.shot img { width: 100%; }
.phones { display: flex; justify-content: center; gap: clamp(1rem, 3vw, 2rem); align-items: flex-end; }
.phone {
	width: min(40%, 15rem); border-radius: 1.6rem; padding: 0.5rem; background: var(--night);
	border: 1px solid var(--rule);
}
.phone img { border-radius: 1.2rem; }
.phone.back { width: min(34%, 12.5rem); margin-bottom: 2.5rem; }
.product-media figcaption { margin-top: 0.75rem; }

/* Roster illustration */
.roster { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); }

/* Networks list */
.networks { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 2.5rem; border-top: 1px solid var(--rule); }
.networks li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.networks li > :last-child { white-space: nowrap; text-align: right; }
.networks .swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; margin-right: 0.6rem; vertical-align: -1px; }

/* Two column prose */
.cols { display: grid; gap: 2rem; }
@media (min-width: 60em) { .cols { grid-template-columns: 5fr 7fr; gap: 4rem; } }
.cols h2 { max-width: 12ch; }

/* Definition list (facts) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 2rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.facts dt { color: var(--muted); font-variation-settings: "wdth" 96, "wght" 500; }
.facts dd { margin: 0; }
@media (max-width: 30em) { .facts { grid-template-columns: 1fr; gap: 0.15rem; } .facts dd + dt { margin-top: 0.8rem; } }

/* Timeline */
.timeline { border-top: 1px solid var(--rule); }
.timeline li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.timeline .year { font-variation-settings: "wdth" 110, "wght" 700; font-variant-numeric: tabular-nums; }

/* Contact band (night) */
.band-night { background: var(--night); color: var(--night-ink); }
.band-night a { color: var(--night-ink); }
.band-night .muted { color: var(--night-muted); }
.band-night h2 em { font-style: normal; color: var(--honey); }
.contact-grid { display: grid; gap: 2rem; }
@media (min-width: 60em) { .contact-grid { grid-template-columns: 7fr 5fr; gap: 4rem; } }
.contact-list { display: grid; gap: 1rem; border-top: 1px solid var(--night-rule); padding-top: 1.25rem; }
.contact-list dt { color: var(--night-muted); }
.contact-list dd { margin: 0; font-size: 1.2rem; }
.email { font-variation-settings: "wdth" 104, "wght" 600; text-decoration-color: var(--honey); word-break: break-all; }

/* Footer */
.site-footer { padding-block: 2rem 2.5rem; border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; align-items: center; }
.site-footer .nav a { font-variation-settings: "wdth" 96, "wght" 500; }

/* Motion. Default state is visible; animation only adds a drift where supported. */
@media (prefers-reduced-motion: no-preference) {
	.hero-title, .hero-aside, .hero-figure {
		animation: rise 700ms var(--ease-out) both;
	}
	.hero-aside { animation-delay: 120ms; }
	.hero-figure { animation-delay: 220ms; }

	@supports (animation-timeline: view()) {
		.product-media, .product-body, .cols > *, .index-list li {
			animation: drift linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 40%;
		}
	}
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { opacity: 0.35; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.index-list .arrow { transition: none; }
}

/* Print */
@media print {
	.site-header, .skip { position: static; }
	.band-honey, .band-night { background: none; color: inherit; }
}
