/* Zone 7 Studios - "Water" hub design system (v115).
   Dark pool at night: WebGL water behind everything (assets/water.js), content
   on dark glass panels and feathered scrims above it. Dependency-free, system
   fonts, no frameworks. Used by index.html and more.html only; every other
   page keeps assets/style.css.

   WCAG 2.2 AA contract (proven numerically by tools/wcag-contrast.py):
   - The shader clamps its final fragment colour to S_MAX = 0.62 per channel,
     so the worst-case backdrop anywhere behind the page is rgb(158.1,158.1,158.1).
   - Text never sits on open water: it sits on one of the surfaces below, and
     each (text colour, surface composited over the S_MAX backdrop) pair is
     proven >= 4.5:1 by the checker. Surfaces:
       --scrim      rgba(3,9,11,.72)  feathered panes (hero, section heads, studio)
       --glass      rgba(5,13,15,.80) cards / principles / earlybar
       --glass-nav  rgba(3,9,11,.82)  sticky nav bar
       --glass-foot rgba(3,9,11,.85)  footer band
       pause chip   rgba(3,9,11,.88), skip chip rgba(3,9,11,.95)
     Pane/scrim text is inset >= 1.25rem from the pane edge, so the feathered
     box-shadow edge never sits behind text; the interior alpha is exact.
   - Focus indicator is a dual ring: light outline #dff7ef over a dark
     box-shadow ring rgba(3,10,12,.92). The light ring is >= 3:1 against every
     panel/scrim surface, the dark ring is >= 3:1 against open S_MAX water,
     and the rings are ~16:1 against each other, so the indicator is visible
     on any backdrop (1.4.11 + 2.4.7).
   - The no-WebGL / no-JS fallback background (on body, below) never exceeds
     channel ~0x30, darker than S_MAX everywhere, so the same proofs cover it. */

:root {
  --bg: #030809;
  --ink: #eaf2f1;
  --dim: #a9bec0;
  --faint: #93a9a7;
  --hi: #9fe8d8;
  --btn-ink: #05201f;
  --line: rgba(203, 232, 226, 0.14);
  --line2: rgba(203, 232, 226, 0.24);
  --scrim: rgba(3, 9, 11, 0.72);
  --glass: rgba(5, 13, 15, 0.80);
  --glass-nav: rgba(3, 9, 11, 0.82);
  --glass-foot: rgba(3, 9, 11, 0.85);
  --chip: rgba(213, 240, 234, 0.08);
  --focus-l: #dff7ef;
  --focus-d: rgba(3, 10, 12, 0.92);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; color-scheme: dark; }
html, body { overflow-x: hidden; overflow-x: clip; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  /* Static water: the pre-JS and no-WebGL ground. Max channel ~0x30 << S_MAX. */
  background:
    radial-gradient(130% 95% at 78% 4%, rgba(10, 36, 48, 0.55), transparent 60%),
    radial-gradient(110% 85% at 15% 96%, rgba(6, 26, 24, 0.62), transparent 64%),
    linear-gradient(180deg, #04090c 0%, #030708 55%, #020505 100%);
  background-color: var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #9fe8d8; color: #05201f; }

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Water canvas + veil (decorative, behind everything) ---- */
#gl {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  display: block; pointer-events: none; z-index: 0;
}
.veil {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 7, 8, 0.34), rgba(2, 7, 8, 0) 24%,
    rgba(2, 7, 8, 0) 58%, rgba(1, 4, 5, 0.52));
}
nav.site, main, footer { position: relative; z-index: 1; }

/* ---- Skip link (2.4.1): first focusable, visible on focus ---- */
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  transform: translateY(-300%);
  padding: 0.8em 1.2em; border-radius: 12px;
  background: rgba(3, 9, 11, 0.95); color: var(--ink);
  border: 1px solid var(--line2);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em;
  transition: transform 0.15s ease;
}
.skip:focus { transform: none; }

/* ---- Focus (2.4.7 / 2.4.11): dual ring, visible on any backdrop ---- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-l);
  outline-offset: 2px;
  box-shadow: 0 0 0 8px var(--focus-d);
  border-radius: 8px;
}
.app-card:focus-visible { border-radius: 22px; }
.earlybar:focus-visible { border-radius: 16px; }
.btn:focus-visible, .water-toggle:focus-visible, .skip:focus-visible { border-radius: 999px; }

/* ---- Nav ---- */
nav.site {
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  background: var(--glass-nav);
  border-bottom: 1px solid var(--line);
}
nav.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 300; letter-spacing: 4px; font-size: 1.02rem; color: var(--ink);
  padding: 4px 2px;
}
.brand b { font-weight: 600; }
.brand-sub { font-weight: 400; letter-spacing: 3px; font-size: 0.62em; color: var(--faint); margin-left: 9px; }
.navlinks { display: flex; gap: 18px; font-size: 0.9rem; }
.navlinks a {
  color: var(--dim); transition: color 0.15s;
  display: inline-block; padding: 8px 6px; border-radius: 8px;
}
.navlinks a:hover { color: var(--ink); }

