/* Ebbline concept. Sand and sea-ink, one tide teal, one coral for the shallows. */
:root {
  --sand: #ECE7DC;
  --paper: #F5F1E8;
  --ink: #1C2A2C;
  --muted: #55625F;
  --line: #D4CDBF;
  --tide: #1F6B66;
  --tide-ink: #F4F0E6;
  --coral: #B4492F;
  --coral-soft: rgba(180, 73, 47, .12);
  --deep: #142224;
  --deep-2: #1B2E30;
  --deep-fg: #E6E2D6;
  --deep-muted: #A3B2AC;
  --deep-tide: #6CC0B0;
  --deep-coral: #E58A6C;
  --shadow: 0 1px 0 rgba(28, 42, 44, .04), 0 18px 40px -18px rgba(28, 42, 44, .28), 0 40px 80px -40px rgba(28, 42, 44, .22);
  --sans: 'Familjen Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Azeret Mono', ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--tide); outline-offset: 3px; border-radius: 6px; }

/* Reading progress, a thin tide line along the top */
.progress { position: fixed; inset: 0 0 auto; height: 3px; background: var(--tide); transform-origin: 0 50%; transform: scaleX(0); z-index: 20; display: none; }

.banner {
  background: var(--deep);
  color: var(--deep-fg);
  font: 400 13px/1.5 var(--sans);
  padding: 9px var(--gutter);
  text-align: center;
}
.banner b { font-weight: 600; }
.banner span { color: var(--deep-muted); white-space: nowrap; }
.banner span::before { content: '· '; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--sand) 86%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: -.03em; color: var(--ink); }
.mark svg { width: 30px; height: 30px; color: var(--tide); }
.jump {
  font-weight: 500; font-size: 15px; text-decoration: none;
  padding: 9px 16px; border-radius: 99px;
  background: var(--ink); color: var(--paper);
  transition: background .2s;
}
.jump:hover { background: var(--tide); }

/* Hero: copy beside a working app window */
.hero {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(56px, 8vw, 112px);
  display: grid; gap: clamp(32px, 5vw, 64px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
}
.kicker { font: 500 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--tide); margin-bottom: 20px; }
h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: .98; letter-spacing: -.035em; margin-bottom: 24px; }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); max-width: 46ch; margin-bottom: 24px; }
.try { font: 500 14px/1.5 var(--mono); color: var(--ink); padding-left: 16px; border-left: 2px solid var(--tide); max-width: 40ch; }

.app {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 0 0 20px;
  min-width: 0;
}
.app-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.app-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-title em { font-style: normal; font-weight: 400; color: var(--muted); }
.app-tag { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 5px 9px; white-space: nowrap; }

.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 18px 6px; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.label { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.big { font: 600 clamp(28px, 3.2vw, 40px)/1.1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); transition: color .3s; width: fit-content; }
.sub { font-size: 14px; color: var(--muted); }
.stat:first-child .big { view-transition-name: low-num; }
.stat:last-child .big { view-transition-name: under-num; }
.app.is-wet .big { color: var(--coral); }

.chart { position: relative; height: clamp(190px, 24vw, 280px); margin: 14px 18px 46px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grid line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 4; }
.shallows { fill: var(--coral-soft); }
.floor { stroke: var(--coral); stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.line { fill: none; stroke: var(--tide); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.line, .area { transition: d .7s cubic-bezier(.3, .7, .2, 1); }
.no-anim .line, .no-anim .area, .no-anim .mark-low { transition: none; }
.floor-label { position: absolute; right: 0; transform: translateY(40%); font: 500 11px/1 var(--mono); color: var(--coral); padding: 3px 0 3px 6px; }
.mark-low {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--tide);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--tide) 16%, transparent);
  view-transition-name: low-mark;
}
.app.is-wet .mark-low { border-color: var(--coral); box-shadow: 0 0 0 6px var(--coral-soft); }
.months { position: absolute; left: 0; right: 0; bottom: -26px; height: 14px; }
.months i { position: absolute; font: 500 11px/1 var(--mono); font-style: normal; color: var(--muted); letter-spacing: .06em; }

