/*
 * decodewine.com
 * Tokens follow the design system shared by wine-cellar (src/app.css) and
 * wine-companion (tailwind.config.js): oxblood chrome, cream paper, muted gold.
 * Layout follows the design canvas "Decode Wine homepage".
 */

@font-face {
	font-family: 'Fraunces Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('/fonts/fraunces-latin-opsz-normal.woff2') format('woff2-variations');
}
@font-face {
	font-family: 'Fraunces Variable';
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url('/fonts/fraunces-latin-opsz-italic.woff2') format('woff2-variations');
}

:root {
	color-scheme: light dark;
	--paper: #f8f2e6;
	--surface: #fdf9ef;
	--surface-raised: #fffaf3;
	--surface-sunken: #f0e8d9;
	--chrome: #2a0f14;
	--chrome-line: #5a1626;
	--on-chrome: #f3ede2;
	--on-chrome-muted: #c9b9ad;
	--on-chrome-accent: #e79aa8;
	--ink: #2a0f14;
	--ink-muted: #6b5754;
	--hairline: #e4d9c9;
	--border-control: #8f7f7a;
	--accent: #8a2a3a;
	--accent-strong: #5a1626;
	--on-accent: #fdf9ef;
	--gold: #b89961;
	--gold-bright: #d4bd89;
	--gold-ink: #74582a;
	--focus: #1f5fae;
	--success: #17666e;
	--warning-soft: #f6e6c0;
	--on-soft: #2a0f14;
	--type-red: #8c2239;
	--type-white: #f0e3a6;
	--type-rose: #e0909f;
	--type-orange: #b37514;

	/* The paper label keeps its colours in both themes. */
	--label-paper: #fdf9ef;
	--label-ink: #2a0f14;
	--label-accent: #8a2a3a;
	--label-gold-ink: #74582a;
	--label-muted: #6b5754;

	--family-display: 'Fraunces Variable', 'Cormorant Garamond', Georgia, serif;
	--family-sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--family-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

	--gutter: clamp(16px, 4vw, 32px);
	--width-page: 1200px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #170b0e;
		--surface: #20111a;
		--surface-raised: #2b181f;
		--surface-sunken: #10070a;
		--chrome: #0d0507;
		--chrome-line: #3a252b;
		--ink: #f3ede2;
		--ink-muted: #c9bab1;
		--hairline: #3a252b;
		--border-control: #8a777b;
		--accent: #e79aa8;
		--accent-strong: #f3bcc6;
		--on-accent: #2a0f14;
		--gold: #d4bd89;
		--gold-ink: #d4bd89;
		--focus: #8fc1ff;
		--success: #74c8d0;
		--warning-soft: #3b2a08;
		--on-soft: #f3ede2;
		--type-red: #b9506a;
		--type-rose: #e496a5;
		--type-orange: #bd7d16;
	}
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--family-sans);
	font-size: 16px;
	line-height: 1.6;
}

a {
	color: inherit;
}

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

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

.label-caps {
	margin: 0;
	font-size: 11px;
	line-height: 16px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold-ink);
}

.mono {
	font-family: var(--family-mono);
}

/* ---------- Chrome: header and hero ---------- */

.chrome {
	background: var(--chrome);
	color: var(--on-chrome);
	border-bottom: 1px solid var(--gold);
}
.chrome .label-caps {
	color: var(--gold-bright);
}

.masthead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding-block: 22px;
}

.wordmark {
	font-family: var(--family-display);
	font-size: 24px;
	font-weight: 500;
	letter-spacing: -0.01em;
	text-decoration: none;
	color: var(--on-chrome);
}
.wordmark em {
	color: var(--gold-bright);
	font-weight: 400;
}

