/* Tide family theme on top of scrollcraft.css. Tokens first, then page classes. */
:root {
  --sc-canvas: #07141a;
  --sc-surface: #0d2027;
  --sc-ink: #e3f1ef;
  --sc-ink-soft: #93b3b5;
  --sc-accent: #54d6c5;
  --sc-accent-ink: #062024;
  --sc-font-display: "Zilla Slab", Georgia, serif;
  --sc-font-text: "IBM Plex Sans", system-ui, sans-serif;
  --sc-font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --sc-shadow-color: 190 60% 3%;
  --tide: 0;
}
:root[data-app="tide"]    { --sc-accent: #8ba1ff; --sc-accent-ink: #0a1030; }
:root[data-app="mail"]    { --sc-accent: #e8b45f; --sc-accent-ink: #241703; }
:root[data-app="ftp"]     { --sc-accent: #54d6c5; }
:root[data-app="dock"]    { --sc-accent: #5cbce6; --sc-accent-ink: #04202e; }

body { font-family: var(--sc-font-text); }
.mono { font-family: var(--sc-font-mono); }
.sc-display { font-weight: 700; }
em { font-style: italic; }

/* ---------- site bar ---------- */
.site-bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sc-4);
  padding: var(--sc-4) var(--sc-gutter);
  background: linear-gradient(180deg, color-mix(in oklab, var(--sc-canvas) 88%, transparent), transparent);
}
.mark { font-family: var(--sc-font-display); font-weight: 700; font-size: 1.35rem; color: var(--sc-ink); text-decoration: none; letter-spacing: -0.01em; }
.mark span { color: var(--sc-accent); font-weight: 500; margin-right: 0.25em; }
.site-bar nav { display: flex; align-items: center; gap: var(--sc-5); font-size: var(--sc-t-sm); }
.site-bar nav a:not(.btn) { color: var(--sc-ink-soft); text-decoration: none; }
.site-bar nav a:not(.btn):hover { color: var(--sc-ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; white-space: nowrap;
  font-family: var(--sc-font-mono); font-weight: 500; font-size: var(--sc-t-sm);
  padding: 0.8em 1.3em; border-radius: var(--sc-r-md);
  color: var(--sc-ink); text-decoration: none;
  border: 1px solid var(--sc-hairline-strong); background: color-mix(in oklab, var(--sc-surface) 80%, transparent);
  transition: transform var(--sc-d-fast) var(--sc-ease-out), border-color var(--sc-d-fast) var(--sc-ease-out), background var(--sc-d-fast) var(--sc-ease-out);
}
.btn:hover { border-color: var(--sc-accent); }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--sc-accent); color: var(--sc-accent-ink); border-color: var(--sc-accent); font-weight: 600; box-shadow: var(--sc-e2), var(--sc-edge); }
.btn--primary:hover { background: color-mix(in oklab, var(--sc-accent) 88%, white); }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- hero: five planes ---------- */
.hero .sc-stage { background: var(--sc-canvas); overflow: hidden; }
.plane { position: absolute; left: 0; right: 0; pointer-events: none; }
.plane--plate { inset: -6% 0 -6% 0; }
.plane--plate img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; display: block; }
.plane--hue { inset: 0; mix-blend-mode: soft-light; opacity: 0.55; background: var(--sc-accent); }
.plane--sea-far { bottom: 24%; height: clamp(5rem, 11vw, 10rem); }
.plane--screen { bottom: 8%; left: auto; right: var(--sc-gutter); width: min(58vw, 62rem); }
.plane--sea-near { bottom: 0; height: clamp(4rem, 9vw, 8rem); }
.plane--fog { inset: auto 0 0 0; height: 40%; background: linear-gradient(0deg, var(--sc-canvas) 6%, transparent); }
.plane svg { display: block; width: 100%; height: 100%; }
.wave-far path { fill: color-mix(in oklab, var(--sc-accent) 10%, var(--sc-canvas)); }
.wave-near path { fill: color-mix(in oklab, var(--sc-accent) 6%, var(--sc-canvas)); }
.wave-drift { animation: drift 26s linear infinite; }
.wave-drift--slow { animation-duration: 40s; animation-direction: reverse; }
@keyframes drift { to { transform: translateX(-50%); } }
.wave-svg { width: max(200%, 1800px); }

