/* tapyr.eu */

/* ---------- Fonts (SIL Open Font License 1.1, see assets/fonts) ---------- */
@font-face { font-family: "Bricolage"; src: url(/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/assets/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

/* ---------- Design tokens ---------- */
:root {
  --bg: #f2f8fb; --surface: #ffffff; --ink: #0f2a3f; --ink-2: #44606f; --line: #d3e4ec;
  --cyan: #3aa9d6; --cyan-2: #2389b4; --link: #0a6890; --sun: #ffc845; --sun-ink: #6b4a00;
  --code-bg: #0f2a3f; --code-ink: #e3f1f7; --red: #cc2f35; --red-soft: #fde4e4;
  --t-body: #48b3dc; --t-body-2: #2f93bd; --t-saddle: #fffdf8; --t-line: #0f2a3f; --t-eye: #0f2a3f; --t-dot: #ffc845; --t-brace: #0f2a3f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1824; --surface: #102335; --ink: #e4f1f7; --ink-2: #9db7c4; --line: #1f3a50;
    --cyan: #5cc3ea; --cyan-2: #3aa9d6; --link: #7fd3f2; --sun: #ffd166; --sun-ink: #ffd166;
    --code-bg: #071119; --code-ink: #d7ebf3; --red: #ff7a7a; --red-soft: #3b1d27;
    --t-line: #04101a; --t-eye: #04101a; --t-brace: #cfe9f5; --t-saddle: #f6f2e9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1824; --surface: #102335; --ink: #e4f1f7; --ink-2: #9db7c4; --line: #1f3a50;
  --cyan: #5cc3ea; --cyan-2: #3aa9d6; --link: #7fd3f2; --sun: #ffd166; --sun-ink: #ffd166;
  --code-bg: #071119; --code-ink: #d7ebf3; --red: #ff7a7a; --red-soft: #3b1d27;
  --t-line: #04101a; --t-eye: #04101a; --t-brace: #cfe9f5; --t-saddle: #f6f2e9;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 "Bricolage", system-ui, sans-serif; overflow-x: clip; }
a { color: var(--link); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
code, pre { font-family: "JetBrains Mono", ui-monospace, monospace; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.sprites { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 14px; font-weight: 650; text-decoration: none; font-size: 1.02rem; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 0 4px 0 var(--cyan-2); }
.btn-primary:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--cyan-2); }
.btn-ghost { color: var(--ink-2); border: 1.5px dashed var(--line); cursor: not-allowed; }
.btn-ghost small { font-size: .78rem; font-weight: 600; background: var(--line); color: var(--ink); padding: 2px 8px; border-radius: 999px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.5rem; letter-spacing: -.02em; }
.brand svg { width: 64px; height: auto; }
.y-accent { color: var(--cyan-2); }
:root[data-theme="dark"] .y-accent { color: var(--cyan); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .y-accent { color: var(--cyan); } }

/* ---------- Header ---------- */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; padding: 14px 0; }
.nav::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; z-index: -1; background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .2s ease; }
.nav.scrolled::before { opacity: 1; }
.nav-sections { margin-left: auto; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { position: relative; padding: 4px 0; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); }
.nav-links a[aria-current="true"]::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--sun); }

/* Language menu (details/summary, works without JavaScript) */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px 0 10px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 .82rem/1 "Bricolage", sans-serif; letter-spacing: .02em; cursor: pointer; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: var(--cyan-2); }
.lang-menu .flag { width: 20px; height: 20px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); }
.lang-menu .chev, .lang-menu .tick { width: 16px; height: 16px; }
.lang-menu .chev { transition: transform .15s ease; color: var(--ink-2); }
.lang-menu[open] .chev { transform: rotate(180deg); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px -12px rgba(15, 42, 63, .35); z-index: 60; }
.lang-menu li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.lang-menu li a:hover, .lang-menu li a:focus-visible { background: color-mix(in srgb, var(--cyan) 14%, transparent); }
.lang-menu li a[aria-current="true"] .tick { margin-left: auto; color: var(--cyan-2); }

