/* Nygaard Digital — site styles
   Type: Bricolage Grotesque (display + text), Instrument Serif italic (accent), JetBrains Mono (labels).
   All fonts are Google Fonts, self-hosted so visitors make no third-party requests. */

@font-face { font-family: "Bricolage Grotesque"; src: url(/assets/fonts/bricolage-grotesque.woff2) format("woff2"); font-weight: 300 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/assets/fonts/instrument-serif-italic.woff2) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/assets/fonts/jetbrains-mono.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lilita One"; src: url(/assets/fonts/lilita-one.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Caveat"; src: url(/assets/fonts/caveat.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #ECEEF6;
  --bg-2: #E1E4EF;
  --surface: #FFFFFF;
  --ink: #0B0D1A;
  --ink-2: #33384E;
  --muted: #565C75;
  --line: rgba(11, 13, 26, .14);
  --signal: #3A2BFF;
  --signal-ink: #FFFFFF;
  --volt: #C8FF3D;
  --volt-ink: #0B0D1A;
  --grid: rgba(11, 13, 26, .05);

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --radius: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07080E;
    --bg-2: #0E1020;
    --surface: #12142A;
    --ink: #ECEEF8;
    --ink-2: #C3C7DC;
    --muted: #9298B3;
    --line: rgba(236, 238, 248, .14);
    --signal: #8579FF;
    --signal-ink: #07080E;
    --grid: rgba(236, 238, 248, .045);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--volt); color: var(--volt-ink); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-head.scrolled { border-bottom-color: var(--line); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-head { background: var(--bg); } }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; transition: transform .5s var(--ease); }
.brand:hover svg { transform: rotate(-8deg) scale(1.05); }
.brand b { font-weight: 800; }
.brand span { font-weight: 400; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .95rem; color: var(--ink-2); transition: background .2s, color .2s; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.langs { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--f-mono); font-size: .75rem; }
.langs > span { color: var(--muted); opacity: .6; }
.nav .langs a { padding: 6px 9px; font-size: .75rem; color: var(--muted); }
.nav .langs a[aria-current] { background: var(--ink); color: var(--bg); font-weight: 600; }
@media (max-width: 640px) { .nav > a { display: none; } .brand span { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(40px, 7vw, 96px) clamp(48px, 7vw, 88px); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: center; }
@media (max-width: 920px) { .hero .wrap { grid-template-columns: 1fr; } }

.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); margin: 0 0 24px; }
.kicker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 0 4px color-mix(in srgb, var(--volt) 35%, transparent); animation: pulse 2.4s var(--ease) infinite; }
@media (prefers-color-scheme: light) { .kicker .dot { background: var(--signal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 22%, transparent); } }

.hero h1 {
  margin: 0;
  font-size: clamp(2.9rem, 7.6vw, 7.2rem);
  line-height: .9;
  letter-spacing: -.028em;
  font-weight: 800;
  font-stretch: 78%;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; animation: rise 1s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .08s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .16s; }
.hero h1 .serif { font-stretch: normal; font-size: 1.08em; letter-spacing: -.02em; color: var(--signal); padding-right: .06em; }
.hero h1 .hl { position: relative; white-space: nowrap; }
.hero h1 .hl::after {
  content: ""; position: absolute; left: -.04em; right: -.04em; bottom: .08em; height: .2em; z-index: -1;
  background: var(--volt); transform-origin: left; animation: swipe .9s .7s var(--ease) both;
}
@media (prefers-color-scheme: dark) { .hero h1 .hl::after { opacity: .9; } .hero h1 .hl { color: var(--ink); } }

