/* Colors from the CG Nanotheme (make_yellowdot.py): black page, one yellow, white type. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/inter-latin-500-700.woff2") format("woff2");
}

:root {
  --black: #000000;
  --white: #f5f5f3;
  --grey: #8f8f8f;
  --edge: #5c5c5c;
  --grid: #262626;
  --card: #1c1c1c;
  --off: #3c3c3c;
  --paper: #e6e6e1;   /* off-white for filled tags */
  /* buzzwords stay in the background: dimmer than the name */
  --human: #8a8a86;
  --ai: #4a4a4a;
  --yellow: #ffd400;
  --ink: #0b0b0b;

  /* light position and radius; main.js moves them */
  --x: 50vw;
  --y: 46vh;
  --r: 0px;
  --pitch: 11px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);   /* soft, long settle */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--white);
  font: 500 14px/1.5 "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

/* ---------- scene ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;       /* finger drags move the light instead of the page */
  user-select: none;
  -webkit-user-select: none;
}

.dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-size: var(--pitch) var(--pitch);
  background-position: center;
}
.dots-base { background-image: radial-gradient(circle, var(--grid) 0.9px, transparent 1.3px); opacity: 0.35; }
.dots-lit  { background-image: radial-gradient(circle, var(--off) 1.2px, transparent 1.7px); }
.dots-core { background-image: radial-gradient(circle, var(--edge) 1.9px, transparent 2.4px); }

/* halftone falloff: bigger, brighter dots near the light */
.js .dots-lit {
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
          mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}
.js .dots-core {
  --rc: calc(var(--r) * 0.42);
  -webkit-mask-image: radial-gradient(circle var(--rc) at var(--x) var(--y), rgba(0,0,0,.55) 0%, transparent 100%);
          mask-image: radial-gradient(circle var(--rc) at var(--x) var(--y), rgba(0,0,0,.55) 0%, transparent 100%);
}

/* without JS or with reduced motion: no light, calm static field */
html:not(.js) .dots-lit,
html:not(.js) .dots-core { display: none; }

.words { position: absolute; inset: 0; }
.js .words {
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, #000 30%, rgba(0,0,0,.1) 100%);
          mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, #000 30%, rgba(0,0,0,.1) 100%);
}

/* Wordmark + fields line. Both lockups (masked text, unmasked dot) have the same
   width because each carries a dot, so the dot sits exactly at the real "a". */
.lockup {
  --ms: clamp(40px, 8.5vw, 112px);
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
}

.mark {
  margin: 0;
  font-size: var(--ms);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}

.mark-ghost { color: transparent; pointer-events: none; }
/* Ink gap between the final "a" and the dot = ink gap between "d" and "a" in
   "gajda" (0.078em, measured by pixel scan with this tracking).
   Inter 500 "a": right side bearing 0.0723em; the last letter also carries
   letter-spacing (-0.035em). So margin = 0.078 - (0.0723 - 0.035) = 0.0407em.
   The dot dips 0.012em below the baseline, like the overshoot of the "a" bowl.
   The dot is "yellow peter"; its viewBox is cropped to the circle, so the box
   edge is the ink edge (the circle is 1.155% taller than wide).
   Size: x-height of the name : dot width = golden ratio.
   Inter 500 x-height 0.5459em / 1.618 = 0.3374em wide, 0.3413em tall. */
.dot {
  display: inline-block;
  width: 0.3374em;
  height: 0.3413em;
  margin-left: 0.0407em;
  vertical-align: -0.012em;
  background: url("/yellow-peter.svg") center / 100% 100% no-repeat;
}
.dot-space { visibility: hidden; }

.note {
  position: absolute;
  margin: 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.note-soon   { left: 24%; top: 25%; }
/* under the wordmark, left ink edges aligned: "c" side bearing 0.0471em of the
   mark minus "p" side bearing 0.0722em of 16px */
.note-fields {
  font-size: 16px;
  left: calc(var(--ms) * 0.0471 - 1.155px);
  top: calc(100% + var(--ms) * 0.22);
  color: var(--grey);
}

.m-br { display: none; }

/* "coming soon" as a device status module */
.status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 6px;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  background: rgba(8, 8, 8, 0.9);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}
.led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  animation: breathe 2.8s ease-in-out infinite;
}
.caret {
  width: 6px;
  height: 11px;
  margin-left: -3px;
  background: var(--paper);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.25; box-shadow: 0 0 0 0 rgba(230, 230, 225, 0); }
  50%      { opacity: 1;    box-shadow: 0 0 8px 1px rgba(230, 230, 225, 0.45); }
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 640px) {
  .note-soon   { left: 8%; top: 22%; }
  .m-br        { display: inline; }   /* fields line breaks after the colon */
}

