/* The river is the layout: every section lies on one bank, the river runs on the other and
   crosses in the gaps. Colours are the Eider tokens from crates/eider-core/assets/css/site.css,
   Amtsblau is the only accent, status colours mean status. System fonts only. */
:root {
  color-scheme: light;
  --primary: rgb(0, 104, 177);
  --accent: var(--primary);
  --on-primary: #ffffff;
  --ink: #1a2530;
  --ink-soft: #5b6b7a;
  --line: #dde5ec;
  --line-strong: #7f8e9c;
  --bg: #f2f6f9;
  --surface: #ffffff;
  --surface-3: #eef1f4;
  --green: #1e7f43;
  --green-bg: #e8f6ee;
  --amber-ink: #8a5c00;
  --amber-bg: #fdf4e3;
  --focus-ring: #0068b1;

  /* What the canvas paints, read by landing.js. */
  --water: var(--primary);
  --water-shallow: #2f8fd3;
  --water-deep: #00517f;
  --bed: #d5e7f4;
  --bank: #7f8e9c;
  --stream: #9fb2c2;
  /* The light around Eddi, so a blue trout stands out from blue water. */
  --fish-halo: rgba(255, 255, 255, .95);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-round: 999px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-end: max(16px, env(safe-area-inset-right, 0px));
  --gap: clamp(170px, 15vw, 210px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #58aede;
    --ink: #e7edf3;
    --ink-soft: #97a8b7;
    --line: #2b3946;
    --line-strong: #667a8e;
    --bg: #0f161d;
    --surface: #182230;
    --surface-3: #243244;
    --green: #4ec97f;
    --green-bg: rgba(46, 160, 92, .16);
    --amber-ink: #e0b566;
    --amber-bg: rgba(201, 138, 27, .16);
    --focus-ring: #58aede;
    --bed: #16304a;
    --bank: #667a8e;
    --stream: #4a6073;
    --fish-halo: rgba(231, 237, 243, .8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #58aede;
  --ink: #e7edf3;
  --ink-soft: #97a8b7;
  --line: #2b3946;
  --line-strong: #667a8e;
  --bg: #0f161d;
  --surface: #182230;
  --surface-3: #243244;
  --green: #4ec97f;
  --green-bg: rgba(46, 160, 92, .16);
  --amber-ink: #e0b566;
  --amber-bg: rgba(201, 138, 27, .16);
  --focus-ring: #58aede;
  --bed: #16304a;
  --bank: #667a8e;
  --stream: #4a6073;
  --fish-halo: rgba(231, 237, 243, .8);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  overflow-x: clip;
}

h1, h2, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
}
.skip:focus { top: 12px; }

/* On the page, not fixed: it scrolls with the text, and landing.js keeps it around the reader. */
.river {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

/* Header */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  margin-inline: auto;
  padding-block: 20px;
  padding-left: var(--gutter);
  padding-right: var(--gutter-end);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font: 600 20px/1 var(--font-display);
  text-decoration: none;
}

.top__nav { display: flex; gap: 8px; margin-left: auto; }

.top__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  text-decoration: none;
}
.top__nav a:hover { color: var(--ink); background: var(--surface-3); }

/* Buttons */

.button, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding-inline: 22px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-round);
  background: var(--primary);
  color: var(--on-primary);
  font: 600 16px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease;
}
.button:hover { transform: translateY(-1px); }

.button--ghost, .ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.ghost { min-height: 44px; padding-inline: 16px; font-size: 14px; font-weight: 500; }
.button--small { min-height: 44px; padding-inline: 16px; font-size: 14px; }

/* Stage */

.stage {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-end);
  padding-bottom: 120px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: .01em;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  padding-top: clamp(16px, 4vw, 48px);
}

h1 {
  font: 700 clamp(58px, 9.2vw, 124px)/.94 var(--font-display);
  letter-spacing: -.035em;
  text-wrap: balance;
}
h1 span { color: var(--accent); }

.lead {
  max-width: 34em;
  margin-top: 28px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.note { margin-top: 18px; color: var(--ink-soft); font-size: 14px; }

.sources { min-width: 0; }

.sources__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 6px;
  text-align: center;
  font-size: clamp(11px, 1.05vw, 14px);
  line-height: 1.3;
}
.sources__list b { display: block; font-weight: 600; }
.sources__list span { color: var(--ink-soft); font-family: var(--font-mono); font-size: .9em; }