.whatifs { padding: 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 18px; margin: 0 0 10px; }
.whatifs button {
  display: flex; align-items: center; gap: 12px; text-align: left;
  font: 500 14px/1.3 var(--sans); color: var(--ink);
  background: var(--sand); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; cursor: pointer; min-height: 48px;
  transition: background .2s, border-color .2s;
}
.whatifs button:hover { border-color: color-mix(in srgb, var(--tide) 40%, var(--line)); }
.whatifs button[aria-pressed="true"] { background: color-mix(in srgb, var(--tide) 9%, var(--paper)); border-color: var(--tide); }
.sw { flex: none; position: relative; width: 30px; height: 18px; border-radius: 99px; background: var(--line); transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px rgba(28, 42, 44, .25); transition: transform .2s cubic-bezier(.3, .7, .2, 1); }
[aria-pressed="true"] .sw { background: var(--tide); }
[aria-pressed="true"] .sw::after { transform: translateX(12px); }
.nojs { padding: 12px 18px 0; color: var(--muted); font-size: 14px; }

/* View Transitions: only the marker and the two numbers are captured; the rest stays live. */
:root { view-transition-name: none; }
::view-transition-group(low-mark),
::view-transition-group(low-num),
::view-transition-group(under-num) { animation-duration: .7s; animation-timing-function: cubic-bezier(.3, .7, .2, 1); }
::view-transition-old(low-num), ::view-transition-old(under-num) { animation: num-out .35s ease-in both; }
::view-transition-new(low-num), ::view-transition-new(under-num) { animation: num-in .45s .15s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes num-out { to { opacity: 0; transform: translateY(-40%); filter: blur(3px); } }
@keyframes num-in { from { opacity: 0; transform: translateY(40%); filter: blur(3px); } }

/* The explainer: dark water, a pinned chart, steps that scroll past */
.explain { background: var(--deep); color: var(--deep-fg); }
.explain-inner { max-width: 1240px; margin: 0 auto; padding: clamp(64px, 9vw, 128px) var(--gutter); }
.explain-head { font-size: clamp(30px, 4vw, 52px); line-height: 1.05; max-width: 16ch; margin-bottom: clamp(32px, 5vw, 64px); }
.explain-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; timeline-scope: --s1, --s2, --s3; }
.explain-chart {
  position: sticky; top: calc(50svh - 190px); order: 2;
  background: var(--deep-2); border: 1px solid rgba(230, 226, 214, .1); border-radius: 20px;
  padding: 22px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5);
}
.explain-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ex-area { fill: rgba(108, 192, 176, .12); }
.ex-line { fill: none; stroke: var(--deep-tide); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.ex-dots .in { fill: var(--deep-tide); }
.ex-dots .out { fill: var(--deep-coral); opacity: .85; }
.ex-shallows { fill: rgba(229, 138, 108, .14); }
.ex-floor { stroke: var(--deep-coral); stroke-width: 3; stroke-dasharray: 12 9; }
.ex-note { margin-top: 16px; font-size: 15px; color: var(--deep-muted); }
.ex-note b { font: 500 13px/1 var(--mono); color: var(--deep-coral); margin-right: 6px; }

.steps { list-style: none; margin: 0; padding: 0; order: 1; }
.step { min-height: 72svh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px 0; }
.step:first-child { min-height: 52svh; justify-content: flex-start; }
.step[data-step="1"] { view-timeline-name: --s1; }
.step[data-step="2"] { view-timeline-name: --s2; }
.step[data-step="3"] { view-timeline-name: --s3; }
.num { font: 500 13px/1 var(--mono); color: var(--deep-tide); letter-spacing: .1em; }
.step h3 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; max-width: 18ch; }
.step p:last-child { color: var(--deep-muted); max-width: 44ch; font-size: 18px; }

/* Made for, and never */
.made { max-width: 1240px; margin: 0 auto; padding: clamp(64px, 9vw, 128px) var(--gutter) clamp(40px, 5vw, 64px); }
.made h2, .never h2, .early h2 { font-size: clamp(30px, 4vw, 52px); line-height: 1.05; }
.made h2 { max-width: 18ch; margin-bottom: clamp(28px, 4vw, 48px); }
.made-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.made-grid article { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px 30px; }
.made-grid h3 { font-size: 21px; margin-bottom: 10px; }
.made-grid h3::before { content: ''; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--tide); margin-bottom: 22px; }
.made-grid p { color: var(--muted); }

