/* ---------------------------------------------------------------------------
 * Tilltopps marketing site (#49, DEC-092).
 *
 * The palette, gradients and type scale are the app's design system translated
 * to CSS — the same values as `App/Sources/DesignSystem/Theme.swift` and the
 * colorsets under `App/Assets/Assets.xcassets/` (NightSky, CardDark,
 * CardHairline, TextOnDark*, the `night` gradient, the FR-065 tier colors), so
 * the page and the app read as one product. Every color below is a token on
 * `:root`; nothing in the rules is an ad-hoc literal.
 *
 * Layout is deliberately not the generic app-page shape (centered headline +
 * floating phone on the right): the artwork carries the emotion, the copy
 * stays plain, and the numbers are real (docs/research/landing-page-competitors.md).
 * --------------------------------------------------------------------------- */

:root {
  /* NightSky colorset: red 0.055 green 0.082 blue 0.141 */
  --night: #0e1524;
  /* Theme.Gradients.night: (0.05,0.09,0.18) → (0.12,0.2,0.38) */
  --night-top: #0d172e;
  --night-bottom: #1f3361;

  /* CardDark colorset: 0.078/0.114/0.180 at alpha 0.94 */
  --card: rgba(20, 29, 46, 0.94);
  --card-solid: #141d2e;
  /* CardHairline: white at 0.08 */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  /* TextOnDarkStrong / TextOnDark / TextOnDarkFaint: white at 0.9 / 0.6 / 0.4 */
  --ink: rgba(255, 255, 255, 0.9);
  --ink-mid: rgba(255, 255, 255, 0.66);
  --ink-soft: rgba(255, 255, 255, 0.52);
  --ink-faint: rgba(255, 255, 255, 0.38);

  /* SurfaceOnDark* / SurfaceOnDarkEmphasized: white at 0.05 / 0.08 / 0.12 */
  --surface-faint: rgba(255, 255, 255, 0.05);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.12);

  /* The one warm accent: the amber band the paintings are lit with, and the
   * app's `pro` yellow family. Text on it is NightSky, never white. */
  --amber: #f0a95c;
  --amber-deep: #d98b34;
  --on-amber: #16110a;

  /* MountainTier colors (FR-065) — the catalogue band's tier dots. */
  --tier-hills: #34c759;
  --tier-low: #2fc4c4;
  --tier-high: #4a9df0;
  --tier-alpine: #a86ff0;
  --tier-legendary: #f0544a;

  /* Theme.Spacing (2 4 8 12 16 20 24 32 40 64) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-16: 64px;
  --s-24: 96px;

  /* Theme.Radius (8 12 16 24) */
  --r-1: 8px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 24px;

  --measure: 62ch;
  --shell: 1180px;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

/* Self-hosted, latin subset only, hashed filenames: this page has no
 * third-party request in it at all (no analytics, no font CDN), and a font
 * file that changes is a new URL, never a stale edge copy. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fraunces-latin-48282a41.woff2) format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/inter-latin-c9407645.woff2) format("woff2");
}

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

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  /* The house night gradient, under everything; the sections that carry
   * artwork paint over it. */
  background-image: linear-gradient(180deg, var(--night-top) 0%, var(--night) 42%, var(--night) 100%);
  background-attachment: fixed;
}

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

a {
  color: inherit;
}

/* ------------------------------------------------------------------ type */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  /* Fraunces is a variable font with an `opsz` axis (9–144) and `wght`
   * (100–900): the sizes here sit in the display range, so let the font pick
   * its own optical size rather than pinning an axis by hand. */
  font-optical-sizing: auto;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.6rem);
}

h2 {
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
}

h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  max-width: var(--measure);
}

.lead {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-mid);
}

/* An eyebrow label — the app's `.caption` role, uppercase + tracked. */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 var(--s-4);
}

/* A number set in the display face, tabular so columns line up. */
.num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------- structure */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

section {
  padding-block: clamp(var(--s-16), 9vw, var(--s-24));
}

.stack > * + * {
  margin-top: var(--s-5);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--s-4);
  top: var(--s-4);
  z-index: 20;
  background: var(--amber);
  color: var(--on-amber);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-1);
}

/* ------------------------------------------------------------------- nav */

.nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  padding-block: var(--s-5);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.wordmark svg {
  flex: none;
}

