/* Aquafern — aquafern.app
   ─────────────────────────────────────────────────────────────────────────────
   Concept: a lab record of water, submerged.

   Aquafern is a measurement app, so the site is built like a specimen sheet —
   monospace figure labels, hairline rules, tabular figures, a real parameter
   reference table — rather than a marketing page. The background descends from
   surface light to deep water as you scroll.

   Deliberately NOT: centred hero, three icon cards in a row, two pricing cards
   floating side by side, gradient blobs. That is the layout everything defaults
   to, and it reads as a default.

   Dark only. The app is light/dark adaptive because an app should be; a brand
   gets to pick one. Light phone screenshots on a near-black page also glow,
   which is the whole reason Linear and Raycast do it.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* Depth. Surface at the top of the page, deep water at the bottom. */
  --surface-0: #0a1a16;   /* shallow */
  --surface-1: #06120f;   /* mid — the page's base */
  --surface-2: #030b09;   /* deep */
  --raised:    #0d1f1a;

  /* Contrast against --surface-1, measured not guessed. */
  --ink:       #eaf2ee;   /* 16.7 : 1 */
  --ink-2:     #93aaa1;   /*  7.7 : 1 */
  --ink-3:     #6f8b81;   /*  5.2 : 1 — mono labels */
  --ink-4:     #5a736a;   /*  3.7 : 1 — dimmest legible */

  --accent:    #3fd9a0;   /* 10.6 : 1 */
  --accent-dim:#1d6f52;
  --caution:   #d49e28;
  --alert:     #e06152;

  --rule:      rgba(234, 242, 238, 0.10);
  --rule-soft: rgba(234, 242, 238, 0.06);

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --maxw: 1240px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface-1);
  /* The descent. Fixed, so it reads as one continuous body of water rather
     than repeating per section. */
  background-image: linear-gradient(180deg,
    var(--surface-0) 0%,
    var(--surface-1) 38%,
    var(--surface-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain. A large flat dark field without it looks like a dead pixel plane. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-underline-offset: 3px; }

img { max-width: 100%; height: auto; display: block; }

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
}

/* ───────────────────────────────────────────────────────── figure labels ── */
/* The device that makes the page read as a record rather than an advert. */

.fig {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.fig::after {
  content: "";
  flex: 1;
  min-width: 1.5rem;
  height: 1px;
  background: var(--rule-soft);
}

/* Without this the label itself becomes a shrinkable flex item and breaks as
   "FIG. / 04" on narrow screens. */
.fig b {
  color: var(--accent);
  font-weight: 500;
  flex: none;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────── header ── */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in srgb, var(--surface-1) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand svg { width: 25px; height: 25px; border-radius: 7px; }

nav.site {
  margin-left: auto;
  display: flex;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav.site a { color: var(--ink-3); text-decoration: none; transition: color .15s; }
nav.site a:hover { color: var(--ink); }

/* The in-page anchors overflow a phone. Drop them and keep the one link that
   goes somewhere else — a hamburger for five same-page jumps isn't worth it. */
@media (max-width: 800px) {
  nav.site a[href^="#"] { display: none; }
  nav.site { gap: 1rem; }
}

/* ───────────────────────────────────────────────────────────────── hero ── */

.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 0;
  overflow: hidden;
}

/* A real trend line, drawn at architectural scale behind the type. */
.hero-line {
  position: absolute;
  inset: auto 0 0 0;
  height: 76%;
  width: 100%;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.hero .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 3rem);
  align-items: end;
}

@media (min-width: 940px) {
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.6rem, 6.4vw, 4.8rem);
  line-height: 0.97;
  letter-spacing: -0.042em;
  font-weight: 600;
  text-wrap: balance;
}

h1 em { font-style: normal; color: var(--accent); }

.lede {
  margin: 0 0 2rem;
  max-width: 40ch;
  font-size: clamp(1.02rem, 1.5vw, 1.14rem);
  color: var(--ink-2);
}

/* ─────────────────────────────────────────────────────────────── buttons ── */

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}