.never { max-width: 1240px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) var(--gutter); }
.never-inner { border-top: 1px solid var(--line); padding-top: clamp(32px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; }
.never ul { list-style: none; margin: 0; padding: 0; }
.never li { padding: 16px 0 16px 34px; border-bottom: 1px solid var(--line); position: relative; font-size: 18px; }
.never li::before { content: ''; position: absolute; left: 0; top: 27px; width: 18px; height: 2px; background: var(--coral); border-radius: 2px; }

.early { padding: clamp(56px, 8vw, 112px) var(--gutter) clamp(64px, 9vw, 128px); }
.early-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.early h2 { margin-bottom: 16px; }
.early-inner > p { color: var(--muted); margin: 0 auto 32px; max-width: 46ch; }
.early-form { text-align: left; max-width: 520px; margin: 0 auto; }
.early-form label { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 8px; }
.early-form .row { display: flex; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 6px; box-shadow: var(--shadow); }
.early-form input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 16px/1 var(--sans); color: var(--ink); padding: 0 14px; }
.early-form input::placeholder { color: color-mix(in srgb, var(--muted) 80%, var(--paper)); }
.early-form input:focus { outline: none; }
.early-form .row:focus-within { outline: 2px solid var(--tide); outline-offset: 3px; }
.early-form button { font: 600 15px/1 var(--sans); border: 0; border-radius: 99px; padding: 14px 20px; background: var(--tide); color: var(--tide-ink); white-space: nowrap; cursor: not-allowed; }

.foot { border-top: 1px solid var(--line); padding: 28px var(--gutter) 40px; max-width: 1240px; margin: 0 auto; color: var(--muted); font-size: 14px; display: grid; gap: 8px; }
.foot a { color: var(--ink); }

/* Motion, only when asked for and supported. Without it every layer is simply shown. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .progress { display: block; animation: grow linear both; animation-timeline: scroll(root); }
    @keyframes grow { to { transform: scaleX(1); } }

    .ex-dots circle { animation: dot-in linear both; animation-timeline: --s1; animation-range: entry 40% contain 30%; transform-box: fill-box; transform-origin: center; }
    .ex-line { stroke-dashoffset: 1; animation: draw linear both; animation-timeline: --s2; animation-range: entry 30% contain 40%; }
    .ex-area { animation: fade-in linear both; animation-timeline: --s2; animation-range: contain 10% contain 45%; }
    .ex-floor, .ex-shallows, .ex-note { animation: fade-in linear both; animation-timeline: --s3; animation-range: entry 40% contain 30%; }
    .ex-dots circle { animation-name: dot-in; }
    @keyframes dot-in { from { opacity: 0; transform: scale(.2); } }
    @keyframes draw { to { stroke-dashoffset: 0; } }
    @keyframes fade-in { from { opacity: 0; } }

    .step > * { animation: step-focus linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    @keyframes step-focus { 0% { opacity: .3; translate: 0 24px; } 35%, 65% { opacity: 1; translate: 0 0; } 100% { opacity: .3; } }

    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    .made-grid .reveal:nth-child(2) { animation-range: entry 10% entry 70%; }
    .made-grid .reveal:nth-child(3) { animation-range: entry 20% entry 80%; }
    @keyframes rise { from { opacity: 0; translate: 0 32px; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .line, .area, .big, .sw, .sw::after, .whatifs button, .jump { transition: none; }
}

/* Tablet and phone */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 640px; }
  .explain-grid { grid-template-columns: 1fr; }
  .explain-chart { order: 0; top: 76px; z-index: 2; padding: 14px; }
  .ex-note { font-size: 13px; margin-top: 10px; }
  .step, .step:first-child { min-height: 60svh; justify-content: center; }
  .made-grid { grid-template-columns: 1fr; }
  .never-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .banner span { display: block; white-space: normal; }
  .banner span::before { content: none; }
  .whatifs { grid-template-columns: 1fr; }
  .readout { gap: 8px; }
  .app-tag { display: none; }
  .early-form .row { flex-direction: column; border-radius: 18px; }
  .early-form input { padding: 12px 10px; }
  .early-form button { width: 100%; }
  .step p:last-child { font-size: 17px; }
}
