/* The countdown site. Tokens from the Beyond Valley Color System Addendum v2:
   all surfaces derive from Navy, no red in brand contexts.
   Fonts are self-hosted (the Datenschutzerklärung promises no Google Fonts). */

@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url(/fonts/montserrat-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(/fonts/montserrat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(/fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url(/fonts/lato-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/lato-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url(/fonts/lato-latin-700-normal.woff2) format("woff2"); }

:root {
  --base: #0A1B28;
  --deep: #040C13;
  --surface: #1B2A3B;
  --surface3: #243A50;
  --text: #F0F2F5;
  --text2: #A0AEBB;
  --muted: #6B7D8E;
  --amber: #C8891A;
  --amber-light: #D4A030;
  --amber-glow: rgba(200,137,26,0.40);
  --teal-light: #00957E;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: "Montserrat", system-ui, sans-serif;
  /* where the fractal's core sits: the field, the fractal and the clock agree on it */
  --core-y: 38svh;
  --mark: clamp(210px, 42svh, 500px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--base); }
/* without Lenis (no JS, reduced motion) anchors still glide natively */
html:not(.lenis) { scroll-behavior: smooth; }
/* Lenis's stylesheet (node_modules/lenis/dist/lenis.css, v1.3.26), inlined */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-lenis-prevent-wheel], .lenis [data-lenis-prevent-touch],
.lenis [data-lenis-prevent-vertical], .lenis [data-lenis-prevent-horizontal] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }
body {
  background: var(--base); color: var(--text2);
  font-family: "Lato", system-ui, sans-serif; line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2 { font-family: var(--display); color: var(--text); }

/* ---------------------------------------------------------------- nav */
.cd-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  background: linear-gradient(to bottom, rgba(4,12,19,0.75), rgba(4,12,19,0));
}
.wordmark {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.35em; color: var(--text);
}
.wordmark .logo { height: 22px; width: auto; }
.cd-navlinks { display: flex; gap: 26px; align-items: center; }
.cd-navlinks a {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text2);
  transition: color .2s ease;
}
.cd-navlinks a:hover { color: var(--text); }
/* language menu: every language, the current one lit */
.cd-langs { display: flex; gap: 2px; padding: 2px; border: 1px solid rgba(160,174,187,0.18); border-radius: 3px; }
.cd-navlinks .cd-lang {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  padding: 3px 7px; border-radius: 2px; color: var(--muted);
}
.cd-navlinks .cd-lang.is-current { color: var(--text); background: rgba(160,174,187,0.12); }
.cd-navlinks a.cd-lang:hover { color: var(--text); }

/* ---------------------------------------------------------------- field + fractal */
.cd-body { background: linear-gradient(to bottom, var(--deep), var(--base) 60%, var(--deep)); }
#cd-sky {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0;
  opacity: 0; transition: opacity 1.6s ease;
}
#cd-sky.is-live { opacity: 1; }
#cd-fractal {
  position: fixed; z-index: 1; pointer-events: none;
  width: var(--mark); height: var(--mark);
  left: calc(50% - var(--mark) / 2); top: calc(var(--core-y) - var(--mark) / 2);
}
.cd-fractal-svg { width: 100%; height: 100%; overflow: visible; }
.cd-level polyline {
  fill: none; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round;
}
.cd-level { will-change: transform, opacity; }
/* a stroke leaves quickly and glides into place (expo out); the order and
   spacing of the strokes is eased too (logo.cljs, start-ms) */
