/* ONESTRAND · the house style. Three colours and nothing else: black, silver, blue.
   Black is the room, silver is the human, blue is the machine. System fonts, no files loaded from anywhere. */

:root {
  --black: #000;
  --night: #05070b;                    /* the black of raised surfaces, a breath of blue in it */
  --ink: #f4f6f9;                      /* silver, lit */
  --silver: #c5cad2;
  --silver-2: #9aa1ac;                 /* running text */
  --silver-3: #747b87;                 /* quiet text: 4.9 to 1 on black */
  --line: rgba(206, 214, 228, 0.13);   /* hairlines */
  --line-2: rgba(206, 214, 228, 0.24);
  --glass: rgba(206, 214, 228, 0.045);
  --blue: #0a6cff;
  --blue-hi: #5aa2ff;                  /* blue as text on black */
  --blue-lo: #0647b8;
  --grad-silver: linear-gradient(180deg, #ffffff 0%, #e6e9ee 36%, #a2a8b2 100%);
  --grad-blue: linear-gradient(180deg, #8dbdff 0%, #2f84ff 48%, #0a5bea 100%);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Helvetica, Inter, Roboto, Arial, sans-serif;
  --track: 0.32em;                     /* names stand in wide capitals */
  --nav: 52px;
  --pad: clamp(20px, 5vw, 48px);
  --wide: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav); }
body {
  margin: 0; background: var(--black); color: var(--silver-2);
  font: 400 17px/1.5 var(--sans); letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(10, 108, 255, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 3px; border-radius: 6px; }

/* Two languages in one page: the one that is not spoken stays out of the way. */
html[lang="de"] [data-l="en"], html[lang="en"] [data-l="de"] { display: none !important; }

.wrap { width: 100%; max-width: calc(var(--wide) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.silver { background: var(--grad-silver); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.blue { background: var(--grad-blue); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
h1.silver, h2.silver, h2.blue { padding-bottom: 0.1em; margin-bottom: -0.1em; }   /* as blocks they would cut the feet of g, p and y */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--blue); color: #fff; }
.skip:focus { left: 12px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav);
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid transparent; transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); background: rgba(0, 0, 0, 0.74); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand img { width: 36px; height: 24px; }
.mark { position: relative; flex: none; width: 40px; height: 26px; }      /* the mark in the header: still, or drawn live */
.mark img, .mark canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark canvas { opacity: 0; }
.mark.is-live canvas { opacity: 1; }
.mark.is-live img { opacity: 0; }
.brand span { font-size: 13px; font-weight: 600; letter-spacing: var(--track); margin-right: calc(-1 * var(--track)); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 34px); font-size: 13px; color: var(--silver-2); }
.nav-links a { padding: 12px 2px; transition: color 0.25s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.lang { display: none; padding: 2px; border: 1px solid var(--line-2); border-radius: 999px; }
.js .lang { display: inline-flex; }                       /* the switch needs the script; without it there is nothing to press */
.lang button {
  appearance: none; border: 0; background: none; cursor: pointer; font: 600 11px/1 var(--sans); letter-spacing: 0.14em;
  color: var(--silver-3); padding: 10px 11px 10px 12px; border-radius: 999px; transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.lang button[aria-pressed="true"] { color: var(--ink); background: rgba(206, 214, 228, 0.14); }
@media (max-width: 720px) { .nav-links a.opt { display: none; } }
@media (max-width: 350px) { .nav-links a { display: none; } }      /* the narrowest phones: the name and the language */
@media (max-width: 372px) { .nav .wrap { padding: 0 12px; gap: 12px; } }   /* narrower than an iPhone mini: the row needs the room, or the switch runs off the edge */

/* ── Hero: the loop, then the claim ─────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; padding: calc(var(--nav) + clamp(8px, 2.4vh, 28px)) 0 clamp(56px, 9vh, 96px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden;
}
.stage { position: relative; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.9s var(--ease); }
.stage.is-live canvas { opacity: 1; }
.stage .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.6s var(--ease); }
.js .stage .still { opacity: 0; }                       /* the living mark draws itself; the still waits behind */
.js .stage.is-still .still { opacity: 1; }              /* no WebGL: the still takes the stage */
.hero-stage {
  width: min(100vw, 77vh, 760px); width: min(100vw, 77svh, 760px); aspect-ratio: 1 / 0.64; margin-bottom: 6px;   /* room for the name on the first screen */
  -webkit-mask-image: radial-gradient(ellipse closest-side, #000 88%, transparent 100%); mask-image: radial-gradient(ellipse closest-side, #000 88%, transparent 100%);
}
.lockup {
  display: inline-flex; align-items: center; gap: clamp(12px, 2.6vw, 22px);
  font-size: clamp(11px, 1.5vw, 13px); font-weight: 600; letter-spacing: var(--track); white-space: nowrap;
}
.lockup b { font-weight: 600; margin-right: calc(-1 * var(--track)); }
.lockup .h { color: var(--silver); }
.lockup .m { color: var(--blue-hi); }
.lockup .x { font-size: 1.5em; font-weight: 300; letter-spacing: 0; color: #fff; text-shadow: 0 0 18px rgba(90, 162, 255, 0.95), 0 0 4px rgba(255, 255, 255, 0.6); transform: translateY(-0.04em); }
.lockup::before, .lockup::after { content: ""; width: clamp(28px, 9vw, 120px); height: 1px; }
.lockup::before { background: linear-gradient(90deg, transparent, rgba(197, 202, 210, 0.55)); }
.lockup::after { background: linear-gradient(90deg, rgba(90, 162, 255, 0.7), transparent); }
.hero h1 {
  margin-top: clamp(26px, 4.6vh, 46px);
  font-size: clamp(24px, 7.6vw, 68px); line-height: 1.06; font-weight: 600; letter-spacing: -0.03em;
}
.hero h1 > span { display: block; padding-bottom: 0.1em; }         /* room for descenders under the clipped gradient */
@media (min-width: 1200px) { .hero h1 > span { display: inline-block; } }
.lead { max-width: 34em; margin: clamp(16px, 2.4vh, 24px) auto 0; font-size: clamp(17px, 1.75vw, 21px); line-height: 1.42; color: var(--silver-2); }
.lead strong { color: var(--ink); font-weight: 500; }
.hero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }   /* the words stand in front of the stage */
.scroll-hint {
  position: absolute; left: 50%; bottom: 18px; width: 1px; height: 34px; margin-left: -0.5px; overflow: hidden;
  background: linear-gradient(180deg, transparent, var(--line-2));
}
.scroll-hint::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, var(--blue-hi)); animation: fall 2.6s var(--ease) infinite; }
@keyframes fall { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* The name under the mark. The collider (assets/js/collider.js) draws lights and tracks on a canvas over the
   stage and throws the letters into this row. The row has its place from the first picture on, so nothing
   moves when the module arrives; without the script, or once the plain page has been shown, it takes no room. */
.word { display: none; }
.js .word {
  position: relative; z-index: 2; display: flex; justify-content: center; gap: 0.36em; margin: 2px 0 16px;
  font-size: clamp(19px, 5.4vw, 30px); line-height: 1.3; font-weight: 600; color: var(--ink);
}
.js .word[hidden] { display: none; }
.js .word span { display: block; width: 0.92em; text-align: center; opacity: 0; }
.collider { position: absolute; z-index: 2; pointer-events: none; }

/* What appears: quietly, once. */
.js .hero [data-rise] { transition-delay: calc(0.9s + var(--d, 0s)); }
.js [data-rise] { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-rise].is-in { opacity: 1; transform: none; }

/* ── The story: HUMAN, MACHINE, ONESTRAND ───────────────────────────────── */
.story { position: relative; background: var(--black); }
.gl .story { height: 440vh; }
.story-pin { display: grid; gap: 28px; padding: 96px var(--pad); max-width: calc(var(--wide) + 2 * var(--pad)); margin: 0 auto; }
.gl .story-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh; padding: var(--nav) var(--pad) 0; gap: 0; overflow: hidden;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "copy stage"; align-items: center;
  max-width: calc(var(--wide) + 2 * var(--pad)); margin: 0 auto;
}
.story-stage { height: min(78vh, 760px); height: min(78svh, 760px); align-self: center; display: none; }
.gl .story-stage { display: block; grid-area: stage; }
.story-copy { position: relative; }
.gl .story-copy { height: 100%; grid-area: copy; }
.chapter { max-width: 26em; }
.gl .chapter {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(calc(-50% + 22px)); opacity: 0; pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.gl .chapter.is-on { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.chapter .num { display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 600; letter-spacing: var(--track); color: var(--silver-3); }
.chapter .num::after { content: ""; width: 44px; height: 1px; background: currentColor; opacity: 0.6; }
.chapter .num i { font-style: normal; color: var(--silver); }
.chapter[data-tone="blue"] .num i { color: var(--blue-hi); }
.chapter[data-tone="both"] .num i { color: #fff; }
.chapter h2 { margin-top: 18px; font-size: clamp(36px, 5.2vw, 68px); line-height: 1.05; font-weight: 600; letter-spacing: -0.028em; }
.chapter p { margin-top: 18px; font-size: clamp(17px, 1.65vw, 21px); line-height: 1.45; }
.tag {
  position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; white-space: nowrap; will-change: transform, opacity;
  font-size: 11px; font-weight: 600; letter-spacing: var(--track); padding-left: var(--track); color: var(--silver);
}
.tag.m { color: var(--blue-hi); }
.ticks { position: absolute; right: var(--pad); top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 10px; }
.gl .ticks { display: flex; }
.ticks i { width: 2px; height: 26px; border-radius: 2px; background: var(--line-2); transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.ticks i.is-on { background: var(--blue-hi); box-shadow: 0 0 12px rgba(90, 162, 255, 0.8); }
.ticks i:first-child.is-on { background: var(--silver); box-shadow: 0 0 12px rgba(197, 202, 210, 0.6); }
@media (max-width: 860px) and (orientation: portrait) {            /* a phone held sideways keeps the two columns */
  .gl .story-pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "stage" "copy"; }
  .story-stage { height: 100%; max-height: 58vh; max-height: 58svh; width: 100%; }
  /* the three chapters share one cell, so the row is as tall as the longest of them and no line is ever cut off */
  .gl .story-copy { display: grid; height: auto; min-height: clamp(180px, 30vh, 280px); min-height: clamp(180px, 30svh, 280px); padding-bottom: 16px; align-content: start; }
  .gl .chapter { position: static; grid-area: 1 / 1; transform: translateY(22px); }
  .gl .chapter.is-on { transform: none; }
  .chapter h2 { margin-top: 12px; }
  .chapter p { margin-top: 10px; }
  .ticks { right: 10px; top: 34%; }
}

@media (max-height: 440px) and (orientation: landscape) {           /* a phone held sideways: little height for the words */
  .chapter h2 { margin-top: 10px; font-size: clamp(26px, 4.6vw, 40px); }
  .chapter p { margin-top: 10px; font-size: 15px; line-height: 1.4; }
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { position: relative; padding: clamp(96px, 15vw, 190px) 0; }
.section + .section { border-top: 1px solid transparent; }
.kicker { display: inline-flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; color: var(--blue-hi); }
.kicker::before { content: ""; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--blue-hi)); }
.section h2 { margin-top: 20px; max-width: 14em; font-size: clamp(36px, 5.6vw, 72px); line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.section .measure { margin-top: 22px; max-width: 33em; font-size: clamp(17px, 1.75vw, 21px); line-height: 1.45; }
.centre { text-align: center; }
.centre h2, .centre .measure { margin-left: auto; margin-right: auto; }
.rule { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--line-2) 22%, var(--line-2) 78%, transparent); }

/* The loop in numbers */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 3vw, 40px); margin-top: clamp(48px, 7vw, 88px); }
.figure { padding-top: 22px; border-top: 1px solid var(--line-2); }
.figure .n { font-size: clamp(64px, 12vw, 148px); line-height: 0.92; font-weight: 600; letter-spacing: -0.05em; }
.figure .t { margin-top: 14px; font-size: clamp(13px, 1.5vw, 17px); font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }
.figure .d { margin-top: 6px; font-size: clamp(13px, 1.4vw, 16px); line-height: 1.4; color: var(--silver-3); }

/* HUMAN | MACHINE: two columns and the line between them */
.pairs { position: relative; margin-top: clamp(48px, 7vw, 88px); }
.pairs::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -0.5px;
  background: linear-gradient(180deg, transparent, var(--silver) 12%, var(--blue-hi) 88%, transparent); opacity: 0.5;
}
.pairs-head, .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(28px, 7vw, 96px); }
.pairs-head { font-size: 12px; font-weight: 600; letter-spacing: var(--track); padding-bottom: clamp(20px, 3vw, 34px); }
.pairs-head .h { text-align: right; color: var(--silver); }
.pairs-head .m { color: var(--blue-hi); }
.pair { position: relative; padding: clamp(22px, 3.4vw, 40px) 0; border-top: 1px solid var(--line); }
.pair .what {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); padding: 4px 12px 4px 13px; border-radius: 999px;
  background: var(--black); border: 1px solid var(--line-2); font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--silver-2);
}
.pair .h { text-align: right; }
.pair b { display: block; font-size: clamp(19px, 2.6vw, 30px); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.pair .h b { color: var(--ink); }
.pair .m b { color: var(--blue-hi); }
.pair p > span { display: block; margin-top: 6px; font-size: clamp(14px, 1.5vw, 17px); line-height: 1.4; color: var(--silver-3); }

/* Projects: the room is ready */
.panel {
  position: relative; margin-top: clamp(40px, 6vw, 72px); padding: clamp(32px, 6vw, 72px); border-radius: clamp(22px, 3vw, 34px); overflow: hidden;
  background: linear-gradient(180deg, rgba(206, 214, 228, 0.07), rgba(206, 214, 228, 0.02)); border: 1px solid var(--line);
}
.panel::before { content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--silver), var(--blue-hi), transparent); opacity: 0.75; }
.panel::after {
  content: ""; position: absolute; right: -14%; top: -60%; width: 70%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(10, 108, 255, 0.2), transparent);
}
.panel .state { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--silver); }
.panel .state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-hi); box-shadow: 0 0 10px var(--blue-hi); animation: glow 2.8s ease-in-out infinite; }
@keyframes glow { 50% { opacity: 0.35; } }
.panel h3 { position: relative; z-index: 1; margin-top: 22px; max-width: 16em; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; color: var(--ink); }
.panel p { position: relative; z-index: 1; margin-top: 14px; max-width: 30em; font-size: clamp(16px, 1.6vw, 19px); }
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: clamp(40px, 6vw, 72px); }
.project { display: block; padding: 28px; border-radius: 26px; background: var(--glass); border: 1px solid var(--line); transition: border-color 0.3s var(--ease), transform 0.3s var(--ease); }
.project:hover { border-color: var(--line-2); transform: translateY(-2px); }
.project h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.project p { margin-top: 8px; font-size: 16px; }