/* buzzwords in the dark: invisible until the light passes */
.finds {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  letter-spacing: 0.02em;
  color: #6a6a6a;
}
/* each word sits in a label: thin frame, dark fill, number as a filled segment */
.finds li {
  position: absolute;
  display: inline-flex;
  align-items: stretch;
  white-space: nowrap;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  background: rgba(8, 8, 8, 0.9);
  overflow: hidden;
}
.finds li > span, .finds li:not(:has(span)) { padding: 0.42em 0.7em 0.38em; }
/* three sizes only */
.finds .s1 { font-size: 11px; }
.finds .s2 { font-size: 13px; }
.finds .s3 { font-size: 16px; }
/* index number as a small filled label chip */
/* number block: off-white = human, grey = ai */
.finds .n {
  display: flex;
  align-items: center;
  padding: 0 0.5em;
  background: var(--human);
  color: var(--black);
  font: 600 0.8em/1 var(--mono);
  letter-spacing: 0.04em;
}
.js .finds {
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, #000 25%, transparent 85%);
          mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, #000 25%, transparent 85%);
}
.finds li:nth-child(1) { left: 4%; top: 8%; }
.finds li:nth-child(2) { left: 24%; top: 10%; }
.finds li:nth-child(3) { left: 44%; top: 7%; }
.finds li:nth-child(4) { left: 63%; top: 11%; }
.finds li:nth-child(5) { left: 81%; top: 8%; }
.finds li:nth-child(6) { left: 3%; top: 26%; }
.finds li:nth-child(7) { left: 43%; top: 24%; }
.finds li:nth-child(8) { left: 64%; top: 27%; }
.finds li:nth-child(9) { left: 82%; top: 23%; }
.finds li:nth-child(10) { left: 5%; top: 42%; }
.finds li:nth-child(11) { left: 22%; top: 34%; }
.finds li:nth-child(12) { left: 80%; top: 43%; }
.finds li:nth-child(13) { left: 3%; top: 61%; }
.finds li:nth-child(14) { left: 25%; top: 64%; }
.finds li:nth-child(15) { left: 45%; top: 66%; }
.finds li:nth-child(16) { left: 65%; top: 62%; }
.finds li:nth-child(17) { left: 63%; top: 83%; }
.finds li:nth-child(18) { left: 6%; top: 79%; }
.finds li:nth-child(19) { left: 24%; top: 82%; }
.finds li:nth-child(20) { left: 44%; top: 80%; }
.finds li:nth-child(21) { left: 83%; top: 60%; }
.finds li:nth-child(22) { left: 81%; top: 78%; }
.finds li:nth-child(23) { left: 4%; top: 51%; }
.finds li:nth-child(24) { left: 24%; top: 73%; }
.finds li:nth-child(25) { left: 63%; top: 72%; }

@media (max-width: 640px) {
  .finds li:nth-child(1) { left: 6%; top: 7%; }
  .finds li:nth-child(2) { left: 56%; top: 11%; }
  .finds li:nth-child(3) { left: 52%; top: 18%; }
  .finds li:nth-child(4) { left: 58%; top: 28%; }
  .finds li:nth-child(5) { left: 6%; top: 30%; }
  .finds li:nth-child(6) { left: 6%; top: 59%; }
  .finds li:nth-child(7) { left: 6%; top: 66%; }
  .finds li:nth-child(8) { left: 58%; top: 61%; }
  .finds li:nth-child(9) { left: 56%; top: 68%; }
  .finds li:nth-child(10) { left: 56%; top: 75%; }
  .finds li:nth-child(11) { left: 6%; top: 74%; }
  .finds li:nth-child(12) { left: 6%; top: 37%; }
  .finds li:nth-child(n+13) { display: none; }   /* phones: fewer words */
  .finds li:nth-child(23) { display: inline-flex; left: 56%; top: 37%; }
  .finds li:nth-child(24) { display: inline-flex; left: 6%; top: 81%; }
}

/* ---------- blueprint: construction lines of the wordmark ----------
   Positions in em of the wordmark (line-height 1): baseline 0.864em from the
   box top (Inter ascent 0.969, descent 0.241, half-leading -0.105), x-height
   0.5459em above it; peter 0.3374em wide, bottom 0.012em under the baseline. */

.blueprint { position: absolute; inset: 0; pointer-events: none; }
.js .blueprint {
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, #000 25%, transparent 85%);
          mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, #000 25%, transparent 85%);
}
html:not(.js) .blueprint { display: none; }

.bp { position: relative; color: transparent; }
.bp b {
  position: absolute;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--grey);
}

.bp-line {
  position: absolute;
  left: -0.35em;
  right: -0.35em;
  border-top: 1px solid var(--edge);
}
.bp-line b { right: 100%; margin-right: 10px; transform: translateY(-50%); }
.bp-base { top: 0.864em; }
.bp-x    { top: 0.3181em; }