.hello {
  display: flex; gap: 16px; align-items: flex-start;
  margin: clamp(28px, 4vw, 40px) 0 0; max-width: 34rem;
  font-size: clamp(1.08rem, 1.6vw, 1.25rem); line-height: 1.5; color: var(--ink-2);
}
.hello .wave { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--f-mono); font-size: .8rem; font-weight: 600; }
.hello strong { color: var(--ink); font-weight: 700; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; animation: fade 1s .5s var(--ease) both; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 22px;
  border-radius: 999px; border: 1.5px solid currentColor; text-decoration: none; font-weight: 600; font-size: 1rem;
  background: transparent; color: inherit; cursor: pointer; font-family: inherit;
  transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { box-shadow: 6px 6px 0 var(--signal); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn:hover .arr.down { transform: translateY(3px); }

/* App shelf (hero art) */
.shelf { position: relative; aspect-ratio: 1 / 1; max-width: 520px; width: 100%; justify-self: center; --mx: 0; --my: 0; }
@media (max-width: 920px) { .shelf { max-width: 420px; } }
.shelf .tile {
  position: absolute; width: 38%; aspect-ratio: 1; border-radius: 23%;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 24px 48px -16px rgba(11, 13, 26, .45), 0 4px 10px -4px rgba(11,13,26,.3);
  overflow: hidden; display: grid; place-items: center;
  transform: translate3d(calc(var(--mx) * var(--d) * 1px), calc(var(--my) * var(--d) * 1px), 0) rotate(var(--r));
  transition: transform .6s var(--ease);
  animation: pop .9s var(--ease) both, bob 7s ease-in-out infinite;
  animation-delay: var(--delay), calc(var(--delay) + 1s);
}
.shelf .tile > * { width: 100%; height: 100%; }
.shelf .t1 { left: 4%;  top: 6%;  --r: -7deg; --d: 18; --delay: .2s; }
.shelf .t2 { left: 52%; top: 0%;  --r: 6deg;  --d: -14; --delay: .3s; }
.shelf .t3 { left: 30%; top: 36%; --r: -2deg; --d: 26; --delay: .4s; z-index: 2; width: 42%; }
.shelf .t4 { left: 2%;  top: 58%; --r: 8deg;  --d: -20; --delay: .5s; }
.shelf .t5 { left: 60%; top: 56%; --r: -6deg; --d: 12; --delay: .6s; box-shadow: none; border: 2px dashed var(--line); background: transparent; }
.shelf .t5 span { display: grid; place-items: center; font-family: var(--f-mono); color: var(--muted); font-size: clamp(.6rem, 1.4vw, .75rem); text-align: center; line-height: 1.6; }
.shelf .t5 i { font-style: normal; font-size: 2.2em; line-height: 1; color: var(--ink-2); display: block; }
.shelf .tag {
  position: absolute; z-index: 3; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .04em;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.35);
  animation: fade .8s 1s var(--ease) both;
}
.shelf .tag-a { left: 40%; top: 30%; }
.shelf .tag-b { left: 0%; top: 50%; }
.shelf .tag-b::before, .shelf .tag-a::before { content: "●"; color: var(--signal); margin-right: 6px; }

/* ---------- Ticker ---------- */
.ticker { border-block: 1px solid var(--line); background: var(--ink); color: var(--bg); overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.ticker ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.ticker li { display: flex; align-items: center; gap: 28px; padding: 18px 14px; font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; font-stretch: 85%; }
.ticker li::after { content: "✳"; color: var(--volt); font-weight: 400; margin-left: 14px; }
@media (prefers-color-scheme: dark) { .ticker { background: var(--volt); color: var(--volt-ink); } .ticker li::after { color: var(--signal-ink); } }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* ---------- Sections ---------- */
section { scroll-margin-top: 80px; }
.section { padding-block: clamp(72px, 10vw, 140px); }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: 12px 28px; align-items: end; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head .mono { color: var(--muted); grid-column: 1 / -1; }
.sec-head h2 { margin: 0; font-size: clamp(2.4rem, 6vw, 5rem); line-height: .95; letter-spacing: -.03em; font-weight: 800; font-stretch: 82%; font-variation-settings: "opsz" 96; }
.sec-head p { margin: 0; color: var(--ink-2); max-width: 30rem; justify-self: end; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } .sec-head p { justify-self: start; } }

/* ---------- Product cards ---------- */
.apps { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.card {
  --c-bg: #222; --c-ink: #fff; --c-muted: rgba(255,255,255,.75); --c-accent: #fff; --c-accent-ink: #000; --c-line: rgba(255,255,255,.2);
  position: relative; grid-column: span 6; min-height: 420px; display: flex; flex-direction: column;
  background: var(--c-bg); color: var(--c-ink); border-radius: var(--radius); padding: clamp(24px, 3vw, 40px);
  overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(11, 13, 26, .55); }
.card .num { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; color: var(--c-muted); display: flex; justify-content: space-between; gap: 12px; margin-bottom: auto; padding-bottom: 28px; text-transform: uppercase; }
.card h3 { margin: 0 0 12px; font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: .95; letter-spacing: -.025em; font-weight: 800; }
.card p { margin: 0 0 20px; color: var(--c-muted); max-width: 32rem; }
.card .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.card .chips li { font-size: .85rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--c-line); color: var(--c-ink); }
.card .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card .btn { min-height: 44px; padding: 10px 18px; font-size: .95rem; border-color: var(--c-line); }
.card .btn:hover { border-color: var(--c-ink); }
.card .btn-fill { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); }
.card .btn-fill:hover { border-color: var(--c-accent); box-shadow: 0 8px 24px -10px var(--c-accent); }
.card .art { position: absolute; z-index: -1; pointer-events: none; }
.store small { display: block; font-size: .66rem; font-weight: 500; line-height: 1; opacity: .8; letter-spacing: .02em; }
.store { flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; justify-content: center; }