.btn-primary { background: var(--accent); color: #04140f; }
.btn-primary:hover { background: #5ce9b3; transform: translateY(-1px); }

.btn-ghost { color: var(--ink-2); border-color: var(--rule); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-4); }

.meta {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}

/* ───────────────────────────────────────────────────────── device stack ── */
/* Overlapped and tilted, bleeding past the right edge — not a tidy centred row. */

.stack {
  position: relative;
  height: clamp(400px, 52vw, 600px);
}

.stack .shot {
  position: absolute;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  background: #fff;
}

.stack .shot img { border-radius: inherit; }

.stack .s1 { width: 50%; left: 0;     bottom: 0;   transform: rotate(-4deg); z-index: 1; }
.stack .s2 { width: 56%; left: 27%;   bottom: 10%; z-index: 3; }
.stack .s3 { width: 50%; right: -12%; bottom: 4%;  transform: rotate(4deg);  z-index: 2; }

/* The shots are absolutely positioned from the bottom, so if the container is
   shorter than a phone the phone grows *upward* into the copy above it. Height
   here has to stay ≥ the tallest shot: width × 2868/1320, plus its offset. */
@media (max-width: 939px) {
  .stack {
    height: clamp(430px, 112vw, 560px);
    margin-top: 1.5rem;
  }
  .stack .s1 { width: 44%; }
  .stack .s2 { width: 50%; left: 26%; bottom: 8%; }
  .stack .s3 { width: 44%; right: -18%; }
}

/* ────────────────────────────────────────────────────────────── marquee ── */
/* The parameter set, moving. Shows breadth in a way a bullet list can't. */

.marquee {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  border-block: 1px solid var(--rule-soft);
  padding: 1.1rem 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: slide 46s linear infinite;
}

.marquee span {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
}

.marquee span i { font-style: normal; color: var(--accent-dim); }

@keyframes slide { to { transform: translateX(-50%); } }

/* ───────────────────────────────────────────────────────────── sections ── */

section { padding: clamp(4rem, 10vw, 7.5rem) 0; }

h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.8rem, 3.6vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.032em;
  font-weight: 600;
  text-wrap: balance;
}

h3 { margin: 0 0 0.5rem; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1.1rem; }

.prose { max-width: 62ch; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }

/* Asymmetric split: a big display figure against a column of text. */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); }
  .split.flip > *:first-child { order: 2; }
}

.figure-number {
  font-size: clamp(4.5rem, 12vw, 9rem);
  line-height: 0.82;
  letter-spacing: -0.06em;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.figure-number small {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.inline-shot {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #fff;
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.8);
}

/* A full 6.9" capture at column width is ~1200 px tall and swamps the section.
   Crop from the top instead — the charts are what matters, not the tab bar. */
.inline-shot img {
  max-height: clamp(420px, 62vw, 660px);
  width: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ─────────────────────────────────────────────────────── the spec table ── */
/* Real reference data. Genuinely useful, and no template has one. */

.spec { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

.spec caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding-bottom: 0.9rem;
}

.spec th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 0 0 0.7rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.spec td {
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
  vertical-align: baseline;
}

.spec td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.spec td.num { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); white-space: nowrap; }
.spec th:not(:first-child), .spec td:not(:first-child) { padding-left: 1.25rem; }
.spec tr:hover td { color: var(--ink); }

.table-scroll { overflow-x: auto; }

/* ────────────────────────────────────────────────────────────── ledger ── */
/* Pricing as a ledger of what each tier includes — not two floating cards. */

.ledger { border-top: 1px solid var(--rule); margin-top: 2rem; }

.ledger-row {
  display: grid;
  grid-template-columns: 1fr 5rem 5rem;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: center;
  color: var(--ink-2);
}

.ledger-row.head {
  border-bottom-color: var(--rule);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.ledger-row span:not(:first-child) { text-align: center; }
.ledger-row .yes { color: var(--accent); }
.ledger-row .no { color: var(--ink-4); }

.ledger-row.total {
  border-bottom: none;
  padding-top: 1.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}

.ledger-row.total .price { font-family: var(--mono); font-size: 0.86rem; color: var(--accent); }

/* ─────────────────────────────────────────────────────────── statement ── */

.statement {
  font-size: clamp(1.55rem, 3.4vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: -0.028em;
  font-weight: 600;
  max-width: 22ch;
  margin: 0 0 1.4rem;
}

.statement em { font-style: normal; color: var(--accent); }

/* ──────────────────────────────────────────────────────────── articles ── */

article { max-width: 66ch; }
article h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.6rem; }
article h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-top: 2.8rem; }
article h2:first-of-type { margin-top: 0; }
article h3 { margin-top: 1.8rem; color: var(--ink); }
article p, article li { color: var(--ink-2); }
article strong { color: var(--ink); font-weight: 600; }
article ul { padding-left: 1.1rem; }
article li { margin-bottom: 0.5rem; }

.updated {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  margin-bottom: 2.4rem;
}

dl.faq { margin: 0; }

dl.faq dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 1.9rem;
  padding-top: 1.9rem;
  border-top: 1px solid var(--rule-soft);
}

dl.faq dt:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
dl.faq dd { margin: 0.5rem 0 0; color: var(--ink-2); }

/* ────────────────────────────────────────────────────────── press bits ── */

.press-shots { margin: 1.75rem 0; display: flex; gap: 1rem; }

.press-shots .shot {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #fff;
}

.icon-sample { width: 108px; height: 108px; border-radius: 24px; }

/* ────────────────────────────────────────────────────────────────── 404 ── */

.notfound { min-height: 54vh; display: grid; place-content: center; }

/* ─────────────────────────────────────────────────────────────── footer ── */

footer.site {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3.5rem;
  margin-top: 3rem;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  text-transform: uppercase;
}

footer.site nav { margin-left: auto; display: flex; gap: 1.5rem; flex-wrap: wrap; }
footer.site a { color: var(--ink-3); text-decoration: none; }
footer.site a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