/* Theme switch (Lucide icons) */
.theme { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.theme svg { width: 19px; height: 19px; }
.theme:hover { border-color: var(--cyan-2); }
.lang-menu + .theme { margin-left: -16px; }

/* ---------- Footer ---------- */
footer { padding: 48px 0 64px; color: var(--ink-2); font-size: .95rem; }
.foot { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; border-top: 1.5px solid var(--line); padding-top: 28px; }
.foot .brand { font-size: 1.15rem; }
.foot .brand svg { width: 46px; }
.foot nav { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .nav::before, .lang-menu .chev { transition: none; }
}

@media (max-width: 860px) {
  .nav-sections { display: none; }
  .nav .lang-menu { margin-left: auto; }
}

/* ---------- Sections ---------- */
section { padding: 72px 0; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.08; font-weight: 750; margin: 0 0 18px; text-wrap: balance; }
.intro { color: var(--ink-2); max-width: 40em; font-size: 1.1rem; margin: 0 0 36px; }
pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: 20px; padding: 22px 24px; overflow-x: auto; font-size: .82rem; line-height: 1.65; font-variant-ligatures: none; }
.k { color: #7fd3f2; } .v { color: #ffd166; } .c { color: #8aa6b5; } .ok { color: #7ee2a8; }
.p { color: #7fd3f2; } .n { color: #ffd166; } .s { color: #a5e3b9; }

/* ---------- Hero ---------- */
.hero3 { padding: 20px 0 24px; }
.hero3-top { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: end; }
.hero3-top > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--sun-ink); background: color-mix(in srgb, var(--sun) 28%, transparent); padding: 5px 12px 5px 10px; border-radius: 999px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 35%, transparent); }
h1 { font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 780; margin: 14px 0 0; max-width: 20em; text-wrap: balance; }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 38em; margin: 0; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; flex-shrink: 0; }