/* Contact */
.button {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 34px; padding: 15px 26px 15px 28px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(141, 189, 255, 0.35) inset, 0 12px 44px -10px rgba(10, 108, 255, 0.85);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.button:hover { background: #2a7fff; transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(141, 189, 255, 0.5) inset, 0 16px 54px -10px rgba(10, 108, 255, 1); }
.button svg { width: 15px; height: 15px; }
.contact { overflow: hidden; }
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: -46%; width: min(1100px, 150vw); aspect-ratio: 2 / 1; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(10, 108, 255, 0.2), transparent);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer { position: relative; padding: 34px 0 44px; font-size: 12px; color: var(--silver-3); border-top: 1px solid var(--line); background: var(--black); }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.footer .brand span { font-size: 11px; }
.footer .brand img { width: 30px; height: 20px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer a:hover { color: var(--ink); }
.footer .fine { flex-basis: 100%; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; letter-spacing: 0.02em; }

/* 404 */
.lost { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--nav) var(--pad) 40px; }
.lost img { width: min(62vw, 300px); margin: 0 auto 30px; }
.lost h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-rise] { opacity: 1; transform: none; transition: none; }
  .scroll-hint::after, .panel .state::before { animation: none; }
  .stage canvas, .gl .chapter { transition: none; }
}
