/* The website of COSMIC, the suite of ONESTRAND. The design language is Lumen: a deep night as the room, hairlines that carry light,
   glass panels, wide capitals for names, one calm sans for everything but code, motion that flows and never
   cuts. The colours come from the elements, heavy and quiet, no neon: forest, embers, deep water, brass,
   steel. Marks are the DNA Möbius drawn by scripts/build_site.py. System fonts only: nothing is loaded from
   third parties. Night by default, porcelain when the system asks for light. See docs/design/designsprache.md. */

:root {
  --night: #070b12;                       /* the room: deep space, not black */
  --night-2: #0c121b;
  --glass: rgba(255, 255, 255, .035);     /* panels are glass, never boxes */
  --glass-2: rgba(255, 255, 255, .07);
  --hair: rgba(255, 255, 255, .09);       /* hairlines: the thread */
  --hair-2: rgba(255, 255, 255, .18);
  --ink: #e9edf2;
  --muted: #8e9aaa;
  --brass: #c9ad6a;                       /* the suite's accent */
  --swp: #4f7a57;                         /* forest */
  --sep: #b35a2d;                         /* embers */
  --slp: #3c6f8c;                         /* deep water */
  --swelp: #cfb46b;                       /* lightning, brass */
  --swelper: #7d93a8;                     /* wind, steel */
  --swp-ink: #7fae88;                     /* the same colours as text: light enough to read on the night */
  --sep-ink: #d98556;
  --slp-ink: #6fa3c2;
  --swelp-ink: #cfb46b;
  --swelper-ink: #7d93a8;
  --brass-ink: #c9ad6a;
  --on-accent: #090d13;
  --console: #090e16;                     /* code always sits in the night, on both schemes */
  --console-ink: #e9edf2;
  --nebula: .16;
  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Inter, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "JetBrains Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
  --step--1: .85rem;
  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-2: 1.35rem;
  --step-3: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.4vw, 4.1rem);
  --track: .28em;                         /* the tracking of a name in capitals */
  --r: 12px;
  --r-lg: 22px;
  --wrap: 1120px;
  --accent: var(--brass);
  --accent-ink: var(--brass-ink);              /* the accent as text: always readable, see designsprache.md */
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --night: #f4f2ed; --night-2: #ebe8e1; --glass: rgba(255, 255, 255, .55); --glass-2: rgba(255, 255, 255, .85);
    --hair: rgba(23, 27, 33, .1); --hair-2: rgba(23, 27, 33, .2); --ink: #171b21; --muted: #5b6673;
    --brass: #75591f; --swp: #2e5a3b; --sep: #8c3f1a; --slp: #24536b; --swelp: #7a5f22; --swelper: #4f6478;
    --swp-ink: #2e5a3b; --sep-ink: #8c3f1a; --slp-ink: #24536b; --swelp-ink: #7a5f22; --swelper-ink: #4f6478; --brass-ink: #75591f;
    --on-accent: #fbfaf6; --nebula: .09;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --night: #f4f2ed; --night-2: #ebe8e1; --glass: rgba(255, 255, 255, .55); --glass-2: rgba(255, 255, 255, .85);
  --hair: rgba(23, 27, 33, .1); --hair-2: rgba(23, 27, 33, .2); --ink: #171b21; --muted: #5b6673;
  --brass: #75591f; --swp: #2e5a3b; --sep: #8c3f1a; --slp: #24536b; --swelp: #7a5f22; --swelper: #4f6478;
  --swp-ink: #2e5a3b; --sep-ink: #8c3f1a; --slp-ink: #24536b; --swelp-ink: #7a5f22; --swelper-ink: #4f6478; --brass-ink: #75591f;
  --on-accent: #fbfaf6; --nebula: .09;
  color-scheme: light;
}
[data-accent="swp"] { --accent: var(--swp); --accent-ink: var(--swp-ink); }
[data-accent="sep"] { --accent: var(--sep); --accent-ink: var(--sep-ink); }
[data-accent="slp"] { --accent: var(--slp); --accent-ink: var(--slp-ink); }
[data-accent="swelp"] { --accent: var(--swelp); --accent-ink: var(--swelp-ink); }
[data-accent="swelper"] { --accent: var(--swelper); --accent-ink: var(--swelper-ink); }

