/* Muziris: black ink on warm paper, colour pops in the illustration only.
   Shape rule: cards 2rem radius with a 2px ink border, buttons .8rem. */
@font-face { font-family: "Bodoni Moda"; src: url(fonts/bodoni-moda-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url(fonts/bodoni-moda-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url(fonts/bodoni-moda-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url(fonts/geist-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url(fonts/geist-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/geist-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #121211; --paper: #F1F0EC;
  --red: #E5482D; --yellow: #F2C811; --green: #3FB877; --violet: #6B3FE0; --blue: #2F6BEA;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 3.5rem);
  /* layers: 1 art, 2 content, 10 header, 20 grain */
  color-scheme: light;
}
/* derived tones, re-derived inside .night where ink and paper swap */
:root, .night, .hero {
  --muted: color-mix(in oklab, var(--ink) 70%, var(--paper));
  --line: color-mix(in oklab, var(--ink) 18%, var(--paper));
  --tint: color-mix(in oklab, var(--ink) 5%, var(--paper));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { /* paper grain, fixed so it never repaints on scroll */
  content: ""; position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .09;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 4.7vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.7vw, 3.3rem); }
h3 { font: 500 1.5rem/1.2 var(--display); }
em { font-style: italic; font-weight: 400; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: clamp(4.5rem, 10vw, 8.5rem); position: relative; }
.lede { color: var(--muted); max-width: 58ch; }
.eyebrow { font: 400 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.btn { display: inline-block; padding: .95rem 1.5rem; background: var(--ink); color: var(--paper); border-radius: .8rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.btn:hover { transform: translate(3px, -3px); box-shadow: -5px 5px 0 var(--red); }
.btn:active { transform: none; box-shadow: 0 0 0 var(--red); }
.link { font-weight: 500; text-underline-offset: .3em; text-decoration-thickness: 1px; }
.link:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 2rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font: 500 1.3rem/1 var(--display); letter-spacing: .16em; }
.brand svg { width: 34px; height: 34px; }
.site-nav { display: flex; align-items: center; gap: 2.2rem; font-size: .95rem; }
.site-nav a:not(.btn) { text-decoration: none; }
.site-nav a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: .4em; }
.site-nav .btn { padding: .65rem 1.1rem; }

/* hero: drafting-paper dot grid behind the scene */
.hero { min-height: calc(100dvh - 68px); padding-block: clamp(3rem, 9vh, 5rem) 0; overflow: hidden; background: radial-gradient(color-mix(in oklab, var(--ink) 26%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px; }
/* hero night mode: the sun is a button. --ink and --paper are registered colours (see @property below), so they can transition */
:root { transition: --paper 1.4s ease, --ink .35s ease .55s; }
:root.dark { color-scheme: dark; --ink: #F1F0EC; --paper: #0B0E1A; }
.dark .logos img { filter: brightness(0) invert(1); }
.dark .logos .rari img { filter: url(#white-to-ink) invert(1); }
/* the closing section is already night: no day-to-night scroll on a dark page */
.dark .night.scrub, .dark .scrub .day-sun + svg { animation: none; }
.dark .scrub .day-sun { display: none; }
.hero { overflow: clip; } /* hidden still lets a click on the sun scroll the hero sideways */
.sun-toggle { display: none; position: absolute; z-index: 3; left: 74.06%; top: 23.89%; width: 11.875%; height: 21.11%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.js .sun-toggle { display: block; }
.sun-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.orb { transition: transform 1.4s var(--ease), scale .3s var(--ease); will-change: transform; }
.sun-toggle:hover ~ .orb { scale: 1.05; }
.moon, .dark .sun { transform: translate3d(0, 100%, 0); } /* below the horizon, behind the hills and the sea */
.dark .moon { transform: none; }
.dark .moon, :root:not(.dark) .sun { transition-delay: .7s, 0s; } /* one goes down before the other comes up */
.nstars, .lights { opacity: 0; transition: opacity 1s ease; }
.dark .nstars { opacity: 1; transition-delay: .9s; }
.dark .lights { opacity: 1; transition-delay: 1.5s; }
.rays { opacity: 0; filter: drop-shadow(0 0 4px #6FC3FF); }
.dark .rays { animation: flicker 3.3s linear infinite backwards; animation-delay: calc(1.3s + var(--d)); }
@keyframes flicker { 0%, 100% { opacity: 0; } 6% { opacity: 1; } 10% { opacity: .35; } 16% { opacity: 1; } 55% { opacity: .8; } }
.hero-copy { position: relative; z-index: 2; max-width: 46rem; }
.hero-copy > * { animation: rise .9s var(--ease) both; animation-delay: calc(var(--i) * 110ms + 80ms); }
.hero h1 { margin-block: 1.4rem 1.5rem; }
.hero .lede { max-width: 34rem; font-size: 1.1rem; }
.hero-actions { display: flex; align-items: center; gap: 1.8rem; margin-top: 2.2rem; }
.hero-art { position: absolute; z-index: 1; right: 0; bottom: -7%; width: max(100%, 1180px); aspect-ratio: 16 / 9; animation: fade 1.6s ease both .2s; }
.hero-art svg, .night-art svg { position: absolute; display: block; overflow: hidden; }
.bob, .sway, .leap { will-change: transform; } /* own GPU layer each: moved, never redrawn */
.bob { transform-origin: 50% 92%; animation: bob 7s ease-in-out infinite alternate; }
.sway { animation: sway var(--t) ease-in-out infinite alternate; } /* each sea row drifts against its neighbours */
.leap { animation: leap 9s linear infinite both; } /* underwater and invisible between jumps */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes bob { from { transform: translateY(-2px) rotate(-1.2deg); } to { transform: translateY(5px) rotate(1.4deg); } }
@keyframes sway { from { transform: translate3d(calc(var(--dx) * -1.2%), 0, 0); } to { transform: translate3d(calc(var(--dx) * 1.2%), 3px, 0); } }
/* a thrown arc: fast out of the water, slow over the top, nose following the path. Generated numbers, see brand/build.mjs leapAt */
@keyframes leap {
  0% { transform: translate3d(-63.6%, 237.5%, 0) rotate(-69.8deg); opacity: 1; }
  1.75% { transform: translate3d(-47.7%, 133.6%, 0) rotate(-63.8deg); opacity: 1; }
  3.5% { transform: translate3d(-31.8%, 59.4%, 0) rotate(-53.6deg); opacity: 1; }
  5.25% { transform: translate3d(-15.9%, 14.8%, 0) rotate(-34.2deg); opacity: 1; }
  7% { transform: translate3d(0.0%, 0.0%, 0) rotate(0.0deg); opacity: 1; }
  8.75% { transform: translate3d(15.9%, 14.8%, 0) rotate(34.2deg); opacity: 1; }
  10.5% { transform: translate3d(31.8%, 59.4%, 0) rotate(53.6deg); opacity: 1; }
  12.25% { transform: translate3d(47.7%, 133.6%, 0) rotate(63.8deg); opacity: 1; }
  14% { transform: translate3d(63.6%, 237.5%, 0) rotate(69.8deg); opacity: 1; }
  14.5%, 100% { transform: translate3d(63.6%, 237.5%, 0) rotate(69.8deg); opacity: 0; }
}

/* origin: a bordered sheet, like a plate in a book */
.origin .wrap > div { border: 2px solid var(--ink); border-radius: 2rem; padding: clamp(1.75rem, 5vw, 4.5rem); background: color-mix(in oklab, var(--paper) 60%, white); }
.dark .origin .wrap > div { background: color-mix(in oklab, var(--paper) 92%, white); }
.origin h2 { max-width: 17ch; }
.origin-body { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 4rem; }
.origin-body p:first-child { font: 400 1.45rem/1.45 var(--display); }
.origin-body p:last-child { color: var(--muted); }

/* commitments */
.commit .wrap { display: grid; grid-template-columns: 5fr 7fr; gap: 3rem 5rem; align-items: start; }
.commit-head { position: sticky; top: 7rem; }
.commit-head .spot { margin-top: 2.5rem; }
.commit ul { list-style: none; margin: 0; padding: 0; }
.commit li { padding-block: 1.8rem; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 15rem 1fr; gap: 1rem 2rem; }
.commit li p { color: var(--muted); }
.commit .eyebrow { margin-bottom: 1rem; }
.commit ul + .eyebrow { margin-top: 3.5rem; }

/* services: five flip cards */
.services { background: var(--tint); }
.cards { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.cards li { grid-column: span 3; }
.flip { display: block; width: 100%; height: 19rem; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; perspective: 1400px; }
.flip-inner { display: block; position: relative; height: 100%; transform-style: preserve-3d; transition: transform .8s var(--ease); }
.flip[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 1.75rem; border: 2px solid var(--ink); border-radius: 2rem; background: var(--paper); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: box-shadow .4s var(--ease); }
.flip:hover .face { box-shadow: -8px 8px 0 var(--ink); }
.face.back { transform: rotateY(180deg); background: var(--bg); color: var(--fg, #121211); justify-content: center; font-size: 1.2rem; line-height: 1.45; }
.face .ico { align-self: flex-end; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border: 2px solid var(--ink); border-radius: 50%; transition: transform .7s var(--ease); }
.flip:hover .ico { transform: rotate(24deg); }
.face .ico svg { width: 1.4rem; height: 1.4rem; }
.face .t { display: block; font: 500 1.9rem/1.1 var(--display); }
.face .hint { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.1rem; font: 400 .72rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.face .hint svg { width: 1rem; height: 1rem; }

/* delegations: every protocol is a pill */
.delegations h3 { font: 400 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 2.75rem 0 1rem; }
.pills { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.pill { display: block; padding: .55rem 1.1rem; border: 2px solid var(--ink); border-radius: 2rem; font: 500 1.15rem/1.2 var(--display); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s; }
a.pill:hover { transform: translate(3px, -3px); box-shadow: -4px 4px 0 var(--ink); background: var(--yellow); }
.delegations .link { display: inline-block; margin-top: 1.5rem; }

/* logo marquee: four copies of the list, shifted by two, loops seamlessly */
.logos { overflow: hidden; margin-bottom: 1rem; padding-block: 1rem; border-block: 2px solid var(--ink); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.logos ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4.5rem; width: max-content; padding-right: 4.5rem; animation: marquee 40s linear infinite; will-change: transform; }
.logos:hover ul { animation-play-state: paused; }
.logos li { display: flex; align-items: center; gap: .6rem; font: 600 1.5rem/1 var(--sans); letter-spacing: -.02em; white-space: nowrap; }
.logos img { display: block; height: 2.25rem; width: auto; filter: brightness(0); }
/* these two files carry padding around the mark, so they are drawn larger and pulled back in */
.logos img[src*="1inch"] { height: 5rem; margin: -1.4rem -1.2rem; }
.logos .rari img { filter: url(#white-to-ink); height: 4rem; margin: -.9rem -.9rem -.9rem -1rem; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .logos ul { animation: none; flex-wrap: wrap; width: auto; gap: 2rem 3rem; } .logos li[aria-hidden] { display: none; } }

/* imprint */
.legal { padding-block: clamp(4rem, 10vw, 8rem); }
.legal h1 { margin: 1rem 0 1.2rem; }
.legal .lede { max-width: 40rem; margin-bottom: 1rem; }
.legal h2 { font: 400 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 2.5rem 0 .7rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); max-width: 40rem; }
.legal address { font-style: normal; }
.legal .updated { margin-top: 3rem; color: var(--muted); font-size: .9rem; }

/* proposals */
.proposals table { width: 100%; border-collapse: collapse; margin-top: 2.5rem; }
.proposals details table { margin-top: 0; }
.proposals th { text-align: left; font: 400 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding-bottom: .9rem; border-bottom: 2px solid var(--ink); }
.proposals td { padding: 1rem 1.5rem 1rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.proposals td:first-child { font: .85rem var(--mono); color: var(--muted); white-space: nowrap; width: 9rem; }
.proposals td:last-child { white-space: nowrap; width: 9rem; padding-right: 0; }
.proposals td a { font: 500 1.2rem/1.3 var(--display); text-decoration: none; }
.proposals td a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: .25em; }
.proposals summary { cursor: pointer; width: fit-content; margin-top: 1.75rem; font-weight: 500; text-decoration: underline; text-underline-offset: .3em; }
.proposals details[open] summary { display: none; }

/* testimonial */
.voice figure { margin: 0 auto; max-width: 60rem; border: 2px solid var(--ink); border-radius: 2rem; padding: clamp(1.75rem, 5vw, 4rem); background: var(--yellow); color: #121211; box-shadow: -8px 8px 0 var(--ink); }
.voice blockquote { margin: 0; font: 400 clamp(1.25rem, 2.1vw, 1.7rem)/1.45 var(--display); }
.voice figcaption { margin-top: 1.5rem; }

/* team */
.team ul { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.team li { border: 2px solid var(--ink); border-radius: 1.25rem; padding: 1.25rem; display: grid; gap: .3rem; }
.team strong { font: 500 1.3rem/1.2 var(--display); }
.team span { color: var(--muted); font-size: .9rem; }


/* spot illustrations beside section headings */
.spot { display: block; flex: none; width: clamp(5.5rem, 12vw, 10rem); aspect-ratio: 1; overflow: visible; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; }

/* night: the one dark passage. Ink and paper swap, so the same art turns to night */
.night { --ink: #F1F0EC; --paper: #0B0E1A; background: var(--paper); color: var(--ink); text-align: center; overflow: hidden; min-height: 52rem; padding-bottom: 24rem; }
.night .wrap { position: relative; z-index: 2; }
.night h2 { margin: 0 auto 1.2rem; max-width: 16ch; }
.night .lede { margin: 0 auto 2.2rem; }
.night-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.2rem 2rem; }
.day-sun { display: none; }
/* scrubbed version: the section is tall, its stage sticks, and --p drives day, dusk, night */
@property --ink { syntax: "<color>"; inherits: true; initial-value: #121211; }
@property --paper { syntax: "<color>"; inherits: true; initial-value: #F1F0EC; }
.night.scrub { height: 260vh; min-height: 0; padding: 0; overflow: clip; animation: dusk 1s linear both paused; animation-delay: calc(var(--p, 0) * -1s); }
.scrub .night-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; padding-top: clamp(5.5rem, 12vh, 9rem); background: var(--paper); }
.scrub .day-sun { display: block; left: 40.6%; top: 3.7%; width: 18.75%; height: 36.6%; overflow: visible; will-change: transform; animation: sunset 1s linear both paused; animation-delay: calc(var(--p, 0) * -1s); }
.scrub .day-sun + svg { animation: nightfall 1s linear both paused; animation-delay: calc(var(--p, 0) * -1s); } /* moon and stars */
/* ink flips to light in a short window while the sky is at its deepest orange, so lines never sit on a matching ground for long */
@keyframes dusk {
  0% { --paper: #F1F0EC; --ink: #121211; }
  30% { --paper: #F7D2AE; --ink: #121211; }
  58% { --paper: #E0714A; --ink: #121211; }
  61% { --paper: #C4564F; --ink: #121211; }
  62.5% { --paper: #B34F58; --ink: #F1F0EC; }
  68% { --paper: #7A3F6E; --ink: #F1F0EC; }
  82% { --paper: #2A2350; --ink: #F1F0EC; }
  100% { --paper: #0B0E1A; --ink: #F1F0EC; }
}
@keyframes sunset { 0% { transform: translate3d(0, 0, 0); opacity: 1; } 58% { opacity: 1; } 66%, 100% { transform: translate3d(0, 178%, 0); opacity: 0; } } /* fades once under, or ray tips show through the wave lines */
@keyframes nightfall { 0%, 62% { opacity: 0; } 92%, 100% { opacity: 1; } }
.night-art { position: absolute; z-index: 1; left: 50%; bottom: 0; width: max(100%, 1300px); aspect-ratio: 1600 / 820; transform: translateX(-50%); }

/* footer: a paper sheet sliding over the night */
.site-footer { position: relative; z-index: 2; margin-top: -2.5rem; padding-block: 4rem 3rem; background: var(--paper); border-radius: 2.5rem 2.5rem 0 0; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; }
.foot-grid h3 { font: 500 .95rem/1 var(--sans); margin-bottom: 1rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; color: var(--muted); }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); }
.foot-grid .tag { font: italic 400 1.25rem/1.4 var(--display); margin: 1rem 0 1.2rem; }
.foot-grid small { color: var(--muted); font-size: .85rem; }

/* scroll reveal: only when JS is running, so content is never hidden without it */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .site-nav a:not(.btn) { display: none; }
  .hero { min-height: 0; padding-bottom: 62vw; }
  .hero-art { width: 150%; right: -22%; }
  .origin-body, .commit .wrap, .commit li, .foot-grid { grid-template-columns: 1fr; }
  .commit-head { position: static; }
  .commit-head .spot { margin-top: 1.5rem; }
  .commit li { gap: .5rem; }
  .cards { grid-template-columns: 1fr; }
  .cards li { grid-column: auto; }
  .flip { height: 16rem; }
  .team ul { grid-template-columns: 1fr 1fr; }
  .proposals td:first-child, .proposals td:last-child { width: auto; }
  .proposals td:last-child, .proposals th:last-child { display: none; }
  .night { min-height: 44rem; padding-bottom: 16rem; }
}
@media (max-width: 520px) {
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .brand { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .dark .rays { opacity: .9; }
}