/* ---- Nav logo mark ---- */
.logo-7 { width: 34px; height: 34px; flex: none; }
.logo-7 .sats { transform-box: view-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .logo-7 .sats { transition: transform 2.4s cubic-bezier(0.22, 1, 0.36, 1); }
  .brand:hover .logo-7 .sats { transform: rotate(1turn); }
}

/* ---- Early Access bar ---- */
.earlybar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  position: relative; z-index: 1;
  width: calc(100% - 48px); max-width: 1080px; margin: 14px auto 0;
  padding: 12px 24px; text-align: center; font-size: 0.9rem; color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(213, 240, 234, 0.06);
  transition: border-color 0.15s;
}
.earlybar:hover { border-color: var(--line2); }
.earlybar-tag {
  font-weight: 700; letter-spacing: 1px; font-size: 0.7rem;
  text-transform: uppercase; color: var(--hi);
}
.earlybar-cta { font-weight: 700; color: var(--ink); }
.earlybar:hover .earlybar-cta { text-decoration: underline; }
@media (max-width: 560px) {
  .earlybar { border-radius: 18px; padding: 10px 14px; font-size: 0.8125rem; }
  .earlybar-tag { display: none; }
  .earlybar-cta { flex-basis: 100%; text-align: center; }
}

/* ---- Feathered scrim panes (the computable text ground on open water) ---- */
.pane {
  position: relative; isolation: isolate;
  background: var(--scrim);
  border-radius: 28px;
  box-shadow: 0 0 64px 32px var(--scrim), inset 0 1px 0 rgba(213, 240, 234, 0.05);
  padding: 2rem 2.2rem;
}
.sechead { max-width: 640px; margin-bottom: 2.4rem; padding: 1.5rem 1.9rem; }

/* ---- Hero ---- */
.hero { min-height: 88svh; display: flex; align-items: center; padding: 5rem 0 4rem; }
.hero .wrap { width: 100%; }
.hero-pane { max-width: 660px; padding: 2.6rem 2.8rem; }
.kicker {
  color: var(--faint); letter-spacing: 0.42em; font-size: 0.75rem;
  text-transform: uppercase; margin-bottom: 1.6rem;
}
.kicker::before {
  content: ""; display: inline-block; width: 2.4rem; height: 1px;
  background: linear-gradient(90deg, var(--hi), transparent);
  margin-right: 1rem; vertical-align: middle; opacity: 0.75;
}
.hero h1 {
  font-weight: 200; font-size: clamp(2.8rem, 9vw, 5.2rem);
  letter-spacing: clamp(6px, 2.6vw, 15px); line-height: 1.06;
  text-shadow: 0 2px 44px rgba(80, 160, 150, 0.16);
}
.hero h1 b { font-weight: 500; }
.studios {
  color: var(--dim); font-weight: 300; font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  letter-spacing: clamp(8px, 3vw, 17px);
  margin: 0.3rem 0 1.7rem;
}
.hero .tag {
  color: var(--dim); font-size: clamp(1rem, 3vw, 1.25rem); font-weight: 350;
  max-width: 40ch; margin-bottom: 1.4rem; line-height: 1.65;
}
.trustline { color: var(--faint); font-size: 0.9rem; letter-spacing: 0.6px; margin-bottom: 2rem; }