/* Language: one page, two texts */
html:not([data-lang="en"]) [data-l="en"] { display: none !important; }
html[data-lang="en"] [data-l="de"] { display: none !important; }
/* Theme pairs: the night variant is the default, porcelain when the system asks for light */
.only-light { display: none !important; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .only-light { display: inline-block !important; } :root:not([data-theme="dark"]) .only-dark { display: none !important; } }
:root[data-theme="light"] .only-light { display: inline-block !important; }
:root[data-theme="light"] .only-dark { display: none !important; }

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ink); font: 400 var(--step-0)/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;   /* the nebula: the five colours, far away */
  background:
    radial-gradient(55% 45% at 85% -5%, rgba(60, 111, 140, var(--nebula)), transparent 70%),
    radial-gradient(45% 40% at 5% 25%, rgba(79, 122, 87, var(--nebula)), transparent 70%),
    radial-gradient(40% 35% at 70% 105%, rgba(179, 90, 45, var(--nebula)), transparent 70%),
    radial-gradient(35% 30% at 35% 110%, rgba(207, 180, 107, calc(var(--nebula) * .5)), transparent 70%),
    radial-gradient(35% 35% at 100% 60%, rgba(125, 147, 168, calc(var(--nebula) * .6)), transparent 70%); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: .22em; transition: text-decoration-color .2s; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--brass) 40%, transparent); }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.1; }
h1 { font-size: var(--step-4); font-weight: 300; letter-spacing: -.02em; line-height: 1.04; }
h2 { font-size: var(--step-3); font-weight: 300; letter-spacing: -.015em; }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
strong { font-weight: 600; color: var(--ink); }
code, kbd { font-family: var(--mono); font-size: .88em; color: var(--ink); background: var(--glass-2); border: 1px solid var(--hair); padding: .08em .4em; border-radius: 6px; }
pre { margin: .4rem 0 1rem; padding: 1rem 1.25rem; background: var(--console); color: var(--console-ink); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r); overflow: auto; font: .86rem/1.6 var(--mono); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
pre .dim { color: var(--muted); }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--accent); color: var(--on-accent); padding: .5rem .9rem; border-radius: 999px; z-index: 20; text-decoration: none; }
.skip:focus { left: .5rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* Header: the house, the pages, the language */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1.5rem; padding: .85rem max(16px, calc((100% - var(--wrap)) / 2));
  background: var(--night); background: color-mix(in srgb, var(--night) 86%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-2) 15%, var(--hair-2) 85%, transparent); }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand .wordmark { display: inline-flex; align-items: baseline; gap: .6rem; }