.nav-links {
  display: flex;
  gap: var(--s-6);
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-mid);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
}

.nav-links .btn {
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .nav-links a:not(.btn) {
    display: none;
  }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 600;
  font-size: 1.02rem;
  padding: var(--s-4) var(--s-6);
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease;
}

.btn:hover,
.btn:focus-visible {
  background: #f7bd7c;
  transform: translateY(-1px);
}

.btn-quiet {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.btn-quiet:hover,
.btn-quiet:focus-visible {
  background: var(--surface-strong);
  color: var(--ink);
}

/* The line under a CTA that answers "what does this cost me" — every good
 * competitor page has one (Strava's four free-lines, Everesting's voucher). */
.cta-note {
  font-size: 0.88rem;
  color: var(--ink-faint);
  margin-top: var(--s-4);
}

/* ------------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: min(100svh, 940px);
  display: flex;
  align-items: flex-end;
  padding-block: clamp(var(--s-16), 12vh, 140px) clamp(var(--s-10), 7vh, var(--s-24));
  isolation: isolate;
  overflow: clip;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}

/* Contrast container for the text that sits over the painting (the same rule
 * as the app's `.textTile()`): the art is decoration, not a text background. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13, 23, 46, 0.72) 0%, rgba(13, 23, 46, 0.2) 34%, rgba(14, 21, 36, 0.86) 78%, var(--night) 100%),
    radial-gradient(120% 80% at 12% 92%, rgba(14, 21, 36, 0.86) 0%, rgba(14, 21, 36, 0) 60%);
}

.hero-inner {
  width: 100%;
}

.hero h1 {
  max-width: 15ch;
}

.hero .lead {
  max-width: 46ch;
  margin-top: var(--s-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  margin-top: var(--s-8);
}

/* The hero's number: the promise stated as a physical quantity. */
.hero-figure {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
}

.hero-figure .num {
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 3.8rem);
  color: var(--amber);
}

.hero-figure .figure-label {
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 30ch;
}

/* ------------------------------------------------- the effort translation */

.translate {
  background: linear-gradient(180deg, var(--night) 0%, var(--night-top) 100%);
}

.translate-grid {
  display: grid;
  gap: clamp(var(--s-8), 5vw, var(--s-16));
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 900px) {
  .translate-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* The arithmetic, shown as arithmetic — the single best construction in the
 * competitor study ("133,390 ft … that's 365 ft per day"). */
.math {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-3);
  overflow: hidden;
  margin-top: var(--s-8);
}

.math-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-5);
  background: var(--card);
  padding: var(--s-5) var(--s-6);
}

.math-row .num {
  font-size: 1.6rem;
  color: var(--amber);
  white-space: nowrap;
}

.math-row .math-label {
  font-size: 0.94rem;
  color: var(--ink-mid);
}

/* ------------------------------------------------------------------ steps */

.steps {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
  counter-reset: step;
  margin-top: var(--s-10);
}

@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-3);
  padding: var(--s-8) var(--s-6) var(--s-6);
  position: relative;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-size: 0.95rem;
  color: var(--amber);
  display: block;
  margin-bottom: var(--s-4);
}

.step h3 {
  margin-bottom: var(--s-3);
}

.step p {
  font-size: 0.98rem;
  color: var(--ink-mid);
}

/* --------------------------------------------------------------- artwork */

.art {
  border-radius: var(--r-4);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--card-solid);
}

.art img {
  width: 100%;
}

.art-caption {
  font-size: 0.86rem;
  color: var(--ink-faint);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--hairline);
  background: var(--card);
}

/* ------------------------------------------------------------- catalogue */

.catalogue {
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night) 60%, var(--night) 100%);
}

.peak-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--s-8);
  font-variant-numeric: tabular-nums;
  /* Fixed layout + the colgroup in the HTML: an auto-layout table cannot shrink
   * below its content's minimum width, and "United Arab Emirates" next to
   * "Hammarbybacken" is wider than a phone. The result was the whole document
   * scrolling sideways — every section on the page shifted left, not just this
   * one, which makes it look like a broken body rather than a wide table. */
  table-layout: fixed;
}

.peak-table col.peak {
  width: 40%;
}

.peak-table col.country {
  width: 30%;
}