.masthead nav {
	display: flex;
	align-items: center;
	gap: clamp(16px, 3vw, 28px);
	font-size: 14px;
}
.masthead nav a {
	text-decoration: none;
	color: var(--on-chrome-muted);
	padding-block: 12px;
}
.masthead nav a:hover {
	color: var(--on-chrome);
}
.masthead nav a.lang {
	color: var(--gold-bright);
	border: 1px solid var(--gold);
	border-radius: 2px;
	padding: 5px 9px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.hero {
	padding-block: clamp(40px, 6vw, 72px) clamp(56px, 9vw, 112px);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 64px 72px;
}

.hero-copy {
	flex: 1 1 420px;
	min-width: 0;
}

h1 {
	font-family: var(--family-display);
	font-weight: 400;
	font-size: clamp(3.5rem, 9vw, 7rem);
	line-height: 0.95;
	letter-spacing: -0.03em;
	margin: 18px 0 28px;
}
h1 em {
	color: var(--gold-bright);
	font-weight: 300;
}

.lead {
	font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
	line-height: 1.55;
	color: var(--on-chrome-muted);
	margin: 0 0 36px;
	max-width: 520px;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 24px;
	border-radius: 2px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	transition:
		background-color 0.15s,
		border-color 0.15s;
}
.btn::after {
	content: '\2192';
	transition: transform 0.15s;
}
.btn:hover::after {
	transform: translateX(3px);
}
.btn-gold {
	background: var(--gold-bright);
	color: #2a0f14;
}
.btn-gold:hover {
	background: #e8dcc6;
}
.btn-ghost {
	border-color: var(--on-chrome-muted);
	color: var(--on-chrome);
}
.btn-ghost:hover {
	border-color: var(--on-chrome);
}
.btn-accent {
	min-height: 48px;
	padding: 0 22px;
	background: var(--accent);
	color: var(--on-accent);
}
.btn-accent:hover {
	background: var(--accent-strong);
}

/* ---------- The decoded label ---------- */

.decode {
	flex: 1 1 460px;
	min-width: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 32px 40px;
}

.bottle-label {
	flex: 0 0 auto;
	width: 264px;
	max-width: 100%;
	background: var(--label-paper);
	color: var(--label-ink);
	border-radius: 3px;
	padding: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	transform: rotate(-2deg);
}
.bottle-label-frame {
	border: 1px solid #b89961;
	padding: 30px 18px 26px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.bottle-label sup {
	font-family: var(--family-mono);
	font-size: 10px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: 0;
	margin-left: 4px;
	color: var(--label-gold-ink);
}
.bottle-label sup.cellar {
	color: var(--label-accent);
}
.bl-producer {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}
.bl-appellation {
	font-family: var(--family-display);
	font-style: italic;
	font-size: 36px;
	line-height: 1.05;
	color: var(--label-accent);
}
.bl-class {
	font-family: var(--family-display);
	font-size: 16px;
	letter-spacing: 0.04em;
}
.bl-rule {
	width: 48px;
	height: 1px;
	background: #b89961;
	margin: 2px auto;
}
.bl-vintage {
	font-family: var(--family-display);
	font-weight: 300;
	font-size: 56px;
	line-height: 1;
}
.bl-small {
	font-family: var(--family-mono);
	font-size: 11px;
	letter-spacing: 0.06em;
	color: var(--label-muted);
}

.legend {
	flex: 1 1 220px;
	min-width: 0;
	max-width: 300px;
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--on-chrome-muted);
}
.legend li {
	display: flex;
	gap: 12px;
}
.legend .n {
	flex: 0 0 22px;
	font-family: var(--family-mono);
	font-size: 12px;
	color: var(--gold-bright);
}
.legend .tag {
	display: block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold-bright);
}
.legend .cellar .n,
.legend .cellar .tag {
	color: var(--on-chrome-accent);
}
.legend .first-cellar {
	padding-top: 14px;
	border-top: 1px solid var(--chrome-line);
}
.legend .caption {
	font-size: 12px;
	padding-left: 34px;
}

/* ---------- Paper sections ---------- */

.section {
	padding-block: clamp(64px, 9vw, 112px) clamp(56px, 8vw, 96px);
}

h2 {
	font-family: var(--family-display);
	font-weight: 400;
	font-size: clamp(2.25rem, 5vw, 3.75rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 14px 0 clamp(32px, 5vw, 56px);
	max-width: 760px;
}
h2 em {
	color: var(--accent);
}

.volumes {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
}

.volume {
	flex: 1 1 380px;
	min-width: 0;
	background: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: 2px;
	display: flex;
	flex-direction: column;
}

.preview {
	background: var(--surface-sunken);
	border-bottom: 1px solid var(--hairline);
	padding: clamp(20px, 4vw, 32px);
}
.preview-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-ink);
}
.preview-head .mono {
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--ink-muted);
}

/* Preview I: a grape entry of the companion. */
.grape {
	background: var(--surface-raised);
	border: 1px solid var(--hairline);
	border-radius: 2px;
	padding: 24px 24px 22px;
}
.grape-name {
	margin-top: 10px;
	font-family: var(--family-display);
	font-size: 34px;
	line-height: 1.1;
	font-weight: 500;
	letter-spacing: -0.015em;
}
.grape-alias {
	margin-top: 4px;
	font-family: var(--family-display);
	font-style: italic;
	color: var(--ink-muted);
}
.facts {
	margin: 20px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0 28px;
	border-top: 1px solid var(--hairline);
}
.facts div {
	flex: 1 1 110px;
	padding-top: 12px;
}
.facts dt {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-muted);
}
.facts dd {
	margin: 0;
	font-size: 14px;
}
.chips {
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
}
.chips li {
	border: 1px solid var(--border-control);
	border-radius: 999px;
	padding: 3px 12px;
}