/* Flow card: Visual / Code */
.flowcard { margin-top: 32px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 28px; padding: 18px 24px 24px; overflow: hidden; }
.flowcard-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.flowcard-head h2 { font-size: 1.05rem; margin: 0; color: var(--ink-2); font-weight: 600; letter-spacing: 0; }
.mode { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.mode [data-on] { color: var(--ink); }
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; border: 2px solid var(--ink); background: var(--bg); cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform .18s ease; }
.switch[aria-checked="true"] { background: var(--cyan); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.flowcard[data-mode="visual"] .xform, .flowcard[data-mode="visual"] .note, .flowcard[data-mode="code"] .viz { display: none; }

.viz-desk { width: 100%; height: auto; display: block; }
.viz .node { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.viz .node.yours { fill: none; stroke: var(--ink-2); stroke-dasharray: 6 6; }
.viz .node.out { fill: color-mix(in srgb, var(--cyan) 22%, var(--surface)); stroke: color-mix(in srgb, var(--cyan) 60%, transparent); }
.viz .hub { fill: color-mix(in srgb, var(--cyan) 12%, var(--surface)); stroke: var(--ink); stroke-width: 2.5; }
.viz .nt { fill: var(--ink); font: 700 17px "Bricolage", sans-serif; }
.viz .nt.muted { fill: var(--ink-2); }
.viz .ns { fill: var(--ink-2); font: 500 12px "JetBrains Mono", monospace; }
.viz .ht { fill: var(--ink); font: 780 24px "Bricolage", sans-serif; letter-spacing: -.02em; }
.viz .hs { fill: var(--ink); font: 500 12.5px "JetBrains Mono", monospace; }
.viz .wire { fill: none; stroke: var(--ink-2); stroke-width: 2; opacity: .45; }
.viz .wire.out { stroke: var(--cyan-2); opacity: .8; }
.viz .tick { fill: var(--cyan-2); }
.viz .din { fill: var(--sun); }
.viz .dout { fill: var(--cyan); }
.viz .ico-bg { fill: color-mix(in srgb, var(--cyan) 18%, var(--surface)); }
.viz .ico-bg.out { fill: var(--surface); }
.viz .ico-bg.brand { fill: #ffffff; stroke: var(--line); stroke-width: 1; }
.viz .ico { color: var(--cyan-2); }
.viz-legal { margin: 6px 0 0; font-size: .78rem; color: var(--ink-2); text-align: right; }
.flowcard[data-mode="code"] .viz-legal { display: none; }
.viz-desk .wire, .viz-desk .vnode, .viz-desk .dots circle { transition: opacity .2s ease, stroke-width .2s ease; }
.viz-desk.hl .wire, .viz-desk.hl .vnode, .viz-desk.hl .dots circle { opacity: .18; }
.viz-desk.hl .wire.on { opacity: 1; stroke-width: 3; stroke: var(--cyan-2); }
.viz-desk.hl .vnode.on, .viz-desk.hl .dots circle.on { opacity: 1; }

.viz-mob { display: none; }
.viz-mob ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.viz-mob li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem; background: var(--bg); border: 1.5px solid var(--line); }
.viz-mob li.yours { border-style: dashed; color: var(--ink-2); font-weight: 500; }
.viz-mob li.out { background: color-mix(in srgb, var(--cyan) 22%, var(--surface)); }
.viz-mob .mi { width: 18px; height: 18px; color: var(--cyan-2); flex: none; }
.viz-mob img.mi { width: 24px; height: 24px; padding: 3px; background: #fff; border-radius: 7px; object-fit: contain; }
.viz-mob .down { display: block; width: 2px; height: 26px; margin: 8px auto; background: var(--ink-2); opacity: .5; }
.viz-mob .hubm { border: 2.5px solid var(--ink); background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); border-radius: 24px; padding: 0 18px 16px; text-align: center; margin-top: 64px; }
.viz-mob .hubm svg { width: 160px; margin: -78px auto 0; display: block; }
.viz-mob .hubm strong { font-size: 1.4rem; display: block; }
.viz-mob .hubm span { display: block; font: 500 .8rem "JetBrains Mono", monospace; color: var(--ink-2); margin-top: 4px; }

.xform { margin-top: 8px; display: grid; grid-template-columns: 1fr 340px 1fr; gap: 0; align-items: stretch; position: relative; }
.pane { background: var(--bg); border: 1.5px solid var(--line); border-radius: 24px; padding: 18px 18px 20px; display: flex; flex-direction: column; min-width: 0; }
.xform > .pane { margin-top: 106px; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 32px; }
.pane h3 { font-size: 1.02rem; margin: 0; letter-spacing: -.01em; line-height: 1.3; }
.pane .src { font-size: .8rem; color: var(--ink-2); }
.pane pre { flex: 1; margin-top: 0; font-size: .74rem; line-height: 1.65; border-radius: 14px; padding: 14px 16px; white-space: pre; }
.mid { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0 14px; position: relative; }
.mid::before, .mid::after { content: ""; position: absolute; top: 72%; width: 14px; height: 2px; background: var(--ink); }
.mid::before { left: 0; } .mid::after { right: 0; }
.mid .pane { width: 100%; flex: 1; border-color: var(--ink); background: color-mix(in srgb, var(--cyan) 14%, var(--bg)); }
.mid .perch { width: auto; height: 108px; margin: 0 0 -2px; position: relative; z-index: 1; }
.tabs { display: inline-flex; background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; }
.tabs button { font: 600 .78rem "Bricolage", sans-serif; color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.note { font-size: .78rem; color: var(--ink-2); margin: 12px 0 0; text-align: right; }

/* Mascot: dots pulse on hover */
@keyframes sniff-pulse { 0%, 60%, 100% { opacity: 1; } 30% { opacity: .25; } }
.sniffable:hover .sniff circle { animation: sniff-pulse 1.1s ease-in-out infinite; }
.sniffable:hover .sniff circle:nth-child(2) { animation-delay: .15s; }
.sniffable:hover .sniff circle:nth-child(3) { animation-delay: .3s; }

/* Visual <-> Code transition */
.flowcard.morphing { transition: height .42s cubic-bezier(.3,.7,.2,1); }
.flowcard.leaving .viz, .flowcard.leaving .xform, .flowcard.leaving .note { opacity: 0; transform: translateY(-6px) scale(.985); filter: blur(3px); transition: opacity .18s ease, transform .18s ease, filter .18s ease; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes drop-in { 0% { opacity: 0; transform: translateY(-34px); } 55% { opacity: 1; transform: translateY(4px); } 75% { transform: translateY(-3px); } 100% { transform: none; } }
@keyframes node-in { from { opacity: 0; transform: translateX(var(--dx, -10px)); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.9); } 60% { opacity: 1; transform: scale(1.03); } 100% { transform: none; } }
.flowcard.entering .xform > :nth-child(1) { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) both; }
.flowcard.entering .xform > :nth-child(2) .pane { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) .08s both; }
.flowcard.entering .xform > :nth-child(3) { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) .16s both; }
.flowcard.entering .perch { animation: drop-in .6s cubic-bezier(.3,.7,.3,1) .12s both; }
.flowcard.entering .note { animation: rise-in .4s ease .25s both; }
.flowcard.entering .viz-desk .vnode { transform-box: fill-box; animation: node-in .4s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.flowcard.entering .viz-desk .vnode[data-id^="o"] { --dx: 10px; }
.flowcard.entering .viz-desk .vhub, .flowcard.entering .viz-desk .tapir-pop { transform-box: fill-box; transform-origin: center bottom; animation: pop-in .5s cubic-bezier(.3,.7,.3,1) .1s both; }
.flowcard.entering .viz-desk .wires, .flowcard.entering .viz-desk .dots { animation: rise-in .5s ease .2s both; }
.flowcard.entering .viz-mob, .flowcard.entering .viz-legal { animation: rise-in .45s ease both; }

/* Without JavaScript: show both views, hide the switch */
.no-js .flowcard .xform { display: grid; margin-top: 24px; }
.no-js .flowcard .note { display: block; }
.no-js .flowcard .mode { display: none; }
.no-js .tabs { display: none; }
.no-js .viz-desk .dots { display: none; }
.no-js [data-panel][hidden] { display: block; }

/* ---------- Quotas ---------- */
.quota { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; }
.quota p { color: var(--ink-2); font-size: 1.08rem; margin: 0 0 14px; }
.quota p strong { color: var(--ink); }
.kinds { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kinds li { font: 600 .78rem "JetBrains Mono", monospace; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.chart { background: var(--surface); border: 1.5px solid var(--line); border-radius: 28px; padding: 24px; margin: 0; }
.chart figcaption { font-size: .9rem; color: var(--ink-2); margin-top: 8px; }
.flatline { width: 100%; height: auto; }
.flatline .grid { stroke: var(--line); }
.flatline .series { stroke: var(--cyan-2); fill: none; stroke-width: 3; stroke-linejoin: round; }
.flatline .gap { fill: color-mix(in srgb, #e5484d 12%, transparent); }
.flatline text { fill: var(--ink-2); font: 500 12px "JetBrains Mono", monospace; }
.flatline .alert { fill: var(--red); font-weight: 700; }
.motion .chart .series { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.6s cubic-bezier(.45,0,.2,1) .35s; }
.motion .chart.in .series { stroke-dashoffset: 0; }
.motion .chart .after { opacity: 0; transition: opacity .5s ease 1.95s; }
.motion .chart.in .after { opacity: 1; }

/* ---------- How it works ---------- */
.diagram { background: var(--surface); border-radius: 28px; padding: 28px; }
.how-desk { width: 100%; height: auto; display: block; }
.how-desk .box { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.how-desk .box.key { fill: var(--ink); stroke: var(--ink); }
.how-desk .box.side { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 6 6; }
.how-desk .t { fill: var(--ink); font: 700 17px "Bricolage", sans-serif; }
.how-desk .s { fill: var(--ink-2); font: 500 12px "JetBrains Mono", monospace; }
.how-desk .t.on-key, .how-desk .s.on-key { fill: var(--bg); }
.how-desk .arrow { stroke: var(--ink); stroke-width: 2; fill: none; marker-end: url(#a-head); }
.how-desk .arrow.soft { stroke: var(--ink-2); stroke-dasharray: 4 5; }
.how-desk marker path { fill: var(--ink); }
.how-mob, .how-side { display: none; }

/* ---------- Examples ---------- */
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ex { min-width: 0; }
.ex h3 { font-size: 1.25rem; margin: 0 0 6px; letter-spacing: -.01em; }
.ex p { margin: 0 0 14px; color: var(--ink-2); }
pre.typing .ln { display: block; }
.motion pre.typing.pending .ln { visibility: hidden; }
.motion pre.typing .ln.shown { visibility: visible; }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; background: currentColor; margin-left: 2px; animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.codewrap { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.codewrap pre { flex: 1; }
.copy { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: var(--code-ink); background: color-mix(in srgb, var(--code-ink) 10%, transparent); border: 1px solid color-mix(in srgb, var(--code-ink) 20%, transparent); border-radius: 8px; cursor: pointer; opacity: .7; transition: opacity .15s, color .15s; }
.copy svg { width: 16px; height: 16px; }
.copy:hover, .copy:focus-visible { opacity: 1; }
.copy.done { color: #7ee2a8; opacity: 1; }

/* ---------- Features (bento) ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-areas: "a a b c" "d e f f"; gap: 16px; }
.cell { background: var(--surface); border: 1.5px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cell h3 { margin: 6px 0 0; font-size: 1.15rem; letter-spacing: -.01em; }
.cell p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.cell .ic, .pillars .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan-2); }
.cell .ic svg, .pillars .ic svg { width: 24px; height: 24px; }
.c-a { grid-area: a; background: color-mix(in srgb, var(--cyan) 9%, var(--surface)); border-color: color-mix(in srgb, var(--cyan) 35%, var(--line)); }
.c-b { grid-area: b; } .c-c { grid-area: c; } .c-d { grid-area: d; } .c-e { grid-area: e; } .c-f { grid-area: f; }
.mini { margin-top: auto; padding-top: 10px; }
.flowmini { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flowmini span, .flowmini b { font: 600 .78rem "Bricolage", sans-serif; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); }
.flowmini b { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.flowmini i { width: 22px; height: 2px; background: var(--ink-2); position: relative; margin: 0 4px; }
.flowmini i::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 6px solid var(--ink-2); border-right: 0; }
.codemini { display: block; font: 500 .74rem "JetBrains Mono", monospace; font-variant-ligatures: none; background: var(--code-bg); color: var(--code-ink); padding: 9px 12px; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: auto; }
.codemini em { font-style: normal; color: #7ee2a8; margin-left: 8px; }
.kinds-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.kinds-mini span { font: 600 .74rem "JetBrains Mono", monospace; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1.5px solid var(--line); }
.spark { width: 100%; height: 56px; display: block; }
.spark .sp-line { fill: none; stroke: var(--cyan-2); stroke-width: 2.5; stroke-linejoin: round; }
.spark .sp-fill { fill: color-mix(in srgb, var(--cyan) 16%, transparent); }
.sparkwrap span { display: block; margin-top: 6px; font: 500 .74rem "JetBrains Mono", monospace; color: var(--ink-2); }

/* ---------- Europe ---------- */
.eu { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 32px; padding: 48px; margin-top: 60px; }
.eu-tapir { position: absolute; top: -84px; right: 48px; width: 170px; height: auto; }
.eu-flag { width: 84px; height: auto; border-radius: 10px; display: block; margin-bottom: 18px; box-shadow: 0 0 0 1.5px var(--line); }
.eu-head h2 { margin: 0 0 12px; }
.eu-head p { margin: 0; color: var(--ink-2); }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pillars li { display: grid; grid-template-columns: 42px 1fr; gap: 16px; align-items: start; background: var(--bg); border-radius: 18px; padding: 16px 18px; }
.pillars h3 { margin: 0 0 2px; font-size: 1.05rem; }
.pillars p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- Paw-print trails ---------- */
.trail { max-width: 600px; margin: 0 auto; padding: 8px 0; color: color-mix(in srgb, var(--cyan) 55%, transparent); }
.trail svg { display: block; width: 100%; height: auto; fill: currentColor; }
.motion .trail .pp { opacity: 0; transition: opacity .3s ease; }
.motion .trail.in .pp { opacity: 1; }
.trail .pp:nth-child(2) { transition-delay: 85ms; } .trail .pp:nth-child(3) { transition-delay: 170ms; } .trail .pp:nth-child(4) { transition-delay: 255ms; }
.trail .pp:nth-child(5) { transition-delay: 340ms; } .trail .pp:nth-child(6) { transition-delay: 425ms; } .trail .pp:nth-child(7) { transition-delay: 510ms; }
.trail .pp:nth-child(8) { transition-delay: 595ms; } .trail .pp:nth-child(9) { transition-delay: 680ms; } .trail .pp:nth-child(10) { transition-delay: 765ms; }
.trail .pp:nth-child(11) { transition-delay: 850ms; }

/* ---------- Reveal on scroll (only when JavaScript runs and motion is allowed) ---------- */
.motion [data-reveal] { opacity: 0; transition: opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.motion [data-reveal="up"] { transform: translateY(28px); }
.motion [data-reveal="left"] { transform: translateX(-48px); }
.motion [data-reveal="right"] { transform: translateX(48px); }
.motion [data-reveal="trail"] { opacity: 1; transform: none; }
.motion [data-reveal].in { opacity: 1; transform: none; }
.d1 { --d: .08s; } .d2 { --d: .16s; }

@media (prefers-reduced-motion: reduce) {
  .viz-desk .dots { display: none; }
  .switch::after, .copy { transition: none; }
  .sniffable:hover .sniff circle, .caret { animation: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  section { padding: 52px 0; }
  .motion [data-reveal="left"], .motion [data-reveal="right"] { transform: translateY(28px); }
  .hero3-top, .quota, .examples, .eu { grid-template-columns: 1fr; }
  .hero3-top { gap: 16px; }
  .hero3-top > div:last-child { flex-direction: column; align-items: flex-start; gap: 20px; }
  .flowcard { padding: 16px; border-radius: 22px; }
  .flowcard-head h2 { display: none; }
  .viz-desk { display: none; }
  .viz-mob { display: block; }
  .xform { grid-template-columns: 1fr; }
  .xform > .pane { margin-top: 0; }
  .xform > .pane:last-child { margin-top: 14px; }
  .mid { padding: 0; }
  .mid::before, .mid::after { display: none; }
  .mid .perch { height: 96px; margin-top: 14px; }
  .diagram { padding: 20px; }
  .how-desk { display: none; }
  .how-mob { display: block; list-style: none; margin: 0; padding: 0; counter-reset: st; }
  .how-mob li { position: relative; padding: 0 0 18px 44px; counter-increment: st; }
  .how-mob li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem "JetBrains Mono", monospace; background: var(--bg); border: 2px solid var(--ink); }
  .how-mob li.key::before { background: var(--ink); color: var(--bg); }
  .how-mob li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
  .how-mob strong, .how-side strong { display: block; }
  .how-mob span, .how-side span { display: block; font: 500 .8rem "JetBrains Mono", monospace; color: var(--ink-2); }
  .how-side { display: grid; gap: 10px; list-style: none; margin: 6px 0 0; padding: 0; }
  .how-side li { border: 1.5px dashed var(--ink-2); border-radius: 16px; padding: 12px 14px; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "a" "b" "c" "d" "e" "f"; }
  .eu { padding: 28px 22px; margin-top: 70px; gap: 24px; }
  .eu-tapir { width: 124px; top: -62px; right: 16px; }
}

/* ---------- 404 ---------- */
.lost { padding: 64px 0 96px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.lost-tapir { width: 220px; height: auto; margin-bottom: 8px; }
.lost h1 { margin: 0; }
.lost .intro { margin: 8px auto 24px; }

/* ---------- Legal notice ---------- */
.legal { max-width: 46em; padding: 40px 0 72px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 12px; }
.legal h2 { font-size: 1.35rem; margin: 40px 0 10px; }
.legal p, .legal li { color: var(--ink-2); }

/* ---------- Forced colors ---------- */
@media (forced-colors: active) {
  .switch::after { forced-color-adjust: none; background: CanvasText; }
}