/* Gaffa XI — chalkboard */
.card.gaffa {
  grid-column: 1 / -1; min-height: 0;
  --c-bg: #1B3D2B; --c-ink: #F4F1E6; --c-muted: rgba(244, 241, 230, .8); --c-accent: #FFE873; --c-accent-ink: #1B3D2B; --c-line: rgba(244, 241, 230, .28);
  background: radial-gradient(120% 90% at 0% 0%, #24503A 0%, #1B3D2B 55%, #15301F 100%);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(20px, 3vw, 48px); align-items: center;
}
.card.gaffa .copy { display: flex; flex-direction: column; }
.card.gaffa .num { margin-bottom: 0; }
.card.gaffa h3 { font-family: "Lilita One", var(--f-display); font-weight: 400; letter-spacing: .01em; font-size: clamp(2.8rem, 6vw, 5rem); display: flex; align-items: center; gap: 16px; }
.card.gaffa h3 img { width: clamp(52px, 6vw, 72px); height: auto; border-radius: 22%; box-shadow: 0 8px 20px -8px rgba(0,0,0,.6); }
.card.gaffa .scrawl { font-family: "Caveat", cursive; font-weight: 600; color: var(--c-accent); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.1; margin: 0 0 16px; transform: rotate(-2deg); transform-origin: left; }
.card.gaffa .steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 18px; padding: 0; list-style: none; font-family: "Lilita One", var(--f-display); font-size: 1.15rem; letter-spacing: .01em; }
.card.gaffa .steps li::after { content: "→"; margin-left: 14px; color: var(--c-accent); font-family: var(--f-display); }
.card.gaffa .steps li:last-child::after { content: none; }
.card.gaffa .shot { border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); transform: rotate(1.2deg); transition: transform .6s var(--ease); background: #1B3D2B; }
.card.gaffa:hover .shot { transform: rotate(0deg) scale(1.01); }
.card.gaffa .shot img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 860px) { .card.gaffa { grid-template-columns: 1fr; } .card.gaffa .shot { order: -1; } }