.cd-draw { animation: cd-draw 0.65s cubic-bezier(.16,1,.3,1) both; }
@keyframes cd-draw { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------- stage */
/* no stacking context on main: the docked clock (z 11) must rise above the
   nav (z 10), so the stage's parts and the contact section layer themselves */
main { position: relative; }
.cd-tagline, .cd-stage noscript, .cd-contact { position: relative; z-index: 2; }
.cd-stage {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 16px clamp(36px, 8svh, 96px);
  text-align: center;
}
/* the first movement of the page and the tagline goes (gone ~8% down): it
   sits a layer below the clock, so the rising glass passes over it as it
   fades. Opacity only; a blur filter on glass smears into a ghost. */
.cd-stage > :not(#countdown) { opacity: calc(1 - var(--scroll, 0) * 12); }
/* glass under the stage's words: the maze passes behind them, blurred and
   dimmed, never through them */
.cd-tagline, .cd-center::before {
  background: linear-gradient(180deg, rgba(14,32,47,0.30), rgba(8,20,31,0.18));
  -webkit-backdrop-filter: blur(12px) saturate(1.15); backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid rgba(160,174,187,0.08);
  box-shadow: 0 18px 50px rgba(2,8,13,0.22), inset 0 1px 0 rgba(255,255,255,0.035);
}
.cd-tagline {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text2); margin-bottom: clamp(30px, 4.2svh, 40px);
  /* letter-spacing trails the last letter: take it back on the right */
  padding: 7px calc(16px - 0.3em) 7px 16px; border-radius: 999px;
}
.cd-center { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; }
/* the clock's panel; as the clock docks it hands over to the pill (.cd-clock) */
.cd-center::before {
  content: ""; position: absolute; z-index: -1;
  inset: -18px -52px -22px; border-radius: 28px;
  opacity: calc(1 - var(--dock, 0) * 1.6);
}
/* the clock stays in view: app.cljs moves and scales #countdown into the nav
   as --dock goes 0 -> 1; what doesn't fit a docked clock tucks away */
#countdown { position: relative; z-index: 11; transform-origin: 50% 0; will-change: transform; }
.cd-clock {
  padding: 22px 56px; margin: -22px -56px; border-radius: 60px;
  background: rgba(4,12,19, calc(var(--dock, 0) * 0.62));
  box-shadow: 0 0 0 3px rgba(160,174,187, calc(var(--dock, 0) * 0.14));
}
.cd-when, .cd-local { opacity: calc(1 - var(--dock, 0) * 2.2); }
.cd-clock { display: flex; align-items: flex-start; gap: clamp(10px, 3vw, 44px); }
.cd-unit { position: relative; display: flex; flex-direction: column; align-items: center; }
/* hairline between units, the mark's vertical stroke */
.cd-unit + .cd-unit::before {
  content: ""; position: absolute; left: calc(-0.5 * clamp(10px, 3vw, 44px)); top: 18%; height: 52%;
  width: 1px; background: linear-gradient(to bottom, transparent, rgba(160,174,187,0.35), transparent);
}
.cd-num {
  display: flex; font-family: var(--display); font-weight: 600;
  font-size: clamp(2.6rem, 14vw, 6.5rem); line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  /* the glass does the separating now; a dark shadow here would be clipped
     into boxes by each digit's roll window */
  text-shadow: 0 0 24px rgba(200,137,26,0.14);
}
.cd-digit { position: relative; display: inline-block; width: 0.66em; height: 1.12em; overflow: hidden; }
.cd-glyph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  animation: cd-enter .5s cubic-bezier(.2,.8,.2,1) .12s both;
  transition: transform .4s cubic-bezier(.6,0,.8,.4), opacity .35s ease, filter .4s ease;
}
/* counting down: the new digit drops in from above, the old one falls away */
@keyframes cd-enter { from { transform: translateY(-62%); opacity: 0; filter: blur(6px); } }
.cd-glyph.is-leaving { transform: translateY(62%); opacity: 0; filter: blur(6px); }
.cd-label {
  margin-top: calc((1 - var(--dock, 0)) * clamp(4px, 1svh, 10px));
  max-height: calc((1 - var(--dock, 0)) * 3em); overflow: hidden;
  opacity: calc(1 - var(--dock, 0) * 2.5);
  font-family: var(--mono); font-size: clamp(9px, 1.1vw, 11px); letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--muted);
}
.cd-when {
  margin-top: clamp(16px, 3.5svh, 36px);
  font-family: var(--display); font-weight: 500; font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--amber);
}
.cd-local { margin-top: 6px; font-size: 13px; font-style: italic; color: var(--muted); }
.cd-arrived {
  font-family: var(--display); font-weight: 700; color: var(--amber-light);
  font-size: clamp(2.4rem, 8vw, 5.5rem); line-height: 1.1;
  animation: cd-rise 1.4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cd-rise { from { opacity: 0; transform: translateY(12px); filter: blur(8px); } }
.is-arrived .cd-when { color: var(--text); }
.is-arrived .cd-local { color: var(--text2); }

/* ---------------------------------------------------------------- contact */
.cd-contact {
  min-height: 64svh; padding: 14svh 24px 8svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(to bottom, rgba(4,12,19,0), rgba(4,12,19,0.82) 30%, rgba(4,12,19,0.92));
}
.cd-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.cd-contact h2 { font-size: clamp(1.8rem, 4.2vw, 3rem); font-weight: 700; line-height: 1.2; margin-bottom: 36px; }
.btn {
  display: inline-block;
  font-family: var(--display); font-weight: 600; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--amber); color: var(--surface);
  padding: 15px 26px; border-radius: 2px;
  transition: background .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--amber-light); box-shadow: 0 0 0 2px var(--amber-glow); }