.sources__art { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }

.stream { fill: none; stroke: var(--stream); stroke-width: 5; stroke-linecap: round; }
.stream--a { stroke-dasharray: 14 12; }
.stream--b { stroke-dasharray: 2 11; }
.stream--c { stroke-dasharray: 28 10; }
.stream--d { stroke-dasharray: 6 8 20 8; }
.stream--e { stroke-dasharray: 10 16; }

.confluence { fill: var(--water); }

@media (prefers-reduced-motion: no-preference) {
  .stream { animation: flow 2.4s linear infinite; }
  .stream--b { animation-duration: 1.7s; }
  .stream--c { animation-duration: 3.1s; }
  .stream--d { animation-duration: 2s; }
  .stream--e { animation-duration: 2.7s; }
}

@keyframes flow { to { stroke-dashoffset: -84; } }

/* Reaches: the sections on the banks */

.reach { display: flex; margin-top: var(--gap); }
.hero + .reach { margin-top: clamp(150px, 16vw, 200px); }
.reach[data-river="left"] { justify-content: flex-end; }

.reach__body { width: min(660px, 60%); min-width: 0; }
.reach__body > p:not(.eyebrow, .claim, .note) { margin-top: 14px; max-width: 34em; }

h2 {
  font: 700 clamp(32px, 4.2vw, 54px)/1.04 var(--font-display);
  letter-spacing: -.025em;
  text-wrap: balance;
}

.claim {
  margin-top: 26px;
  color: var(--accent);
  font: 600 clamp(22px, 2.4vw, 30px)/1.2 var(--font-display);
  letter-spacing: -.015em;
}

/* Sign-in demo */