/* Moonsy — bedtime night sky */
.card.moonsy {
  grid-column: span 7;
  --c-bg: #141B3D; --c-ink: #F4F1FA; --c-muted: rgba(232, 225, 245, .8); --c-accent: #F5D98B; --c-accent-ink: #141B3D; --c-line: rgba(201, 191, 224, .35);
  background: linear-gradient(160deg, #0F1630 0%, #1B2350 50%, #2A2350 100%);
}
.card.moonsy h3 { font-weight: 700; font-stretch: 100%; letter-spacing: -.03em; }
.card.moonsy .art.moon { right: -50px; top: 56px; width: 300px; height: 300px; }
@media (max-width: 600px) { .card.moonsy .art.moon { width: 190px; height: 190px; right: -60px; top: auto; bottom: -50px; opacity: .55; } }
.card.moonsy .star { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #F5D98B; opacity: .7; animation: twinkle 4s ease-in-out infinite; }

/* Hjemmetavlen — wall board */
.card.tavle {
  grid-column: span 5;
  --c-bg: #171E26; --c-ink: #E8EDF2; --c-muted: #9AA8B4; --c-accent: #37B87C; --c-accent-ink: #0E1A14; --c-line: #3A4854;
}
.card.tavle .board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 24px; padding: 12px; border-radius: 16px; background: #1F2731; border: 1px solid #29333E; }
.card.tavle .board span { font-family: var(--f-mono); font-size: .6rem; color: #6B7883; text-align: center; text-transform: uppercase; padding-bottom: 2px; }
.card.tavle .board i { display: block; height: 14px; border-radius: 5px; background: var(--k, #29333E); transform-origin: left; }
.card.tavle .board i.g { --k: #37B87C; } .card.tavle .board i.o { --k: #F2A03D; } .card.tavle .board i.b { --k: #4F86F7; }
.card.tavle .board i.e { --k: transparent; }

/* GlutenTrace — wheat field */
.card.gluten {
  --c-bg: #E7EEE2; --c-ink: #1E3A2A; --c-muted: #3E5747; --c-accent: #2C4E39; --c-accent-ink: #FAF6EF; --c-line: rgba(44, 78, 57, .3);
  background: linear-gradient(150deg, #EEF3EA 0%, #DDE8D6 100%);
}
.card.gluten .art.wheat { right: 6%; bottom: 8%; width: 120px; height: 200px; transform: rotate(14deg); }
@media (prefers-color-scheme: dark) {
  .card.gluten { --c-bg: #15271C; --c-ink: #EEF3EA; --c-muted: #B6C7BA; --c-accent: #E3B562; --c-accent-ink: #15271C; --c-line: rgba(238, 243, 234, .25); background: linear-gradient(150deg, #1A2F22 0%, #122017 100%); }
}

/* More on the way */
.card.next {
  --c-bg: transparent; --c-ink: var(--ink); --c-muted: var(--muted); --c-line: var(--line);
  border: 2px dashed var(--line); background: repeating-linear-gradient(-45deg, transparent 0 14px, var(--grid) 14px 15px);
}
.card.next:hover { box-shadow: none; }
.card.next .plus { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 2rem; line-height: 1; margin-bottom: 18px; transition: transform .8s var(--ease); }
.card.next:hover .plus { transform: rotate(90deg); }

@media (max-width: 980px) { .card.moonsy, .card.tavle, .card.gluten, .card.next { grid-column: 1 / -1; } }
@media (max-width: 520px) { .card { min-height: 0; border-radius: 22px; } .card .num { padding-bottom: 20px; } }

/* ---------- About me ---------- */
.about { background: var(--bg-2); border-block: 1px solid var(--line); }
.about .grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .about .grid { grid-template-columns: 1fr; } }

.portrait { position: relative; aspect-ratio: 4 / 5; max-width: 420px; border-radius: var(--radius); background: var(--bg); border: 2px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.portrait::before, .portrait::after { content: ""; position: absolute; width: 28px; height: 28px; border: 3px solid var(--signal); }
.portrait::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.portrait::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.portrait .ph-mark { width: 72px; height: 72px; margin: 0 auto 14px; opacity: .55; }
.portrait figcaption { position: absolute; left: 16px; bottom: -14px; background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 999px; }

.about h2 { margin: 0 0 24px; font-size: clamp(2.4rem, 6vw, 5rem); line-height: .95; letter-spacing: -.03em; font-weight: 800; font-stretch: 82%; font-variation-settings: "opsz" 96; }
.about .lead { font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.4; letter-spacing: -.01em; margin: 0 0 32px; color: var(--ink); max-width: 38rem; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.facts li { padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line); }
.facts li:nth-child(odd) { border-right: 1px solid var(--line); }
.facts li:nth-child(even) { padding-left: 20px; }
.facts b { display: block; font-size: 1.15rem; letter-spacing: -.01em; margin-bottom: 4px; }
.facts span { color: var(--ink-2); font-size: .98rem; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts li:nth-child(odd) { border-right: 0; } .facts li:nth-child(even) { padding-left: 0; } }

/* ---------- Contact ---------- */
.contact .big { font-size: clamp(3rem, 11vw, 10rem); line-height: .9; letter-spacing: -.035em; font-weight: 800; font-stretch: 78%; font-variation-settings: "opsz" 96; margin: 0 0 32px; }
.contact .big .serif { font-stretch: normal; color: var(--signal); }
.mailbox { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 14px 14px clamp(18px, 3vw, 28px); border: 1.5px solid var(--ink); border-radius: 999px; max-width: max-content; background: var(--surface); }
.mailbox a { font-size: clamp(1.05rem, 3.2vw, 1.9rem); font-weight: 700; letter-spacing: -.02em; text-decoration: none; word-break: break-all; }
.mailbox a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.copy-btn { min-height: 44px; }
.copy-btn[data-state="done"] { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }
.contact .note { color: var(--muted); margin-top: 20px; }
@media (max-width: 480px) { .mailbox { border-radius: 22px; padding: 16px; width: 100%; } .mailbox .btn { width: 100%; justify-content: center; } }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 40px 48px; font-size: .95rem; color: var(--ink-2); }
.site-foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-foot .imprint { margin: 18px 0 0; color: var(--muted); }
.site-foot .made { margin: 6px 0 0; }

/* ---------- Legal pages ---------- */
.legal { padding-block: clamp(40px, 7vw, 96px) clamp(64px, 8vw, 120px); }
.legal .wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); }
@media (max-width: 900px) { .legal .wrap { grid-template-columns: 1fr; } .toc { display: none; } }
.legal h1 { margin: 0 0 12px; font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: .92; letter-spacing: -.028em; font-weight: 800; font-stretch: 80%; font-variation-settings: "opsz" 96; }
.legal .updated { color: var(--muted); margin: 0 0 36px; }
.legal .prose { max-width: 46rem; }
.legal .prose h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.025em; line-height: 1.15; margin: 56px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.legal .prose h3 { font-size: 1.15rem; margin: 28px 0 8px; letter-spacing: -.01em; }
.legal .prose p, .legal .prose li { color: var(--ink-2); }
.legal .prose strong { color: var(--ink); }
.legal .prose a { color: var(--signal); text-underline-offset: 3px; }
.legal .prose ul { padding-left: 1.2em; }
.legal .prose li { margin-bottom: 6px; }
.legal .callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--signal); border-radius: 14px; padding: 18px 22px; margin: 20px 0; }
.legal .callout p { margin: 0; }
.legal .callout p + p { margin-top: 8px; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 16px 0; }
.legal dt { font-family: var(--f-mono); font-size: .78rem; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.legal dd { margin: 0; color: var(--ink); }
@media (max-width: 520px) { .legal dl { grid-template-columns: 1fr; gap: 2px; } .legal dd { margin-bottom: 10px; } }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; }
.legal table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 560px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.legal th { font-family: var(--f-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg-2); }
.legal tr:last-child td { border-bottom: 0; }
.legal code { font-family: var(--f-mono); font-size: .8em; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; word-break: break-word; }
.toc { position: sticky; top: 96px; align-self: start; font-size: .9rem; }
.toc p { color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; text-decoration: none; color: var(--ink-2); margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--signal); }

/* 404 */
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 80px; }
.lost h1 { font-size: clamp(5rem, 22vw, 16rem); line-height: .85; margin: 0; letter-spacing: -.06em; font-weight: 800; font-stretch: 75%; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--rd, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes swipe { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(40px) scale(.85) rotate(0deg); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .ticker-track { animation: none; }
  .ticker { overflow-x: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .shelf .tile { transform: rotate(var(--r)); }
}

@media print {
  .site-head, .ticker, .cta, .copy-btn, .toc { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Logo mark */
.mk-bg { fill: var(--ink); }
.mk-n { stroke: var(--bg); }
.mk-px { fill: var(--volt); }
@media (prefers-color-scheme: light) { .site-foot .mk-px, .site-head .mk-px { fill: var(--volt); } }
.shelf .t2 { background: linear-gradient(160deg, #0F1630, #2A2350); }
.shelf .t3 { background: #171E26; }
.shelf .t4 { background: #2C4E39; }
[data-d] { --rd: .1s; }
.eyebrow { color: var(--muted); margin: 0 0 14px; }
.card.moonsy .s1 { left: 18%; top: 22%; }
.card.moonsy .s2 { left: 46%; top: 12%; animation-delay: 1.3s; }
.card.moonsy .s3 { left: 58%; top: 38%; animation-delay: 2.1s; width: 3px; height: 3px; }
.card.moonsy .s4 { left: 30%; top: 44%; animation-delay: .6s; width: 3px; height: 3px; }
@media (max-width: 600px) { .card.gluten .art.wheat { opacity: .35; width: 80px; height: 140px; right: 2%; bottom: 4%; } }
.lost .lead-404 { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--ink-2); margin: 16px 0 0; }
.lost .lead-404 span { display: block; color: var(--muted); }
[data-center] { justify-content: center; }
.legal .wrap > * { min-width: 0; }
@media (max-width: 900px) { .legal .wrap { grid-template-columns: minmax(0, 1fr); } }
.card.moonsy p { max-width: 27rem; }

/* ---------- Origin line on app cards ---------- */
.card .origin { font-family: "Caveat", cursive; font-weight: 600; font-size: clamp(1.3rem, 2vw, 1.55rem); line-height: 1.15; color: var(--c-accent); margin: -4px 0 18px; max-width: 30rem; transform: rotate(-1deg); transform-origin: left; }
.card .origin b { font-weight: 700; }
.card.gluten .origin { color: #2C4E39; }
@media (prefers-color-scheme: dark) { .card.gluten .origin { color: var(--c-accent); } }

/* ---------- About: route here ---------- */
.route { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 0; }
.route-title { margin: 36px 0 12px; color: var(--muted); }
.route li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.route li b { font-family: var(--f-mono); font-size: .85rem; color: var(--signal); padding-top: 2px; }
.route li span { color: var(--ink-2); }
.route li.now b { color: var(--ink); }
.route li.now span { color: var(--ink); font-weight: 600; }

/* ---------- Build with me: match planner ---------- */
.build .sec-head h2 .serif { font-stretch: normal; color: var(--signal); }
.planner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(14px, 1.6vw, 22px); align-items: start; }
@media (max-width: 960px) { .planner { grid-template-columns: 1fr; } }
.planner-steps { display: grid; gap: clamp(14px, 1.6vw, 22px); }
.pstep { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: clamp(20px, 2.6vw, 30px); display: grid; gap: 16px; min-width: 0; }
.pstep legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; font-stretch: 85%; letter-spacing: -.02em; line-height: 1.05; display: flex; align-items: baseline; gap: 12px; }
.pstep legend .n { font-family: var(--f-mono); font-size: .8rem; font-weight: 600; color: var(--signal-ink); background: var(--signal); border-radius: 999px; width: 28px; height: 28px; display: inline-grid; place-items: center; flex: none; transform: translateY(-3px); }
.goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; clear: both; }
@media (max-width: 480px) { .goals { grid-template-columns: 1fr; } }
.goal { text-align: left; font: inherit; color: var(--ink); cursor: pointer; background: var(--bg); border: 2px solid transparent; border-radius: 18px; padding: 14px 16px; display: grid; gap: 2px; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.goal:hover { transform: translateY(-2px); }
.goal b { font-size: 1.1rem; letter-spacing: -.01em; }
.goal span { font-size: .9rem; color: var(--muted); }
.goal[aria-pressed="true"] { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 8%, var(--surface)); }
.pchips { display: flex; flex-wrap: wrap; gap: 8px; clear: both; }
.pchip { font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 8px 14px; background: transparent; color: var(--ink); border: 1.5px solid var(--line); transition: background .2s, color .2s, border-color .2s; }
.pchip:hover { border-color: var(--ink); }
.pchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pchip[aria-pressed="true"]::before { content: "●"; color: var(--volt); margin-right: 6px; font-size: .8em; }
.tempo { display: grid; gap: 8px; clear: both; }
.tempo output { font-size: 1.15rem; font-weight: 700; }
.tempo input { width: 100%; accent-color: var(--signal); }
.tempo-labels { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }

.plan-card { position: sticky; top: 88px; border-radius: var(--radius); overflow: hidden; color: #F4F1E6; background: radial-gradient(120% 90% at 0% 0%, #24503A 0%, #1B3D2B 55%, #15301F 100%); box-shadow: 0 30px 60px -30px rgba(11, 13, 26, .55); }
@media (max-width: 960px) { .plan-card { position: static; } }
.plan-pitch { display: block; width: 100%; max-height: 340px; padding: 16px 16px 0; }
.plan-pitch .chalk { fill: none; stroke: #F4F1E6; stroke-opacity: .4; stroke-width: .5; }
.plan-pitch .pl { transition: transform .7s var(--ease), opacity .3s; }
.plan-pitch .pl circle { fill: #FFE873; stroke: #1B3D2B; stroke-width: .6; }
.plan-pitch .pl.cap circle { fill: #F4F1E6; }
.plan-pitch .pl text { font-family: var(--f-mono); font-size: 2.6px; font-weight: 600; fill: #F4F1E6; text-anchor: middle; }
.plan-body { padding: 18px clamp(20px, 2.6vw, 28px) 26px; display: grid; gap: 16px; }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.plan-top h3 { margin: 0; font-family: "Lilita One", var(--f-display); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: .01em; }
.plan-top .formation { font-family: "Lilita One", var(--f-display); font-size: 2rem; color: #FFE873; font-variant-numeric: tabular-nums; }
.phase-bar { display: flex; gap: 3px; height: 12px; border-radius: 99px; overflow: hidden; }
.phase-bar i { display: block; transition: flex-grow .5s var(--ease); }
.phase-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.phase-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.phase-list .sw { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.phase-list b { display: block; font-size: 1rem; }
.phase-list small { display: block; color: rgba(244, 241, 230, .72); font-size: .85rem; }
.phase-list em { font-style: normal; font-family: var(--f-mono); font-size: .82rem; color: #FFE873; white-space: nowrap; }
.plan-note { font-family: "Caveat", cursive; font-weight: 600; font-size: 1.45rem; line-height: 1.15; color: #FFE873; margin: 0; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.plan-actions .btn { min-height: 44px; padding: 10px 18px; font-size: .95rem; border-color: rgba(244, 241, 230, .35); }
.plan-actions .btn-fill { background: #FFE873; color: #1B3D2B; border-color: #FFE873; }
.plan-fine { margin: 0; font-size: .85rem; color: rgba(244, 241, 230, .7); }

/* Real app icons next to card titles (Gaffa XI has its own rule above) */
.card h3.with-icon { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.card h3 .app-icon { width: clamp(52px, 6vw, 72px); height: auto; border-radius: 22%; flex: none; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .55); }
.shelf .tile img { object-fit: cover; }

/* Renmel — flour-white with granite green and a honey grain, in Renmel's own colours */
.card.renmel {
  --c-bg: #FAF6EF; --c-ink: #2C4E39; --c-muted: #4E5E52; --c-accent: #2C4E39; --c-accent-ink: #FAF6EF; --c-line: rgba(44, 78, 57, .25);
  background: linear-gradient(160deg, #FAF6EF 0%, #F3EEE3 100%); border: 1px solid #E5DFD2;
}
.card.renmel .origin { color: #A9781F; }
.card.renmel .renmel-mark { margin: 0 0 18px; }
.card.renmel .renmel-mark img { width: clamp(180px, 22vw, 260px); height: auto; }
@media (prefers-color-scheme: dark) {
  .card.renmel { --c-bg: #24402E; --c-ink: #FAF6EF; --c-muted: #CFD8CF; --c-accent: #C08A2E; --c-accent-ink: #1A2E21; --c-line: rgba(250, 246, 239, .25); background: linear-gradient(160deg, #2C4E39 0%, #1F3828 100%); border-color: transparent; }
  .card.renmel .origin { color: #E3B562; }
}
.card.next { grid-column: 1 / -1; min-height: 0; }
.shelf .t5 { box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 24px 48px -16px rgba(11, 13, 26, .45), 0 4px 10px -4px rgba(11,13,26,.3); border: 0; background: #2C4E39; }
@media (max-width: 980px) { .card.renmel { grid-column: 1 / -1; } }

/* ==========================================================================
   Motion pass. Every "hidden" start state sits behind .js, which site.js only
   adds when motion is welcome, so no-JS and reduced-motion visitors see the
   finished page. Only transform, opacity, clip-path and stroke offsets animate.
   ========================================================================== */

/* Cards arrive a little differently, each in its own way */
.js .card.gaffa.reveal { transform: translateY(32px) rotate(-1.2deg); }
.js .card.moonsy.reveal { transform: translateY(24px) scale(.97); }
.js .card.tavle.reveal { transform: translateX(-28px); }
.js .card.reveal.in { transform: none; }

/* Moonsy: the moon rises, then breathes */
.js .card.moonsy .art.moon { opacity: 0; translate: 0 48px; transition: opacity 1.4s var(--ease) .2s, translate 1.6s var(--ease) .2s; }
.js .card.moonsy.in .art.moon { opacity: 1; translate: 0 0; animation: moon-breathe 6s ease-in-out 1.8s infinite alternate; }
@keyframes moon-breathe { to { scale: 1.04; } }

/* Hjemmetavlen: the week syncs in, block by block */
.js .card.tavle .board i { transform: scaleX(0); transition: transform .55s var(--ease); }
.js .card.tavle.in .board i { transform: none; }
.card.tavle .board i:nth-of-type(1)  { transition-delay: .25s; } .card.tavle .board i:nth-of-type(2)  { transition-delay: .29s; }
.card.tavle .board i:nth-of-type(3)  { transition-delay: .33s; } .card.tavle .board i:nth-of-type(4)  { transition-delay: .37s; }
.card.tavle .board i:nth-of-type(5)  { transition-delay: .41s; } .card.tavle .board i:nth-of-type(6)  { transition-delay: .47s; }
.card.tavle .board i:nth-of-type(7)  { transition-delay: .51s; } .card.tavle .board i:nth-of-type(8)  { transition-delay: .55s; }
.card.tavle .board i:nth-of-type(9)  { transition-delay: .59s; } .card.tavle .board i:nth-of-type(10) { transition-delay: .63s; }
.card.tavle .board i:nth-of-type(11) { transition-delay: .69s; } .card.tavle .board i:nth-of-type(12) { transition-delay: .73s; }
.card.tavle .board i:nth-of-type(13) { transition-delay: .77s; } .card.tavle .board i:nth-of-type(14) { transition-delay: .81s; }
.card.tavle .board i:nth-of-type(15) { transition-delay: .85s; }

/* Gaffa XI: chalk gets written onto the board */
.js .card.gaffa .scrawl, .js .card.gaffa .steps li, .js .card.gaffa .origin { clip-path: inset(0 100% 0 0); transition: clip-path .7s cubic-bezier(.6, 0, .3, 1); }
.js .card.gaffa.in .scrawl, .js .card.gaffa.in .steps li, .js .card.gaffa.in .origin { clip-path: inset(0 -2% 0 0); }
.card.gaffa .scrawl { transition-delay: .35s; }
.card.gaffa .steps li:nth-child(1) { transition-delay: .75s; } .card.gaffa .steps li:nth-child(2) { transition-delay: .95s; }
.card.gaffa .steps li:nth-child(3) { transition-delay: 1.15s; } .card.gaffa .steps li:nth-child(4) { transition-delay: 1.35s; }
.card.gaffa .origin { transition-delay: 1.6s; }

/* Handwritten "why" lines elsewhere get written in too */
.js .card:not(.gaffa) .origin { clip-path: inset(0 100% 0 0); transition: clip-path .9s cubic-bezier(.6, 0, .3, 1) .55s; }
.js .card:not(.gaffa).in .origin { clip-path: inset(-10% -2% -10% 0); }

/* GlutenTrace: the wheat sways from its root */
.card.gluten .art.wheat { transform-origin: 50% 100%; animation: sway 8s ease-in-out infinite alternate; }
@keyframes sway { from { rotate: -3deg; } to { rotate: 3deg; } }

/* Renmel: the honey grain drops into place */
.js .card.renmel .renmel-mark { clip-path: inset(0 100% 0 0); transition: clip-path 1s cubic-bezier(.6, 0, .3, 1) .2s; }
.js .card.renmel.in .renmel-mark { clip-path: inset(-10% -5% -10% 0); }

/* Match plan: chalk lines draw, players run on with a little overshoot, the bar fills left to right */
.js .plan-pitch .chalk > * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease); }
.js .planner.in .plan-pitch .chalk > * { stroke-dashoffset: 0; }
.planner .plan-pitch .chalk > :nth-child(2) { transition-delay: .3s; } .planner .plan-pitch .chalk > :nth-child(3) { transition-delay: .5s; }
.planner .plan-pitch .chalk > :nth-child(4) { transition-delay: .7s; } .planner .plan-pitch .chalk > :nth-child(5) { transition-delay: .8s; }
.plan-pitch .pl { transition: transform .75s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; }
.phase-bar i { transform-origin: left; animation: grow-x .6s var(--ease) both; }
@keyframes grow-x { from { transform: scaleX(0); } }
.formation.flip { animation: flip .5s var(--ease); }
@keyframes flip { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* About: the route gets run, year by year */
.route { position: relative; padding-left: 20px; }
.route::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--signal); transform-origin: top; }
.route li { position: relative; }
.route li::before { content: ""; position: absolute; left: -24px; top: 19px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--signal); }
.route li.now::before { background: var(--volt); border-color: var(--volt); animation: pulse 2.4s var(--ease) infinite; }
.js .reveal .route::before { transform: scaleY(0); transition: transform 1.8s var(--ease) .3s; }
.js .reveal.in .route::before { transform: none; }
.js .reveal .route li { opacity: .25; transition: opacity .5s var(--ease); }
.js .reveal.in .route li { opacity: 1; }
.route li:nth-child(1) { transition-delay: .4s; } .route li:nth-child(2) { transition-delay: .7s; } .route li:nth-child(3) { transition-delay: 1s; }
.route li:nth-child(4) { transition-delay: 1.3s; } .route li:nth-child(5) { transition-delay: 1.6s; } .route li:nth-child(6) { transition-delay: 1.9s; }

/* Hero: as you scroll away, the shelf drifts up and back (scroll-driven, where supported) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .shelf { animation: shelf-away linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
    @keyframes shelf-away { to { translate: 0 -60px; scale: .9; opacity: .35; } }
  }
}

/* Mobile header: solid enough that the ticker doesn't show through */
@media (max-width: 640px) { .site-head { background: color-mix(in srgb, var(--bg) 96%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); } }

@media (prefers-reduced-motion: reduce) {
  .card.gluten .art.wheat, .card.moonsy .art.moon, .route li.now::before { animation: none; }
}

/* ---------- Review fixes ---------- */
/* Header: "Build with me" stays reachable on mobile as a pill */
.nav a.nav-cta { background: var(--ink); color: var(--bg); font-weight: 600; }
.nav a.nav-cta:hover { background: var(--signal); color: var(--signal-ink); }
@media (max-width: 640px) { .nav > a.nav-cta { display: inline-flex; padding: 7px 12px; font-size: .85rem; } }

/* Planner: help text, idea field, disabled steps, chip cap */
.phelp { margin: 0; clear: both; font-size: .9rem; color: var(--muted); }
.pstep textarea { clear: both; width: 100%; min-height: 96px; resize: vertical; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.pstep textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 25%, transparent); }
.pstep legend label { cursor: pointer; }
.pstep[disabled] { opacity: .45; }
.pstep[disabled] .pchip, .pstep[disabled] input { cursor: not-allowed; }
.pchip[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.pchip[aria-disabled="true"]:hover { border-color: var(--line); }

/* Focus rings that stay visible on the coloured cards */
.card:not(.next) :focus-visible { outline-color: var(--c-accent); }
.plan-card :focus-visible { outline-color: #FFE873; }

/* Renmel handwritten line: enough contrast on the light card */
.card.renmel .origin { color: #8A5F12; }
@media (prefers-color-scheme: dark) { .card.renmel .origin { color: #E3B562; } }

/* About without a portrait yet: one column */
.about .grid.no-portrait { grid-template-columns: minmax(0, 1fr); max-width: 56rem; }
.portrait[hidden] { display: none; }

/* ---------- Portrait: duotone sticker card in the site's own colours ---------- */
.portrait.styled { border: 0; background: none; padding: 28px 22px 34px; aspect-ratio: auto; display: block; max-width: 440px; width: 100%; color: inherit; }
.portrait.styled::before, .portrait.styled::after { content: none; }
.portrait.styled .pf {
  position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; isolation: isolate;
  background: #FFFFFF; transform: rotate(-2.5deg); box-shadow: 0 30px 60px -28px rgba(11, 13, 26, .55);
  transition: transform .6s var(--ease);
}
.portrait.styled .pf img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; filter: grayscale(1) contrast(1.15) brightness(1.05); mix-blend-mode: multiply; transition: filter .6s var(--ease); }
.portrait.styled .pf::after { content: ""; position: absolute; inset: 0; background: #3A2BFF; mix-blend-mode: lighten; transition: opacity .6s var(--ease); pointer-events: none; }
.portrait.styled:hover .pf, .portrait.styled:focus-within .pf { transform: rotate(0deg) scale(1.01); }
.portrait.styled:hover .pf img { filter: none; mix-blend-mode: normal; }
.portrait.styled:hover .pf::after { opacity: 0; }

.portrait.styled .stk { position: absolute; inset: auto; object-fit: cover; width: 64px; height: 64px; border-radius: 23%; box-shadow: 0 10px 22px -8px rgba(11, 13, 26, .55); z-index: 2; animation: bob 7s ease-in-out infinite; }
.portrait.styled .stk-moon { top: 6px; right: 4px; rotate: 12deg; }
.portrait.styled .stk-gaffa { top: 42%; left: 0; rotate: -10deg; width: 56px; height: 56px; animation-delay: 1.2s; }
.portrait.styled .stk-tavle { bottom: 54px; right: 0; rotate: 6deg; width: 58px; height: 58px; animation-delay: 2.4s; }

.portrait.styled .ptag { position: absolute; z-index: 3; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .03em; background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px; white-space: nowrap; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .4); }
.portrait.styled .ptag::before { content: "●"; color: var(--signal); margin-right: 6px; }
.portrait.styled .pt1 { top: 20%; right: -6px; rotate: 3deg; }
.portrait.styled .pt2 { top: 62%; left: -6px; rotate: -3deg; }
.portrait.styled .pt3 { bottom: 18%; right: 10%; rotate: 2deg; background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }
.portrait.styled .pt3::before { color: var(--volt-ink); }

.portrait.styled .scribble { position: absolute; z-index: 3; top: -6px; left: 14px; font-family: "Caveat", cursive; font-weight: 700; font-size: 1.9rem; line-height: 1; color: var(--signal); rotate: -8deg; }
.portrait.styled .scribble::after { content: "↘"; display: inline-block; margin-left: 4px; font-size: .9em; translate: 0 8px; }
.portrait.styled figcaption { left: 40px; bottom: 16px; z-index: 3; }

/* Stickers and tags land one after another when the portrait scrolls in */
.js .portrait.styled.reveal .stk, .js .portrait.styled.reveal .ptag, .js .portrait.styled.reveal .scribble { opacity: 0; scale: .6; transition: opacity .5s var(--ease), scale .6s cubic-bezier(.34, 1.56, .64, 1); }
.js .portrait.styled.reveal.in .stk, .js .portrait.styled.reveal.in .ptag, .js .portrait.styled.reveal.in .scribble { opacity: 1; scale: 1; }
.portrait.styled .stk-moon { transition-delay: .35s; } .portrait.styled .pt1 { transition-delay: .5s; } .portrait.styled .stk-gaffa { transition-delay: .65s; }
.portrait.styled .pt2 { transition-delay: .8s; } .portrait.styled .stk-tavle { transition-delay: .95s; } .portrait.styled .pt3 { transition-delay: 1.1s; }
.portrait.styled .scribble { transition-delay: 1.3s; }

@media (max-width: 860px) { .portrait.styled { margin-inline: auto; } }
@media (max-width: 400px) { .portrait.styled .ptag { font-size: .66rem; padding: 5px 9px; } .portrait.styled .stk { width: 50px; height: 50px; } }