.cd-write { margin-top: 26px; font-size: 15px; }
.cd-write a { color: var(--text); border-bottom: 1px solid rgba(200,137,26,0.5); transition: border-color .2s ease; }
.cd-write a:hover { border-color: var(--amber-light); }
.cd-write a { position: relative; }
/* clicking the address also copies it (app.cljs): a quiet note says so */
.cd-write a.is-copied::after {
  content: attr(data-copied-label);
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: 2px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); background: rgba(27,42,59,0.95); border: 1px solid rgba(160,174,187,0.2);
  animation: cd-copied 2s ease both;
}
@keyframes cd-copied { 0% { opacity: 0; transform: translate(-50%, 4px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.cd-places { margin-top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- footer */
.cd-footer {
  position: relative; z-index: 2;
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  padding: 26px 16px 32px; font-size: 12px; color: var(--muted);
  background: rgba(4,12,19,0.92);
}
.cd-footer a:hover { color: var(--text2); }

/* ---------------------------------------------------------------- legal */
/* the field runs calm behind the text (app.cljs, shader u_calm); without
   WebGL this gradient is what shows */
.cd-legal {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(0,123,110,0.10), transparent 70%),
    var(--base);
}
/* the text sits on glass: the field moves behind it, softened, never under the words */
.legal {
  position: relative; z-index: 2;
  max-width: 740px; margin: clamp(104px, 15vh, 140px) auto 72px;
  padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 60px) clamp(28px, 4vw, 44px);
  background: rgba(10,27,40,0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(160,174,187,0.12); border-radius: 6px;
  box-shadow: 0 30px 80px rgba(2,8,13,0.45);
}
@media (max-width: 560px) { .legal { margin: 88px 12px 48px; } }
.legal-head { padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid rgba(160,174,187,0.14); }
#legal-mark { width: 46px; height: 46px; margin-bottom: 22px; }
.legal-mark-svg { width: 100%; height: 100%; overflow: visible; }
.legal-mark-svg polyline {
  fill: none; stroke: var(--text); stroke-opacity: 0.85; stroke-width: 12;
  stroke-linecap: round; stroke-linejoin: round;
}
.legal-mark-svg .legal-core polyline { stroke: var(--amber-light); stroke-opacity: 1; }
.legal-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 14px;
}
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; line-height: 1.15; }
.legal-meta { margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.legal-section { padding: 26px 0 8px; border-bottom: 1px solid rgba(160,174,187,0.08); }
.legal-section:last-of-type { border-bottom: none; }
.legal h2 {
  font-family: var(--display); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text); margin-bottom: 12px;
}
.legal p { margin-bottom: 14px; font-size: 15.5px; line-height: 1.7; }
.legal a { color: var(--text); border-bottom: 1px solid rgba(200,137,26,0.5); transition: border-color .2s ease; }
.legal a:hover { border-color: var(--amber-light); }
.legal-back { margin-top: 36px; font-size: 14px; }
.legal-back a { border-bottom: none; color: var(--text2); }
.legal-back a:hover { color: var(--text); }

@media (max-width: 560px) {
  :root { --core-y: 34svh; --mark: min(72vw, 38svh); }
  .cd-nav { padding: 18px 16px; }
  .wordmark { font-size: 11px; letter-spacing: 0.28em; gap: 10px; }
  .cd-navlinks { gap: 12px; }
  .cd-navlinks .cd-lang { padding: 3px 5px; font-size: 10px; letter-spacing: 0.08em; }
  /* the pill's reach, scaled to a phone: it must not push past the screen edge */
  .cd-clock { padding: 18px 26px; margin: -18px -26px; }
  .cd-center::before { inset: -18px -12px -16px; border-radius: 20px; }
  .cd-tagline { letter-spacing: 0.2em; font-size: 10px; }
}
/* too narrow for the wordmark and three languages: the mark alone stands for it */
@media (max-width: 440px) {
  .wordmark-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wordmark .logo { height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* !important beats the inline dash the draw-in starts from */
  .cd-draw { animation: none; stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  .cd-glyph, #cd-sky, .cd-arrived { transition: none; animation: none; }
}