.peak-table col.height {
  width: 15%;
}

.peak-table col.days {
  width: 15%;
}

.peak-table caption {
  text-align: left;
  font-size: 0.88rem;
  color: var(--ink-faint);
  padding-bottom: var(--s-4);
}

.peak-table th {
  text-align: left;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--hairline-strong);
}

.peak-table th:last-child,
.peak-table td:last-child {
  text-align: right;
}

.peak-table td {
  padding: var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--hairline);
  vertical-align: baseline;
}

.peak-table tbody tr:hover td {
  background: var(--surface-faint);
}

.peak-name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.peak-name .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.peak-country {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.peak-height {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 600;
}

.peak-days {
  font-size: 0.88rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  margin-top: var(--s-6);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.tier-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-hills { background: var(--tier-hills); }
.dot-low { background: var(--tier-low); }
.dot-high { background: var(--tier-high); }
.dot-alpine { background: var(--tier-alpine); }
.dot-legendary { background: var(--tier-legendary); }

@media (max-width: 760px) {
  /* The days column is the one that can go; the other three get its room.
   * The <col> must be hidden too — with table-layout: fixed a col keeps its
   * width even when every cell in it is display:none, which left a 15 % gap
   * on the right of the table. */
  .peak-table col.days,
  .peak-table .col-days {
    display: none;
  }

  .peak-table col.peak {
    width: 42%;
  }

  .peak-table col.country {
    width: 33%;
  }

  .peak-table col.height {
    width: 25%;
  }

  .peak-table th,
  .peak-table td {
    padding-inline: var(--s-3);
  }

  /* "8,849 m" breaking onto two lines read as two numbers. */
  .peak-height {
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------- split bands */

.split {
  display: grid;
  gap: clamp(var(--s-8), 5vw, var(--s-16));
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split.flip > .art {
    order: 2;
  }
}

.split ul {
  list-style: none;
  padding: 0;
  margin: var(--s-6) 0 0;
  display: grid;
  gap: var(--s-4);
}

.split ul li {
  color: var(--ink-mid);
  font-size: 1rem;
  padding-left: var(--s-6);
  position: relative;
}

.split ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 1px;
  background: var(--amber);
}

.split ul li strong {
  color: var(--ink);
  font-weight: 600;
}

/* -------------------------------------------------------------------- faq */

.faq {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border-block: 1px solid var(--hairline);
  margin-top: var(--s-8);
}

.faq details {
  background: var(--night);
}

.faq summary {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  padding: var(--s-5) var(--s-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s-5);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--amber);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > p {
  padding: 0 var(--s-2) var(--s-6);
  color: var(--ink-mid);
  font-size: 1rem;
}

/* ---------------------------------------------------------------- final cta */

.final {
  position: relative;
  isolation: isolate;
  text-align: center;
  overflow: clip;
}

.final .hero-art img {
  object-position: 50% 40%;
}

.final .hero-scrim {
  background:
    radial-gradient(90% 90% at 50% 40%, rgba(14, 21, 36, 0.55) 0%, rgba(14, 21, 36, 0.9) 70%),
    linear-gradient(180deg, var(--night) 0%, rgba(14, 21, 36, 0.35) 40%, var(--night) 100%);
}

.final-inner {
  display: grid;
  justify-items: center;
  gap: var(--s-5);
}

.final h2 {
  max-width: 18ch;
}

/* ----------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--s-10);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5) var(--s-8);
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  margin-left: auto;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ink);
}

/* ------------------------------------------------------- simple text pages */

.prose {
  max-width: 74ch;
  margin-inline: auto;
}

.prose h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  margin-bottom: var(--s-6);
}

.prose h2 {
  font-size: 1.4rem;
  margin-top: var(--s-10);
  margin-bottom: var(--s-3);
}

.prose p + p,
.prose ul {
  margin-top: var(--s-4);
}

.prose ul {
  padding-left: var(--s-5);
  color: var(--ink-mid);
}

.prose a {
  color: var(--amber);
}

/* ------------------------------------------------------------- share page */

.share-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-4);
  padding: var(--s-10);
  text-align: center;
}

.share-kind {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
}

.share-id {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink-soft);
  word-break: break-all;
  margin-top: var(--s-3);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:hover,
  .btn:focus-visible {
    transform: none;
  }
}