/* Hero entrance (JS only, off under reduced motion) */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html.js .hero-pane > * { opacity: 0; animation: fadeUp 0.9s ease forwards; }
html.js .hero-pane > .kicker { animation-delay: 0.15s; }
html.js .hero-pane > h1 { animation-delay: 0.3s; }
html.js .hero-pane > .studios { animation-delay: 0.45s; }
html.js .hero-pane > .tag { animation-delay: 0.7s; }
html.js .hero-pane > .trustline { animation-delay: 0.85s; }
html.js .hero-pane > .btn-row { animation-delay: 1.0s; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 0.95rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, #c9f2e6, #93e2d1);
  color: var(--btn-ink);
  box-shadow: 0 10px 40px rgba(159, 232, 216, 0.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 50px rgba(159, 232, 216, 0.34); }
.btn-ghost {
  background: rgba(6, 15, 17, 0.55);
  border: 1px solid rgba(223, 245, 240, 0.6);
  color: var(--ink);
  padding: calc(0.95rem - 1px) calc(1.5rem - 1px);
}
.btn-ghost:hover { transform: translateY(-2px); background: rgba(10, 24, 26, 0.7); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---- Sections ---- */
section { padding: 5.5rem 0; }
#apps, #ethos, #studio, #more, #main { scroll-margin-top: 6.5rem; }
section h2, #more h1 {
  font-weight: 550; font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.02em; margin-bottom: 0.5rem;
}
section .sub { color: var(--dim); font-weight: 350; max-width: 54ch; }

/* ---- App cards: dark glass, hairline catch-light, accent reflections ---- */
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 16px; }
.app-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  padding: 30px 28px 26px;
  box-shadow: inset 0 1px 0 rgba(213, 240, 234, 0.05);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.25, 1), border-color 0.45s ease;
}
/* The mark's small coloured reflection. Geometry: card padding 30px top /
   28px left, mark 46px tall, so the reflection band sits at y 82-91px, i.e.
   in the margin under the mark, at most touching the ink .name (proven pair);
   it never reaches the .kind or body copy. */
.app-card::before {
  content: ""; position: absolute; top: 82px; left: 32px; width: 40px; height: 9px;
  background: radial-gradient(50% 100% at 50% 0%, var(--a), transparent 75%);
  opacity: 0.16; filter: blur(3px); pointer-events: none;
}
/* Accent reflection rising from the waterline at the card's foot (worst-case
   wash over the panel is proven for dim / .ea / .go text in the checker). */