.screen-frame {
  border-radius: var(--sc-r-md); overflow: hidden;
  border: 1px solid var(--sc-hairline-strong);
  box-shadow: var(--sc-e3), 0 0 0 1px color-mix(in oklab, var(--sc-accent) 10%, transparent);
  background: #0a1418; line-height: 0;
}
.screen-frame img { width: 100%; height: auto; display: block; }

.hero .sc-copy { left: var(--sc-gutter); right: auto; top: clamp(6rem, 20vh, 12rem); bottom: auto; max-width: 40rem; z-index: 30; }
.hero .sc-display { text-shadow: 0 2px 30px hsl(190 60% 3% / 0.7); }
.hero .sc-lede { margin-top: var(--sc-5); max-width: 32rem; color: var(--sc-ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--sc-3); margin-top: var(--sc-6); }

/* ---------- tension ---------- */
.tension { min-height: 100svh; display: grid; align-content: center; padding-block: var(--sc-9); }
.tension .sc-display { max-width: 15ch; }
.tension .sc-display--lg { font-size: clamp(2.6rem, 1.2rem + 6.4vw, 6.4rem); line-height: 0.98; }
.tension .aside { margin-top: var(--sc-7); max-width: 34rem; color: var(--sc-ink-soft); font-size: var(--sc-t-lg); }
.tension .strike { color: var(--sc-ink-soft); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--sc-accent); }

/* ---------- peak: keys ---------- */
.keys .sc-stage { display: grid; place-items: center; background: transparent; }
.keys .k-item { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: var(--sc-7); padding-inline: var(--sc-gutter); max-width: var(--sc-maxw); margin-inline: auto; }
.keys .k-glyph { font-family: var(--sc-font-mono); font-weight: 500; font-size: clamp(5rem, 2rem + 16vw, 16rem); line-height: 1; letter-spacing: -0.04em; color: var(--sc-accent); text-align: right; white-space: nowrap; }
.keys .k-glyph small { font-size: 0.42em; letter-spacing: 0; color: var(--sc-ink-soft); }
.keys h2 { font-size: var(--sc-t-2xl); }
.keys .sc-body { margin-top: var(--sc-4); font-size: var(--sc-t-lg); color: var(--sc-ink-soft); }
.keys .k-lead { position: absolute; top: clamp(5.5rem, 12vh, 8rem); left: var(--sc-gutter); }

/* ---------- range: rail ---------- */
.rail { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 4rem); height: 100%; padding-inline: var(--sc-gutter); width: max-content; }
.rail__lead { flex: 0 0 min(30rem, 78vw); }
.rail__end { flex: 0 0 min(26rem, 78vw); }
.app { flex: 0 0 clamp(20rem, 42vw, 40rem); }
.app h3 { font-family: var(--sc-font-display); font-size: var(--sc-t-2xl); margin: var(--sc-5) 0 0; color: var(--app-hue); }
.app .instead { font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); color: var(--sc-ink-soft); margin-top: var(--sc-1); }
.app p { margin: var(--sc-3) 0 0; color: var(--sc-ink-soft); max-width: 36ch; }
.app a.go { display: inline-block; margin-top: var(--sc-4); color: var(--app-hue); font-family: var(--sc-font-mono); font-size: var(--sc-t-sm); text-underline-offset: 4px; }
.app .screen-frame { border-color: color-mix(in oklab, var(--app-hue) 40%, transparent); }
.app .noshot { aspect-ratio: 1698 / 926; display: grid; place-items: center; padding: var(--sc-5); line-height: 1.6; text-align: left; font-family: var(--sc-font-mono); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); background: #0a1418; }
.app .noshot b { color: var(--app-hue); font-weight: 500; }