.demo {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.demo__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.demo__who { font-size: 15px; font-weight: 500; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.tiles li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.tiles li span { display: block; font-size: 13px; font-weight: 400; }

.tiles.is-open li {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.tiles.is-open li:nth-child(2) { transition-delay: 80ms; }
.tiles.is-open li:nth-child(3) { transition-delay: 160ms; }
.tiles.is-open li:nth-child(4) { transition-delay: 240ms; }
.tiles.is-open li:nth-child(5) { transition-delay: 320ms; }

.demo__note { margin-top: 12px; color: var(--ink-soft); font-size: 13px; }

/* Facts */

.facts { display: grid; gap: 0; margin-top: 22px; }
.facts div { padding-block: 14px; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { color: var(--ink-soft); font-size: 16px; }

/* Gauge: a staff gauge drawn to scale, 0 to 128 MB */

.gauge {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 24px;
}

.staff {
  position: relative;
  height: 400px;
  width: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background:
    repeating-linear-gradient(to top, var(--ink) 0 3.125%, transparent 3.125% 6.25%) left / 50% 100% no-repeat,
    var(--surface);
}

.staff__water {
  position: absolute;
  inset: auto 0 0;
  height: 23.4375%;
  background: var(--water);
  opacity: .82;
}

.staff__mark {
  position: absolute;
  left: 100%;
  width: 150px;
  padding-left: 10px;
  transform: translateY(50%);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.staff__mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  border-top: 1.5px solid var(--line-strong);
}
.staff__mark b { color: var(--ink); font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.staff__mark--128 { bottom: 100%; }
.staff__mark--30 { bottom: 23.4375%; }
.staff__mark--11 { bottom: 8.59375%; }

.reads { display: grid; align-content: center; gap: 20px; }
.reads b {
  display: block;
  font: 600 clamp(30px, 3.2vw, 40px)/1.05 var(--font-mono);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.reads span { color: var(--ink-soft); font-size: 15px; line-height: 1.4; }

/* Services */

.services { margin-top: 22px; }

.services li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding-block: 13px;
  border-top: 1px solid var(--line);
}
.services li:last-child { border-bottom: 1px solid var(--line); }
.services b { font-weight: 600; }
.services div span { display: block; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }

.pill {
  padding: 5px 11px;
  border-radius: var(--radius-round);
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
}
.pill--done { background: var(--green-bg); color: var(--green); }
.pill--work { background: var(--amber-bg); color: var(--amber-ink); }

/* Route */

.route { margin-top: 24px; }

.route li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding-block: 11px;
  border-top: 1px dashed var(--line-strong);
}
.route li:first-child { border-top: 0; }
.route__done, .route__now { border-top-style: solid !important; border-top-color: var(--line) !important; }

.route time, .route__when {
  padding-top: 2px;
  color: var(--ink-soft);
  font: 500 13px/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.route b { font-weight: 600; }
.route div span { display: block; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }

.route__now {
  margin-inline: -14px;
  padding-inline: 14px;
  border-radius: 10px;
  background: var(--amber-bg);
}
.route__now .route__when { color: var(--amber-ink); font-weight: 600; }
.route__now + li { border-top-color: transparent; }

/* The sea */

.sea {
  position: relative;
  z-index: 1;
  margin-top: 60px;
  background: var(--primary);
  color: var(--on-primary);
}

.sea__edge {
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px);
  display: block;
  width: 100%;
  height: 40px;
  max-width: none;
  fill: var(--primary);
}

.sea__body {
  max-width: 1280px;
  margin-inline: auto;
  padding-block: 64px 56px;
  padding-left: var(--gutter);
  padding-right: var(--gutter-end);
}

.sea__big {
  margin-bottom: 14px;
  font: 700 clamp(38px, 6vw, 76px)/1 var(--font-display);
  letter-spacing: -.03em;
}
.sea__links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 14px; }
.sea__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-primary); }

/* Eddi in the river. eddi.css draws him, these rules only move him. */

.eddi-dock.fish {
  position: absolute;
  left: 0;
  right: auto;
  top: 0;
  z-index: 3;
  --eddi-size: 108px;
  transition: opacity .25s ease;
  pointer-events: none;
}
.fish.is-gone { opacity: 0; }
.fish .eddi-shadow { display: none; }
.fish .eddi {
  transform: scaleX(var(--fish-dir, 1)) rotate(var(--fish-tilt, 0deg));
  filter: drop-shadow(0 0 2px var(--fish-halo)) drop-shadow(0 0 7px var(--fish-halo));
}
/* Looking at the mouse: his eyes follow it, so they stop looking around by themselves. */
.fish.is-watching .eddi-pupil { transform: translate(var(--fish-look-x, 0px), var(--fish-look-y, 0px)); }
.fish.is-watching .eddi-pupil-move, .fish.is-watching .eddi-head { animation: none; }
.fish__button { pointer-events: auto; cursor: pointer; touch-action: manipulation; }
.fish.is-gone .fish__button { pointer-events: none; }

.fish__say {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: max-content;
  max-width: 240px;
  margin-bottom: 6px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  transform: translateX(-50%);
}
.fish.say-left .fish__say { left: auto; right: 0; transform: none; }
.fish.say-right .fish__say { left: 0; transform: none; }

/* Where the dug part of the river ends. */

.dig {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  transform: translate(var(--dig-x, 0), var(--dig-y, 0));
}
.dig--before { transform: translate(calc(var(--dig-x, 0px) - 100%), var(--dig-y, 0)); }

/* Phone and upright tablet: there is no room beside the text, so every section is a card and the river runs under the
   cards, with Eddi. It shows wide in the gaps and, on a tablet, at the sides. Above 900 px the section keeps its bank. */

@media (max-width: 900px) {
  :root { --gap: clamp(150px, 32vw, 250px); }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero + .reach { margin-top: var(--gap); }
  .sources { width: 100%; max-width: 560px; margin-inline: auto; }

  /* The gaps of the stage let a tap through to Eddi, who swims below it. */
  .stage { pointer-events: none; }
  .hero > *, .reach__body { pointer-events: auto; }

  .reach, .reach[data-river="left"] { justify-content: center; }
  .reach__body {
    width: 100%;
    max-width: 640px;
    padding: 24px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .gauge { grid-template-columns: minmax(0, 1fr); }
  .staff { height: 320px; }
  .route__now { margin-inline: -8px; padding-inline: 8px; }

  .eddi-dock.fish { --eddi-size: 88px; z-index: 0; }
  .dig { display: none; }
}

/* eddi.css hides him on phones because no corner is free there. Here he needs none, he swims under the cards. */
@media (max-width: 479.98px), (max-height: 479.98px) {
  .eddi-dock.fish:not([hidden]) { display: block; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { gap: 8px; flex-wrap: wrap; }
  .top__nav { order: 3; width: 100%; margin-left: -12px; }
  #theme { margin-left: auto; }
  .route li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .services li { grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: start; }
  .hero__actions .button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tiles li, .button, .fish { transition: none; }
}