.brand .name { font-size: .82rem; font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; }
.brand .house { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: .1rem; margin-left: auto; padding: 4px 0; }
.nav a { position: relative; padding: .45rem .7rem; text-decoration: none; color: var(--muted); font-size: var(--step--1); font-weight: 500; white-space: nowrap; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--glass-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .15rem; height: 1px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.switch { display: inline-flex; border: 1px solid var(--hair-2); border-radius: 999px; padding: 2px; background: var(--glass); }
.switch button { border: 0; background: transparent; color: var(--muted); font: 600 .72rem/1 var(--sans); letter-spacing: .12em; padding: .42rem .7rem; border-radius: 999px; cursor: pointer; transition: color .2s, background .2s; }
.switch button[aria-pressed="true"] { background: var(--glass-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-2); }
@media (max-width: 760px) { .top { gap: .75rem; flex-wrap: wrap; justify-content: space-between; } .nav { order: 3; width: 100%; margin-left: 0; gap: 0; } .nav a { padding: .4rem .55rem; } .brand .house { display: none; } }

/* Sections: a hairline between them, a kicker with a short light before its words */
.main { padding: 0 max(16px, calc((100% - var(--wrap)) / 2)) 5rem; }
.section { position: relative; padding: 4rem 0 1rem; }
.section + .section { margin-top: 1.5rem; }
.section + .section::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--hair-2), transparent 70%); }
.kicker { display: inline-flex; align-items: center; gap: .7rem; font-size: .74rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 1.1rem; }
.kicker::before { content: ""; width: 1.5rem; height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 60ch; font-weight: 300; }
.measure { max-width: 72ch; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 1.4rem 0 .5rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.card { position: relative; background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 1.5rem 1.6rem 1.4rem; transition: border-color .3s; }
.card::before { content: ""; position: absolute; top: -1px; left: 1.6rem; width: 4rem; height: 1px; border-radius: 1px;   /* the light edge */
  background: linear-gradient(90deg, var(--accent), transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent); }
.card:hover { border-color: var(--hair-2); }
.card h3 { margin-top: .1rem; }
.card p:last-child { margin-bottom: 0; }
.card .tag { display: inline-flex; align-items: center; gap: .5rem; font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: .8rem; }
.card .tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.card .mark { width: 2.75rem; height: 2.75rem; margin-bottom: 1rem; }
.card .mark img { display: block; width: 100%; height: 100%; border-radius: 10px; }
.card .sub { color: var(--muted); font-size: var(--step--1); margin: -.5rem 0 .8rem; }
.pill { display: inline-block; border: 1px solid var(--hair-2); border-radius: 999px; padding: .22rem .75rem; font-size: .78rem; color: var(--muted); }
.pill + .pill { margin-left: .2rem; }
.cta { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.5rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: var(--step--1); letter-spacing: .02em;
  color: var(--on-accent); background: var(--brass); background: linear-gradient(180deg, color-mix(in srgb, var(--brass) 92%, white), var(--brass));
  box-shadow: 0 0 0 1px var(--brass); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brass) 60%, transparent), 0 14px 34px -10px color-mix(in srgb, var(--brass) 60%, transparent); transition: transform .25s, box-shadow .25s; }
.cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brass) 80%, transparent), 0 18px 40px -10px color-mix(in srgb, var(--brass) 70%, transparent); }
.cta.secondary { background: var(--glass); color: var(--ink); box-shadow: 0 0 0 1px var(--hair-2); }
.cta.secondary:hover { box-shadow: 0 0 0 1px var(--accent); }
.cta + .cta { margin-left: .6rem; }

/* Suite hero: the living mark, and a line of light below */
.hero { position: relative; display: grid; gap: 3rem; grid-template-columns: 1.1fr 1fr; align-items: center; padding: 4.5rem 0 3.5rem; }
.hero::after, .program-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hair-2) 25%, var(--accent) 50%, var(--hair-2) 75%, transparent); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .hero::after { animation: travel 14s linear infinite; } }
@keyframes travel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.hero h1 { margin-bottom: .7em; }
.hero .art { display: grid; place-items: center; }
.hero .art .logo-stage { position: relative; width: min(100%, 360px); aspect-ratio: 1; display: grid; place-items: center; }
.hero .art .logo { width: 100%; height: auto; filter: drop-shadow(0 0 28px color-mix(in srgb, var(--accent) 25%, transparent)); }
.hero .art .logo-stage.is-live .logo { visibility: hidden; }
.hero .art .logo-live { position: absolute; inset: 0; margin: auto; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3rem; } .hero .art .logo-stage { width: min(100%, 280px); } }