/* ---------- proof ---------- */
.proof { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: var(--sc-8); align-items: center; }
.proof-cols { display: grid; gap: var(--sc-6); margin-top: var(--sc-7); }

/* ---------- copy box ---------- */
.cmd { display: flex; align-items: stretch; max-width: 100%; border-radius: var(--sc-r-md); overflow: hidden; border: 1px solid var(--sc-hairline-strong); background: #081419; box-shadow: var(--sc-e2), var(--sc-edge); }
.cmd code { font-family: var(--sc-font-mono); font-size: var(--sc-t-sm); padding: 0.9em 1.1em; color: var(--sc-ink); overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.cmd code::before { content: "$ "; color: var(--sc-accent); }
.cmd button { font: inherit; font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); color: var(--sc-accent); background: transparent; border: 0; border-left: 1px solid var(--sc-hairline); padding: 0 1.1em; cursor: pointer; transition: background var(--sc-d-fast) var(--sc-ease-out); }
.cmd button:hover { background: color-mix(in oklab, var(--sc-accent) 12%, transparent); }
.cmd button:active { transform: scale(0.97); }
.cmd-label { font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); color: var(--sc-ink-soft); margin: var(--sc-5) 0 var(--sc-2); letter-spacing: 0.04em; }

/* ---------- close ---------- */
.close .sc-stage { display: grid; place-items: center; text-align: center; background: transparent; }
.close__inner { position: relative; z-index: 20; display: grid; gap: var(--sc-6); justify-items: center; padding-inline: var(--sc-gutter); max-width: 60rem; }
.close .cmd { width: min(46rem, 100%); text-align: left; }
.close .cta-row { justify-content: center; margin-top: 0; }
.foot { position: absolute; z-index: 20; inset: auto 0 0 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sc-3); padding: var(--sc-5) var(--sc-gutter); font-size: var(--sc-t-xs); color: var(--sc-ink-soft); }
.foot a { color: var(--sc-ink-soft); }
.close .spot { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(38rem 26rem at var(--sc-mx, 50%) var(--sc-my, 45%), color-mix(in oklab, var(--sc-accent) 14%, transparent), transparent 70%); }

/* ---------- app pages ---------- */
.idea { padding-block: var(--sc-9) var(--sc-8); }
.idea .sc-lede { max-width: 30ch; font-size: var(--sc-t-2xl); line-height: 1.16; }
.feat-group h3 { font-family: var(--sc-font-display); font-size: var(--sc-t-xl); color: var(--sc-accent); margin: 0 0 var(--sc-4); }
.feat-list { display: grid; gap: var(--sc-5); margin: 0; padding: 0; list-style: none; }
.feat-list li b { display: block; color: var(--sc-ink); font-weight: 600; }
.feat-list li span { color: var(--sc-ink-soft); }
.kbd { font-family: var(--sc-font-mono); font-size: 0.82em; padding: 0.05em 0.4em; border: 1px solid var(--sc-hairline-strong); border-radius: 4px; color: var(--sc-ink); background: color-mix(in oklab, var(--sc-surface) 90%, transparent); white-space: nowrap; }
.feat-pin .k-glyph { font-size: clamp(3.5rem, 1.5rem + 9vw, 9rem); }
.honest { display: grid; gap: var(--sc-5); max-width: 46rem; margin: var(--sc-7) 0 0; padding: 0; list-style: none; }
.honest li { color: var(--sc-ink-soft); }
.honest li b { color: var(--sc-ink); font-weight: 600; }
.table-wrap { overflow-x: auto; margin-top: var(--sc-6); }
table.cmp { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: var(--sc-t-sm); }
table.cmp th, table.cmp td { padding: 0.7em 0.9em; text-align: center; border-bottom: 1px solid var(--sc-hairline); }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; color: var(--sc-ink); }
table.cmp thead th { color: var(--sc-ink-soft); font-weight: 500; font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); }
table.cmp thead th.me, table.cmp td.me { color: var(--sc-accent); }