/* Preview II: a rack of the cellar map. */
.map {
	margin-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.map-row {
	display: flex;
	gap: 4px;
}
.mc {
	flex: 1 1 0;
	aspect-ratio: 1;
	border: 1px solid var(--border-control);
	border-radius: 2px;
	background: var(--surface-sunken);
}
.mc.r {
	background: var(--type-red);
}
.mc.w {
	background: var(--type-white);
}
.mc.p {
	background: var(--type-rose);
}
.mc.o {
	background: var(--type-orange);
}
.mc.sel {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}
.mc.same {
	box-shadow: inset 0 0 0 2px var(--surface);
}
.bottle {
	margin-top: 18px;
	background: var(--surface-raised);
	border: 1px solid var(--hairline);
	border-radius: 2px;
	padding: 14px 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}
.wine-name {
	display: block;
	font-family: var(--family-display);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.25;
}
.wine-meta {
	display: block;
	font-size: 13px;
	color: var(--ink-muted);
}
.bottle-state {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}
.bin {
	font-family: var(--family-mono);
	font-size: 13px;
	font-weight: 500;
}
.badge {
	font-size: 12px;
	font-weight: 600;
	background: var(--warning-soft);
	color: var(--on-soft);
	border-radius: 4px;
	padding: 2px 8px;
}

.volume-body {
	padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 40px) clamp(24px, 4vw, 40px);
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}
.volume-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}
.numeral {
	font-family: var(--family-display);
	font-style: italic;
	font-size: 22px;
	color: var(--gold-ink);
}
.host {
	font-family: var(--family-mono);
	font-size: 12px;
	color: var(--ink-muted);
	overflow-wrap: anywhere;
	text-align: right;
}

h3 {
	font-family: var(--family-display);
	font-weight: 500;
	font-size: clamp(1.875rem, 3.2vw, 2.375rem);
	line-height: 1.1;
	letter-spacing: -0.015em;
	margin: 16px 0 6px;
}
.promise {
	font-family: var(--family-display);
	font-style: italic;
	font-size: 19px;
	color: var(--accent);
	margin: 0 0 24px;
}

.counts {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 32px;
	padding-block: 18px;
	border-top: 1px solid var(--hairline);
}
.counts div {
	flex: 1 1 90px;
	display: flex;
	flex-direction: column-reverse;
}
.counts dd {
	margin: 0;
	font-family: var(--family-display);
	font-size: 32px;
	line-height: 1.1;
}
.counts dt {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-muted);
}

.features {
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
	border-top: 1px solid var(--hairline);
}
.features li {
	padding: 14px 0;
	border-bottom: 1px solid var(--hairline);
	font-size: 15px;
	line-height: 1.5;
	color: var(--ink-muted);
}
.features strong {
	display: block;
	color: var(--ink);
	font-weight: 600;
}

.volume-foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--ink-muted);
}
.status::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--success);
}
.status-early::before {
	background: transparent;
	border: 2px solid var(--gold-ink);
}

/* ---------- Shared vocabulary ---------- */

.shared {
	background: var(--surface-sunken);
	border-block: 1px solid var(--hairline);
}
.shared-grid {
	padding-block: clamp(56px, 8vw, 96px);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 48px 72px;
}
.shared-copy {
	flex: 1 1 380px;
	min-width: 0;
}
.shared-copy h2 {
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1.08;
	margin-bottom: 24px;
}
.shared-copy p:not(.label-caps) {
	margin: 0 0 16px;
	max-width: 520px;
	font-size: 17px;
	color: var(--ink-muted);
}
.shared-copy p:last-child {
	margin-bottom: 0;
}
.shared-copy strong {
	color: var(--ink);
	font-weight: 600;
}

.link-demo {
	flex: 1 1 420px;
	min-width: 0;
	margin: 0;
}
.entry {
	background: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: 2px;
	padding: 16px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
}
.entry-learn {
	background: var(--surface-raised);
	border-top: 3px solid var(--gold);
}
.entry-learn .wine-name {
	font-size: 22px;
	line-height: 1.2;
}
.entry-text {
	flex: 1 1 200px;
	min-width: 0;
}
.dot {
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--type-red);
	border: 1px solid var(--border-control);
}
.entry-tag {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
}
.entry-learn .entry-tag {
	color: var(--gold-ink);
}
.link-line {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-left: 26px;
	font-family: var(--family-mono);
	font-size: 12px;
	color: var(--gold-ink);
}
.link-line::before {
	content: '';
	width: 1px;
	height: 44px;
	background: var(--gold);
}

/* ---------- Footer ---------- */

.footer {
	border-bottom: 0;
	border-top: 1px solid var(--gold);
	font-size: 14px;
	color: var(--on-chrome-muted);
}
.footer .wrap {
	padding-block: 36px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
}
.footer .wordmark {
	font-size: 22px;
}
.footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 28px;
}
.footer li a {
	text-decoration: none;
	display: inline-block;
	padding-block: 10px;
}
.footer li a:hover {
	color: var(--on-chrome);
	text-decoration: underline;
}

/* ---------- 404 ---------- */

body.chrome {
	border-bottom: 0;
}
.lost {
	min-height: 100vh;
	display: grid;
	place-items: center;
	text-align: center;
	padding: var(--gutter);
}
.lost h1 {
	font-size: clamp(2.5rem, 8vw, 4.5rem);
	line-height: 1;
}
.lost .lead {
	margin-inline: auto;
}
.lost .actions {
	justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
