/*
 * storage-anders-denken.de — CLYSO design system, marketing surface
 * ------------------------------------------------------------------
 * Token subset ported 1:1 from ui/CLYSO Design System/colors_and_type.css
 * (v0.5.1). Only the tokens this page uses are copied. Do not add hues or
 * magic numbers here: extend the design system, then re-port.
 *
 * Surface: <body data-surface="prose" data-typeface="marketing">
 * Theme:   light by default (marketing), no data-theme attribute set. Like the
 *          DS theme script, the page follows the OS without JS:
 *            prefers-color-scheme: dark  -> dark (navy + lime)
 *            prefers-contrast: more      -> high contrast (wins over dark)
 *          An explicit data-theme="light|dark|hc" on <html> still overrides.
 * Fonts:   self-hosted woff2 only, no third-party requests.
 */

/* ─────────── Fonts (self-hosted) ─────────── */
@font-face {
  font-family: "NeueMachina";
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/NeueMachina.woff2") format("woff2");
}
/* Source Sans 3 — SIL OFL 1.1, see /fonts/SourceSans3-OFL.txt */
@font-face {
  font-family: "Source Sans 3";
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/SourceSans3.woff2") format("woff2");
}
/* JetBrains Mono — SIL OFL 1.1, see /fonts/JetBrainsMono-OFL.txt */
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/JetBrainsMono.woff2") format("woff2");
}

/* ─────────── Tokens — light theme (default) ─────────── */
:root {
  /* Brand cores */
  --clyso-lime:      #d7ff84;
  --clyso-olive:     #808f12;
  --clyso-navy-900:  #101b29;

  /* Semantic */
  --primary:    var(--clyso-olive);
  --accent:     var(--clyso-lime);
  --on-accent:  var(--clyso-navy-900);

  --bg:   #f8f9fb;
  --fg-1: #070b18;
  --fg-2: #333639;

  --border-strong: rgba(0, 0, 0, 0.12);
  --input-border:  rgba(0, 0, 0, 0.18);
  --focus-ring:    0 0 0 3px rgba(128, 143, 18, 0.18);
  /* Link underline: olive on light / yellow on HC; on dark it drops to the
     fg-3 white-alpha tier so the wordmark stays the only lime element. */
  --link-rule:     var(--primary);

  /* Type stacks */
  --font-display:   "NeueMachina", "Poppins", system-ui, sans-serif;
  --font-sans:      "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:      "JetBrains Mono", "IBM Plex Mono", ui-monospace,
                    SFMono-Regular, Menlo, Consolas, monospace;
  --font-marketing: "Source Sans 3", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type ramp */
  --fs-2xs:   11px;
  --fs-xs:    12px;
  --fs-prose: 15px;
  --fs-lg:    17px;
  --fs-xl:    20px;
  --fs-h2:    36px;
  --fs-mkt-display: 96px;

  --lh-snug:  1.35;
  --lh-base:  1.6;

  --tracking-loose: 0.14em;
  --tracking-tight: -0.01em;
  --tracking-mono:  0.04em;

  /* Spacing (4px base) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  56px;
  --space-12: 96px;

  /* Radii, borders, motion */
  --radius-sm: 2px;
  --radius-md: 4px;
  --bw-hair:   1px;
  --bw-base:   2px;
  --ease-precise: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:     120ms;

  color-scheme: light;
}

/* ─────────── Dark theme — navy + lime ─────────── */
:root[data-theme="dark"] {
  --primary:   var(--clyso-lime);
  --accent:    var(--clyso-lime);
  --on-accent: var(--clyso-navy-900);
  --bg:   var(--clyso-navy-900);
  --fg-1: rgba(255, 255, 255, 0.92);
  --fg-2: rgba(255, 255, 255, 0.78);
  --border-strong: rgba(255, 255, 255, 0.16);
  --input-border:  rgba(255, 255, 255, 0.12);
  --focus-ring:    0 0 0 3px rgba(215, 255, 132, 0.20);
  --link-rule:     rgba(255, 255, 255, 0.52);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --primary:   var(--clyso-lime);
    --accent:    var(--clyso-lime);
    --on-accent: var(--clyso-navy-900);
    --bg:   var(--clyso-navy-900);
    --fg-1: rgba(255, 255, 255, 0.92);
    --fg-2: rgba(255, 255, 255, 0.78);
    --border-strong: rgba(255, 255, 255, 0.16);
    --input-border:  rgba(255, 255, 255, 0.12);
    --focus-ring:    0 0 0 3px rgba(215, 255, 132, 0.20);
    --link-rule:     rgba(255, 255, 255, 0.52);
    color-scheme: dark;
  }
}

/* ─────────── High contrast — AAA, solid borders, no tints ───────────
 * Declared after dark with equal specificity, so HC wins when the OS asks
 * for more contrast and also prefers dark. */