.app-card::after {
  content: ""; position: absolute; left: -20%; right: -20%; bottom: -45%; height: 70%;
  background: radial-gradient(55% 60% at 50% 100%, var(--a), transparent 70%);
  opacity: 0.10; transition: opacity 0.6s ease; pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .app-card:hover { transform: translateY(-4px); border-color: var(--line2); }
  .app-card:hover::after { opacity: 0.14; }
}
.card-ethereal { --a: #7b9eff; }
.card-brume { --a: #8fa7bd; }
.card-baton { --a: #e8c25b; }
.card-sylph { --a: #9b8fd6; }
.card-lore { --a: #5eead4; }
.card-cork { --a: #d98e57; }
.card-bead { --a: #6f9dff; }
.card-sandglass { --a: #f2c071; }
.card-sconce { --a: #ffc46b; }
.card-bevel { --a: #6fb2e6; }
.card-slate { --a: #aeb8c2; }
.app-card .mark { width: 46px; height: 46px; margin-bottom: 16px; }
.app-card .name { font-weight: 300; letter-spacing: 4px; font-size: 1.3rem; color: var(--ink); }
.app-card .name b { font-weight: 600; }
.app-card .kind {
  color: var(--faint); font-size: 0.7rem; letter-spacing: 3px;
  text-transform: uppercase; margin: 4px 0 14px;
}
.app-card p { color: var(--dim); font-size: 0.92rem; font-weight: 350; margin-bottom: 18px; }
.app-card .meta {
  margin-top: auto; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.app-card .ea {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 7px;
  background: var(--chip); color: var(--ink);
}
.app-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.app-card .go { font-size: 0.85rem; font-weight: 600; color: var(--hi); transition: color 0.15s; }
.app-card:hover .go { color: var(--ink); }
.app-card.static { cursor: default; }
.app-card.static:hover { transform: none; }
.app-card .price { font-size: 0.85rem; font-weight: 600; color: var(--dim); }

/* ---- Principles ---- */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.principle {
  background: var(--glass); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px 24px 22px;
  box-shadow: inset 0 1px 0 rgba(213, 240, 234, 0.05);
}
.principle h3 { font-weight: 600; font-size: 1.05rem; letter-spacing: 0.3px; margin-bottom: 8px; }
.principle p { color: var(--dim); font-size: 0.92rem; font-weight: 350; }

/* ---- About the studio ---- */
.studio-pane { max-width: 720px; }
#studio .about { color: var(--dim); max-width: 58ch; margin: 0.6rem 0 2rem; font-weight: 350; font-size: 1.02rem; }

/* ---- Scroll reveals (JS only; everything visible without JS) ---- */
html.js .rv { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.19, 0.8, 0.26, 1); }
html.js .rv.on { opacity: 1; transform: none; }
html.js .apps.rv .app-card { opacity: 0; transform: translateY(24px); }
html.js .apps.rv.on .app-card {
  opacity: 1; transform: none;
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.19, 0.8, 0.26, 1);
  transition-delay: calc(var(--i, 0) * 0.05s);
}
html.js .apps.rv.on.settled .app-card {
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.25, 1), border-color 0.45s ease;
  transition-delay: 0s;
}

/* ---- more.html: promo films, store badge ---- */
.promo { margin-top: 18px; }
.promo video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #000; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
/* The <video> fallback sentence holds a link: underline it (1.4.1). */
.promo video a { text-decoration: underline; }
.promo .note {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline;
  justify-content: flex-start; margin: 10px 0 0;
  color: var(--dim); font-size: 0.82rem; font-weight: 350;
}
.promo .note a { color: var(--hi); text-decoration: underline; padding: 4px 2px; display: inline-block; }
.promo .note a:hover { color: var(--ink); }
.app-card .promo { margin: 2px 0 18px; }
.store-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 16px 0 0; }
.play-badge { display: block; height: 80px; width: auto; margin: 4px 0; }
.store-row .tf-note { margin: 4px 0; max-width: 30ch; font-size: 0.85rem; line-height: 1.45; color: var(--dim); }
.sechead-tail { margin: 26px 0 0; max-width: 640px; padding: 1.1rem 1.9rem; }
/* The pane supplies the 26px gap; the byte-preserved inline margin would double it. */
.sechead-tail .sub { margin-top: 0 !important; }

/* ---- Footer ---- */
footer {
  background: var(--glass-foot);
  border-top: 1px solid var(--line);
  padding: 3rem 0 2.6rem; color: var(--dim); font-size: 0.85rem;
}
footer .wrap { display: flex; flex-direction: column; gap: 14px; }
footer a { color: var(--dim); }
footer a:hover { color: var(--ink); }
/* The mailto sits inline in the copyright sentence: underline it (1.4.1). */
footer .wrap > div:first-child a { text-decoration: underline; }
.footlinks { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: baseline; }
.footlinks a { display: inline-block; padding: 8px 6px; margin: -6px 0; border-radius: 8px; }
footer .legal-note { color: var(--faint); font-size: 0.78rem; font-weight: 350; max-width: 52ch; }

/* ---- Pause control (2.2.2): fixed, real button, constant name ---- */
.water-toggle {
  position: fixed; right: 14px; bottom: 14px; z-index: 60;
  display: inline-flex; align-items: center; gap: 0.55em;
  font: inherit; font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--ink);
  padding: 0.55em 1.1em; min-height: 28px;
  border: 1px solid var(--line2); border-radius: 999px;
  background: rgba(3, 9, 11, 0.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  cursor: pointer;
}
.water-toggle::before {
  content: ""; width: 0.5em; height: 0.5em; border-radius: 50%;
  background: var(--hi); opacity: 0.9;
}
.water-toggle[aria-pressed="true"]::before { opacity: 0.5; }
.water-toggle[aria-pressed="true"] { border-color: var(--line); }
.water-toggle:hover { border-color: var(--hi); }
html.no-gl .water-toggle { display: none !important; }

/* ---- Reduced motion: no entrance motion, no reveals, no smooth scroll ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .hero-pane > * { animation: none; opacity: 1; }
  html.js .rv, html.js .apps.rv .app-card { opacity: 1; transform: none; transition: none; }
  .app-card, .app-card:hover, .btn:hover { transform: none; }
  .logo-7 .sats { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
html.rm.js .hero-pane > * { animation: none; opacity: 1; }
html.rm.js .rv, html.rm.js .apps.rv .app-card { opacity: 1; transform: none; transition: none; }

/* ---- Small screens (reflow 1.4.10: single column, no sideways scroll) ---- */
@media (max-width: 640px) {
  nav.site .wrap {
    height: auto; min-height: 56px; flex-wrap: wrap; justify-content: center;
    column-gap: 18px; padding-top: 6px; padding-bottom: 2px;
  }
  .navlinks { flex-wrap: wrap; justify-content: center; gap: 0 8px; font-size: 0.8rem; }
  html { scroll-padding-top: 8.5rem; }
  #apps, #ethos, #studio, #more, #main { scroll-margin-top: 8.5rem; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { min-height: 76svh; padding: 3.5rem 0 3rem; }
  .hero-pane { padding: 1.7rem 1.4rem; }
  .pane { border-radius: 22px; }
  .sechead { padding: 1.2rem 1.4rem; }
  section { padding: 4rem 0; }
  .water-toggle { right: 10px; bottom: 10px; }
  /* Keep the fixed pause chip clear of the footer links (2.4.11). */
  footer { padding-bottom: 5.5rem; }
}
@media (max-width: 380px) {
  .apps { grid-template-columns: 1fr; }
}