/* The console: code sits in the night on both schemes, with a live dot */
.console { width: 100%; max-width: 820px; margin: 1.6rem 0 .5rem; background: var(--console); color: var(--console-ink); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); }
.console-bar { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.3rem; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #8e9aaa; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }
.console-bar::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6fa37a; box-shadow: 0 0 10px #6fa37a; }
.console-body { margin: 0; padding: 1.1rem 1.3rem 1.2rem; font: .84rem/1.65 var(--mono); white-space: pre; overflow: auto; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--console-ink); }
.console .prompt { color: #c9ad6a; }   /* the console keeps the night's brass on both schemes */
.console .ok { color: #6fa37a; }
.console .dim { color: #8e9aaa; }
.cursor::after { content: "▍"; color: #c9ad6a; }
@media (prefers-reduced-motion: no-preference) { .cursor::after { animation: blink 1.2s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }

/* Program hero: mark, number and role, the name in wide capitals */
.program-hero { position: relative; padding: 4rem 0 2rem; display: grid; gap: 1.6rem; grid-template-columns: auto 1fr; align-items: start; }
.program-hero .mark { width: 5rem; height: 5rem; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 30%, transparent)); }
.program-hero .mark img { display: block; width: 100%; height: 100%; border-radius: 18px; }
.program-hero h1.name { margin: .1rem 0 .6rem; font-size: clamp(2rem, 1.3rem + 2.8vw, 3.6rem); font-weight: 500; letter-spacing: var(--track); text-transform: uppercase; line-height: 1; }
.program-hero .sub { color: var(--muted); font-size: var(--step-1); font-weight: 300; margin: 0 0 .9rem; }
.program-hero .meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
@media (max-width: 600px) { .program-hero { grid-template-columns: 1fr; } }

/* Tables: a glass panel, hairlines between rows */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--glass); }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th, .table td { text-align: left; vertical-align: top; padding: .85rem 1.1rem; border-top: 1px solid var(--hair); }
.table thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; }
.table code { white-space: nowrap; }

/* The three layers: bands with a thread of light on the left */
.suite { display: grid; gap: .8rem; margin: 1.5rem 0; }
.suite .band, .pair-text { position: relative; border: 1px solid var(--hair); border-radius: var(--r); padding: 1rem 1.25rem 1rem 1.5rem; background: var(--glass); display: grid; gap: .3rem; }
.suite .band::before, .pair-text::before { content: ""; position: absolute; left: 0; top: 1rem; bottom: 1rem; width: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.suite .band.swelper { --accent: var(--swelper); --accent-ink: var(--swelper-ink); }
.suite .band.swelp { --accent: var(--swelp); --accent-ink: var(--swelp-ink); }
.suite .protocols { display: grid; gap: .8rem; grid-template-columns: repeat(3, 1fr); }
.suite .band .name { font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: .85rem; color: var(--accent-ink); }
.suite .band .role { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 640px) { .suite .protocols { grid-template-columns: 1fr; } }

/* Matrix: every pair has a reason */
.matrix { display: grid; grid-template-columns: 6.5rem repeat(5, 1fr); gap: 6px; font-size: .78rem; margin: 1.2rem 0 .9rem; }
.matrix .h, .matrix .r { display: grid; place-items: center; color: var(--muted); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .66rem; padding: .4rem .2rem; }
.matrix .r { justify-items: start; }
.matrix button { border: 1px solid var(--hair); background: var(--glass); color: var(--muted); border-radius: 10px; min-height: 2.6rem; cursor: pointer; font: inherit; transition: border-color .2s, background .2s, box-shadow .2s, color .2s; }
.matrix button:hover, .matrix button.is-on { border-color: var(--accent); color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 0 16px -4px var(--accent); }
.matrix .self { border-radius: 10px; background: var(--glass); opacity: .35; }
.pair-text { min-height: 3.5rem; }
.pair-text p { margin: 0; }
@media (max-width: 640px) { .matrix { grid-template-columns: 4.5rem repeat(5, 1fr); font-size: .7rem; } }

/* Steps on the start page */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0; display: grid; gap: 1.4rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; }
.steps li::before { content: counter(step, decimal-leading-zero); color: var(--accent-ink); font-weight: 300; font-size: 1.6rem; line-height: 1; padding-top: .1rem; letter-spacing: .02em; }
.steps li p:last-child { margin-bottom: 0; }

/* Footer */
.foot { position: relative; padding: 3rem max(16px, calc((100% - var(--wrap)) / 2)) 2.5rem; color: var(--muted); font-size: var(--step--1); }
.foot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-2) 20%, var(--hair-2) 80%, transparent); }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.foot-brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: .78rem; margin-bottom: .5rem; }
.foot-brand img { width: 22px; height: 22px; border-radius: 6px; }
.foot-head { color: var(--ink); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: .7rem; margin-bottom: .5rem; }
.foot-legal { margin-top: 2.5rem; font-size: .78rem; }
.foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair-2); transition: border-color .2s; }
.foot a:hover { border-color: var(--accent); }
