/*
 * Novelles Labs website. The tokens, type scale and components come from
 * docs/style-guide.html (approved 2026-12-01). Do not change them here
 * without a change to the guide. Dark forest by default, parchment in
 * light mode; the system setting chooses.
 */

/* Fonts: self-hosted Fontsource files, Latin subset (docs/WEBSITE.md). */
@font-face { font-family: "Cormorant"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/cormorant-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-style: italic; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #13251e; --surface: #1b3229; --ink: #ece4d0; --muted: #a9b5ad;
  --green: #8dbba6; --gold: #d1b16f; --line: #2c443a; --on-gold: #13251e;
  --display: "Cormorant", "EB Garamond", Garamond, Georgia, serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root {
  --bg: #f5f0e4; --surface: #fbf8f1; --ink: #17241f; --muted: #4d5a53;
  --green: #1f4a3c; --gold: #7a5c1e; --line: #d9cfb8; --on-gold: #fbf8f1; color-scheme: light } }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); }
/* Pin the footer to the bottom of a short page: main takes the free height. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; }
.wrap { max-width: 60rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
a { color: var(--green); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h3 { font-size: 1.45rem; }
p { margin: 0; max-width: 65ch; }
img { max-width: 100%; height: auto; }
.label { font: 500 0.72rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 0.88em; }

/* Skip link: hidden until it has keyboard focus. */
.skip { position: absolute; left: 16px; top: -10rem; background: var(--gold); color: var(--on-gold); padding: 0.5rem 0.9rem; font-weight: 600; text-decoration: none; z-index: 1; }
.skip:focus { top: 0.75rem; }

/* Site header: the mark, the live wordmark and the main links. */
.site { }
.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 2.25rem; height: 2.25rem; display: block; }
.wordmark { font: 600 1.45rem/1 var(--display); color: var(--ink); }
.wordmark b { font-weight: 600; color: var(--gold); }
.site nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding-block: 0.25rem; border-bottom: 1px solid transparent; }
.site nav a:hover { border-bottom-color: var(--gold); }
.site nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

header.hero { padding-block: 4.5rem 3rem; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; gap: 1.25rem; }
.hero .tag { font-family: var(--display); font-style: italic; font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--gold); }
.vine { width: min(100%, 34rem); height: auto; display: block; }
.hero-art img { width: min(100%, 18rem); height: auto; display: block; }
/* Wide screens: the art sits to the right of the title. Narrow screens: it drops under the tagline. */
@media (min-width: 860px) {
  .hero .wrap:has(> .hero-art) { grid-template-columns: minmax(0, 1fr) auto; column-gap: 2.5rem; }
  .hero .wrap:has(> .hero-art) > * { grid-column: 1; }
  .hero .wrap > .hero-art { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .hero-art img { width: 22rem; }
}

section { padding-block: 3.25rem; border-bottom: 1px solid var(--line); }
.sec { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; }
.sec > div { display: grid; gap: 1.25rem; min-width: 0; }
@media (max-width: 760px) { .sec { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; } }

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill { font: 500 0.75rem var(--mono); padding: 0.2rem 0.6rem; border: 1px solid currentColor; border-radius: 999px; }
.p-live { color: var(--green); } .p-beta { color: var(--gold); } .p-exp { color: var(--ink); } .p-arch { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1.25rem; display: grid; gap: 0.6rem; max-width: 30rem; }
.card .top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.card h3 a { color: var(--ink); text-decoration-color: var(--line); }
.card h3 a:hover { text-decoration-color: var(--gold); }
.btn { display: inline-block; background: var(--gold); color: var(--on-gold); font: 600 0.95rem var(--body); padding: 0.6rem 1.1rem; border-radius: 4px; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

ul.rules { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; max-width: 65ch; }
.callout { border-left: 3px solid var(--gold); border-radius: 0 4px 4px 0; padding: 0.75rem 1rem; background: var(--surface); max-width: 65ch; }
/* The footer is its own zone: a line and the surface color. The last block of main has no line, so only one line sits above the footer. */
main > :last-child { border-bottom: 0; }
footer { padding-block: 2rem 2.5rem; border-top: 1px solid var(--line); background: var(--surface); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
@media (prefers-reduced-motion: no-preference) { .vine path { stroke-dasharray: 900; stroke-dashoffset: 0; animation: draw 2.2s ease-out both; } @keyframes draw { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } } }
.vine .stem { stroke: var(--gold); }
.vine .leaves { fill: var(--gold); opacity: 0.85; }

/* Inner pages: a shorter hero; the project head puts the product logo next to the title. */
header.hero.page { padding-block: 3.5rem 2.5rem; }
.project-head { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1.5rem; }
.project-head > div { display: grid; gap: 0.75rem; }
.product-logo { width: 6rem; height: 6rem; display: block; }
@media (max-width: 480px) { .project-head { grid-template-columns: minmax(0, 1fr); } .product-logo { width: 4.5rem; height: 4.5rem; } }
.emblem img { width: 11rem; height: 11rem; display: block; }
@media (max-width: 760px) { .emblem img { width: 8rem; height: 8rem; } }
.sec ul.rules strong { font-weight: 600; }