/* ---------- tide line (signature) ---------- */
.tideline { position: fixed; inset: auto 0 0 0; height: 100svh; z-index: 2; pointer-events: none; transform: translate3d(0, calc(100% - var(--tide) * 62svh), 0); will-change: transform; }

@media (max-width: 860px) {
  .hero .sc-copy { top: clamp(5rem, 14vh, 8rem); }
  .plane--screen { left: 5vw; right: 5vw; width: auto; bottom: 20%; }
  .plane--plate img { object-position: 55% 60%; }
  .hero .sc-display--xl { font-size: var(--sc-t-2xl); }
  .keys .k-item { grid-template-columns: 1fr; align-content: center; gap: var(--sc-4); }
  .keys .k-glyph { text-align: left; font-size: clamp(4rem, 26vw, 8rem); }
  .proof { grid-template-columns: 1fr; gap: var(--sc-6); }
  .site-bar nav a:not(.btn) { display: none; }
  .tideline { transform: translate3d(0, calc(100% - var(--tide) * 40svh), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .wave-drift,   .tideline { transform: translate3d(0, calc(100% - 0.06 * 50svh), 0); }
}

/* wave containment */
.plane--sea-far, .plane--sea-near { overflow: hidden; }
.tideline__edgewrap .hero .sc-label { color: var(--sc-ink); }

/* tide line: seamless wave edge from a repeating mask, moved by transform */
.tideline__edgewrap { position: absolute; left: 0; right: 0; top: -1.7rem; height: 1.7rem; overflow: hidden; }
.tideline__edgewrap::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: calc(100% + 1200px);
  background: color-mix(in oklab, var(--sc-accent) 15%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 50 c100 -30 200 -30 300 0 s200 30 300 0 s200 -30 300 0 s200 30 300 0 V100 H0 Z'/%3E%3C/svg%3E") 0 0 / 1200px 100% repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 50 c100 -30 200 -30 300 0 s200 30 300 0 s200 -30 300 0 s200 30 300 0 V100 H0 Z'/%3E%3C/svg%3E") 0 0 / 1200px 100% repeat-x;
  animation: edgedrift 24s linear infinite; will-change: transform;
}
@keyframes edgedrift { to { transform: translateX(-1200px); } }
.tideline__body { position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in oklab, var(--sc-accent) 15%, transparent), color-mix(in oklab, var(--sc-accent) 3%, transparent)); }
@media (prefers-reduced-motion: reduce) { .tideline__edgewrap::before { animation: none; } }
.noshot { aspect-ratio: 1698 / 926; display: grid; place-items: center; padding: var(--sc-5); line-height: 1.7; text-align: left; font-family: var(--sc-font-mono); font-size: var(--sc-t-base); color: var(--sc-ink-soft); background: #0a1418; }
.noshot b { color: var(--app-hue, var(--sc-accent)); font-weight: 500; }
.hero .noshot { color: var(--sc-ink); font-size: var(--sc-t-lg); }

/* close section must fit any viewport height: it is pinned, so overflow is clipped and unreachable */
.close__inner { gap: clamp(0.5rem, 2.2vh, 2rem); padding-top: clamp(3.5rem, 9vh, 5rem); padding-bottom: clamp(3rem, 8vh, 4.5rem); }
.close .sc-display--lg { font-size: min(var(--sc-t-3xl), 8.5vh); }
.close .cmd-label { margin: 0; }
.close .sc-body { font-size: clamp(0.85rem, 2vh, 1.05rem); }
@media (max-height: 640px) { .close .sc-body { display: none; } .close .cmd code { padding-block: 0.6em; } }

.mark { display: inline-flex; align-items: center; gap: 0.55rem; }
.mark img { width: 2rem; height: auto; display: block; }