/* dimension lines with end ticks */
.bp-dia {
  position: absolute;
  height: 0;
  border-top: 1px solid var(--grey);
}
.bp-dia::before, .bp-dia::after {
  content: "";
  position: absolute;
  top: -4px;
  height: 7px;
  border-left: 1px solid var(--grey);
}
.bp-dia::before { left: 0; }
.bp-dia::after  { right: 0; }
.bp-dia { right: 0; width: 0.3374em; top: 1.02em; }
.bp-dia b { left: 50%; top: 8px; transform: translateX(-50%); }
@media (max-width: 640px) { .bp-line b { display: none; } }   /* no room left of the name */

/* ---------- hud: instrument-style labels ---------- */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--edge);
  pointer-events: none;
}
.readout {
  align-self: flex-start;
  padding: 3px 6px 2px;   /* + 1px border = same height as .model */
  border: 1px solid #2a2a2a;
  border-radius: 2px;
  background: var(--ink);
  color: var(--grey);
  font-variant-numeric: tabular-nums;
  white-space: pre;
}
.readout:empty { display: none; }
/* model label: filled off-white tag, not pure white */
.model {
  align-self: flex-start;
  padding: 4px 6px 3px;
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.finds .ai .n { background: var(--ai); }

.hud-left { display: flex; align-items: center; gap: 14px; }
.legend { display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 1px; }
.sw-ai { margin-left: 8px; background: var(--ai); }
.sw-human { background: var(--human); }
html:not(.js) .readout { display: none; }

/* ---------- bar ---------- */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 20px max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  font-size: 13px;
  color: var(--grey);
  /* frosted bar over the dot field, hairline on top */
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
          backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(245, 245, 243, 0.08);
}
.spacer { flex: 1; }

.bar a, .bar button, .legal .close {
  color: var(--grey);
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}
.bar .mail { color: var(--white); }
.bar .icon { display: inline-flex; padding: 4px; margin: -4px 0; }
/* pet projects: instrument tag + links, sits after the social icons */
.pets { display: flex; align-items: center; gap: 14px; }
.pets .tag {
  padding: 4px 6px 3px;
  border-radius: 2px;
  background: var(--card);
  color: var(--grey);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pets .soon { color: var(--edge); }
.pets > * { white-space: nowrap; }
.bar a:hover, .bar button:hover, .legal .close:hover, .legal a:hover { color: var(--yellow); }

:focus-visible {
  outline: 1px solid var(--yellow);
  outline-offset: 4px;
  border-radius: 2px;
}

.lang [data-l] { color: var(--edge); }
html[lang="en"] .lang [data-l="en"],
html[lang="de"] .lang [data-l="de"] { color: var(--white); }

@media (max-width: 640px) {
  .bar { gap: 6px 18px; }
  .spacer { flex-basis: 100%; height: 0; }
  .pets { flex-basis: 100%; flex-wrap: wrap; gap: 6px 12px; }
}

/* ---------- language ---------- */

html[lang="en"] body [lang="de"],
html[lang="de"] body [lang="en"] { display: none; }

/* ---------- legal ---------- */

.legal {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 64px);
  padding: 32px;
  border: 1px solid rgba(245, 245, 243, 0.1);
  border-radius: 18px;
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
          backdrop-filter: saturate(180%) blur(30px);
  color: var(--white);
  font-size: 14px;
  line-height: 1.6;
}
.legal::backdrop { background: rgba(0, 0, 0, 0.6); }
.legal[open] { animation: sheet-in 0.45s var(--ease) both; }
.legal[open]::backdrop { animation: fade-in 0.45s var(--ease) both; }
.legal h2 { margin: 28px 0 8px; font-size: 14px; font-weight: 600; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 10px; color: var(--grey); }
.legal a { color: var(--white); }
.legal .close { float: right; margin: -8px 0 0 16px; }

/* without JS the dialog cannot open: show it as a section below the scene */
html:not(.js) body { overflow: auto; }
html:not(.js) .scene { position: relative; height: 100vh; }
html:not(.js) .legal { display: block; position: static; margin: 32px auto 140px; }
html:not(.js) .legal .close { display: none; }

/* ---------- entrance ---------- */

@keyframes focus-in {
  from { opacity: 0; filter: blur(8px); }
  to   { opacity: 1; filter: none; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }

/* both wordmarks move together, so the dot stays on the real "a" */
.js .mark        { animation: focus-in 1.8s var(--ease) 0.1s both; }
.js .note-fields { animation: focus-in 1.8s var(--ease) 0.6s both; }
.js .mark-ghost .dot { animation: fade-in 1.4s var(--ease) 1.2s both; }
.js .bar,
.js .hud         { animation: fade-in 0.9s var(--ease) 0.3s both; }

@media (prefers-reduced-motion: reduce) {
  .readout { display: none; }
  .led, .caret { animation: none; }
  .js .mark, .js .note-fields, .js .mark-ghost .dot, .js .bar, .js .hud,
  .legal[open], .legal[open]::backdrop { animation: none; }
  .js .dots-lit, .js .dots-core { display: none; }
  .js .words, .js .finds { -webkit-mask-image: none; mask-image: none; }
  .blueprint { display: none; }
}