:root[data-theme="hc"] {
  --primary:   #ffd60a;
  --accent:    #ffd60a;
  --on-accent: #000814;
  --bg:   #000814;
  --fg-1: #ffffff;
  --fg-2: #ffffff;
  --border-strong: #ffffff;
  --input-border:  #ffffff;
  --focus-ring:    0 0 0 3px #ffd60a;
  --link-rule:     #ffd60a;
  color-scheme: dark;
}
@media (prefers-contrast: more) {
  :root:not([data-theme]) {
    --primary:   #ffd60a;
    --accent:    #ffd60a;
    --on-accent: #000814;
    --bg:   #000814;
    --fg-1: #ffffff;
    --fg-2: #ffffff;
    --border-strong: #ffffff;
    --input-border:  #ffffff;
    --focus-ring:    0 0 0 3px #ffd60a;
    --link-rule:     #ffd60a;
    color-scheme: dark;
  }
}

/* ─────────── Surface contract ─────────── */
[data-surface="prose"] { font-size: var(--fs-prose); }
[data-typeface="marketing"] { --font-sans: var(--font-marketing); }

/* ─────────── Base ─────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  line-height: var(--lh-base);
  color: var(--fg-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

::selection { background: var(--accent); color: var(--on-accent); }

/* Links: ink stays fg-1 (AA on every theme); the underline carries --link-rule. */
a {
  color: var(--fg-1);
  text-decoration: underline;
  text-decoration-color: var(--link-rule);
  text-decoration-thickness: var(--bw-hair);
  text-underline-offset: 0.25em;
  transition: text-decoration-thickness var(--dur-fast) var(--ease-precise),
              border-color var(--dur-fast) var(--ease-precise);
}
a:hover { text-decoration-thickness: var(--bw-base); }
a:focus-visible {
  outline: var(--bw-base) solid var(--primary);
  outline-offset: var(--space-1);
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-12));
  padding: var(--space-2) var(--space-4);
  background: var(--bg);
  z-index: 10;
}
.skip:focus { top: var(--space-4); }

/* ─────────── Page rhythm ─────────── */
.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--space-8);
}

.site-head { padding-block: var(--space-7) 0; }

.site-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding-block: var(--space-12);
}

/* Wordmark — the one lime element on the page (lime chip + navy mark, as in landing.html). */
.logo {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.logo svg { display: block; height: var(--space-5); width: auto; fill: currentColor; }

/* ─────────── Hero ─────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-loose);
  text-transform: uppercase;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.eyebrow::before {
  content: "";
  width: var(--space-6);
  height: var(--bw-hair);
  background: currentColor;
}

.headline {
  margin: var(--space-5) 0 0;
  max-width: 11em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(var(--fs-h2), 6vw + 1rem, var(--fs-mkt-display));
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  color: var(--fg-1);
}

.lede {
  margin: var(--space-7) 0 0;
  max-width: 32em;
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  color: var(--fg-1);
}

.body {
  margin: var(--space-3) 0 0;
  max-width: 36em;
  font-size: var(--fs-lg);
  line-height: var(--lh-base);
  color: var(--fg-2);
}

/* Contact rows — every row shares one shape: mono label | value. */
.contact {
  margin: var(--space-9) 0 0;
  max-width: 34rem;
  border-top: var(--bw-hair) solid var(--border-strong);
}
.contact-row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: var(--space-4);
  align-items: baseline;
  padding-block: var(--space-3);
  border-bottom: var(--bw-hair) solid var(--border-strong);
}
.contact dt {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-loose);
  text-transform: uppercase;
  color: var(--fg-2);
}
.contact dd {
  margin: 0;
  min-width: 0;
  font-size: var(--fs-lg);
  overflow-wrap: anywhere;
}

/* Ghost button (404) — verbs only. Never lime: the wordmark holds the lime slot. */
.actions { margin: var(--space-8) 0 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--space-8);
  padding: var(--space-2) var(--space-5);
  border: var(--bw-hair) solid var(--input-border);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--fg-1);
  text-decoration: none;
}
.btn:hover { border-color: var(--fg-1); }

/* ─────────── Footer ─────────── */
.site-foot { border-top: var(--bw-hair) solid var(--border-strong); }
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  padding-block: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal a { display: inline-block; padding-block: var(--space-1); }

/* ─────────── Small screens (down to 320px) ─────────── */
@media (max-width: 640px) {
  .wrap { padding-inline: var(--space-5); }
  .site-head { padding-block: var(--space-5) 0; }
  .site-main { padding-block: var(--space-9); }
  .lede { font-size: var(--fs-lg); }
  .body { font-size: var(--fs-prose); }
  .contact { margin-top: var(--space-8); }
  .contact-row { grid-template-columns: 4rem 1fr; gap: var(--space-3); }
  .contact dd { font-size: var(--fs-prose); }
}

/* ─────────── Preferences ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
/* Forced colours drop backgrounds — keep the wordmark chip legible as an outline. */
@media (forced-colors: active) {
  .logo { border: var(--bw-hair) solid CanvasText; }
}
