/* Calc84 site styles. One stylesheet for every page, no framework. */

:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --hand: "Bradley Hand", "Noteworthy", "Segoe Print", "Chalkboard SE", cursive;

  --bg: #f6faf9;
  --surface: #ffffff;
  --surface-2: #edf5f3;
  --ink: #14181b;
  --ink-2: #48535a;
  --ink-3: #66727a;
  --line: rgba(20, 24, 27, 0.1);
  --line-strong: rgba(20, 24, 27, 0.16);
  --accent: #0a7a6f;
  --accent-strong: #075e56;
  --btn: #14181b;
  --btn-ink: #ffffff;
  --btn-hover: #2c3237;
  --header-bg: rgba(246, 250, 249, 0.82);

  --hero-a: #d9f1fb;
  --hero-b: #dcf9ea;
  --grid-line: rgba(10, 70, 70, 0.07);
  --wave: #22c3b4;

  --lcd: #c1deca;
  --lcd-ink: #16211b;
  --lcd-dim: #4f6656;

  --band: #1b1f22;
  --band-ink: #eef3f2;
  --band-ink-2: #aab6b4;
  --band-line: rgba(255, 255, 255, 0.1);
  --band-card: rgba(255, 255, 255, 0.045);

  --cta-a: #a4dcf5;
  --cta-b: #9bf1c6;
  --cta-ink: #101416;
  --cta-ink-2: #2d3a3d;

  --shadow-sm: 0 1px 2px rgba(15, 45, 42, 0.06), 0 6px 16px -6px rgba(15, 45, 42, 0.14);
  --shadow: 0 2px 4px rgba(15, 45, 42, 0.06), 0 28px 56px -20px rgba(15, 45, 42, 0.36);

  --radius: 28px;
  --radius-sm: 18px;
  --container: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1112;
    --surface: #131a1b;
    --surface-2: #182122;
    --ink: #e8f0ee;
    --ink-2: #a8b6b3;
    --ink-3: #85938f;
    --line: rgba(232, 240, 238, 0.1);
    --line-strong: rgba(232, 240, 238, 0.18);
    --accent: #5ad8c6;
    --accent-strong: #8ae8da;
    --btn: #e8f0ee;
    --btn-ink: #0c1112;
    --btn-hover: #ffffff;
    --header-bg: rgba(12, 17, 18, 0.8);

    --hero-a: #0d2129;
    --hero-b: #0c231b;
    --grid-line: rgba(160, 240, 225, 0.06);
    --wave: #2fb9a9;

    --lcd: #b3d1bd;

    --band: #111819;
    --band-line: rgba(255, 255, 255, 0.08);

    --cta-a: #0f3441;
    --cta-b: #0f3a2b;
    --cta-ink: #eef6f4;
    --cta-ink-2: #b4c7c3;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 56px -20px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: calc(760px + var(--gutter) * 2);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead {
  color: var(--ink-2);
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
}

.muted {
  color: var(--ink-3);
}

/* ---------- Buttons & badges ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--btn-hover);
  color: var(--btn-ink);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.store-badge {
  display: inline-block;
  border-radius: 12px;
  transition: transform 0.15s ease;
}

.store-badge img {
  width: auto;
  height: 54px;
}

.store-badge:hover {
  transform: translateY(-1px);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  text-decoration: none;
}

.link-arrow::after {
  content: "\2192";
  transition: transform 0.15s ease;
}

.link-arrow:hover {
  text-decoration: none;
}

.link-arrow:hover::after {
  transform: translateX(3px);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
}

@media (max-width: 640px) {
  .nav-links .nav-optional {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero,
.page-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, var(--hero-a), var(--hero-b));
}

.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 65% 35%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 75% at 65% 35%, #000 25%, transparent 78%);
}

.hero-wave {
  position: absolute;
  left: 0;
  top: 52%;
  z-index: -1;
  width: 100%;
  min-width: 900px;
  height: 300px;
  transform: translateY(-50%);
  color: var(--wave);
  opacity: 0.3;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(44px, 6vw, 88px) clamp(52px, 7vw, 96px);
}

.hero-icon {
  width: 84px;
  height: 84px;
  margin-bottom: 26px;
  border-radius: 19px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 14px 30px -12px rgba(10, 60, 60, 0.45);
}

.hero h1 {
  font-size: clamp(2.5rem, 1.55rem + 3.6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.hero .lead {
  max-width: 32em;
  margin-top: 22px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 34px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.93rem;
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-meta strong {
  color: var(--ink);
}

.star {
  color: #f5a524;
  font-size: 1.05em;
  line-height: 1;
}

/* Store screenshots 1 and 2 are one panorama split across two frames.
   They stay two images, spaced like the App Store (20px gap per 230px of width). */
.hero-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 4.17%;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
}

.hero-shots img {
  width: 100%;
  border-radius: clamp(12px, 1.6vw, 19px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  letter-spacing: -0.03em;
}

.section-head .lead {
  margin-top: 18px;
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head-row .section-head {
  margin-bottom: 0;
}

/* ---------- Feature cards ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-wide {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 44px);
  align-items: center;
}

.card h3 {
  margin-top: 18px;
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem);
  letter-spacing: -0.025em;
}

.card-copy > p {
  margin-top: 12px;
  color: var(--ink-2);
}

.card-visual {
  margin-top: auto;
  padding-top: 24px;
}

.card-wide .card-visual {
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 980px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .card-wide {
    grid-template-columns: minmax(0, 1fr);
  }
}

.checks {
  display: grid;
  gap: 9px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
  font-size: 0.97rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.7 7.2-5.5 6a1 1 0 0 1-1.4.1L5.3 11a1 1 0 1 1 1.4-1.4l1.7 1.6 4.8-5.3a1 1 0 1 1 1.5 1.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.7 7.2-5.5 6a1 1 0 0 1-1.4.1L5.3 11a1 1 0 1 1 1.4-1.4l1.7 1.6 4.8-5.3a1 1 0 1 1 1.5 1.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.badge-new {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font: 500 0.78rem/1.4 var(--mono);
  white-space: nowrap;
}

.chips-label {
  margin: 20px 0 10px;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Calculator keys ---------- */

.keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4em;
  height: 2.25em;
  padding: 0 0.75em;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.6em;
  background: linear-gradient(#f4f6f7, #d9dde0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 0 rgba(0, 0, 0, 0.14),
    0 2px 5px -1px rgba(0, 0, 0, 0.18);
  color: #1d2124;
  font: 700 0.78rem/1 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.key-dark {
  border-color: rgba(0, 0, 0, 0.5);
  background: linear-gradient(#454b51, #2c3136);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    0 2px 5px -1px rgba(0, 0, 0, 0.3);
  color: #f2f5f6;
}

.key-blue {
  background: linear-gradient(#b0d7f3, #86bbe6);
  color: #0f2233;
}

.key-lime {
  background: linear-gradient(#c3e554, #9fcd12);
  color: #1c2600;
}

.key-sep {
  color: var(--ink-3);
  font-size: 0.95rem;
}

.lcd-chip {
  display: inline-flex;
  align-items: center;
  height: 2.25em;
  padding: 0 0.7em;
  border-radius: 0.5em;
  background: var(--lcd);
  color: var(--lcd-ink);
  font: 600 0.78rem/1 var(--mono);
}

/* ---------- Calculator screens (illustrations in the app's style) ---------- */

.bezel {
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(#383d42, #25292d);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lcd {
  border-radius: 14px;
  background: var(--lcd);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.07),
    inset 0 3px 10px rgba(0, 0, 0, 0.1);
  color: var(--lcd-ink);
  font-family: var(--mono);
}

.lcd-calc {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.lcd-calc .in {
  text-align: left;
}

.lcd-calc .out {
  text-align: right;
}

.lcd-calc .rule {
  height: 1px;
  margin: 6px -16px;
  background: rgba(22, 33, 27, 0.14);
}

.lcd-calc .label {
  color: var(--lcd-dim);
  font-size: 0.75rem;
}

.frac {
  display: inline-grid;
  vertical-align: middle;
  text-align: center;
  line-height: 1.15;
}

.frac > span + span {
  border-top: 1.5px solid currentColor;
}

.graph-screen {
  overflow: hidden;
  border-radius: 16px;
  background: #fbfcfd;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.graph-screen svg {
  width: 100%;
  height: auto;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #f1f4f6;
  color: #33393e;
  font: 600 0.78rem/1.4 var(--mono);
}

.graph-legend .y1 {
  color: #2767c9;
}

.graph-legend .y2 {
  color: #c93a3a;
}

.lcd-menu {
  padding: 12px 8px 10px;
  font-size: clamp(0.84rem, 0.8rem + 0.2vw, 0.95rem);
}

.lcd-tabs {
  display: flex;
  gap: 4px;
  margin: 0 8px 8px;
  font-weight: 700;
}

.lcd-tabs span {
  padding: 1px 8px;
  border-radius: 4px;
  color: var(--lcd-dim);
}

.lcd-tabs .on {
  background: var(--lcd-ink);
  color: var(--lcd);
}

.lcd-menu ol {
  padding: 0;
  list-style: none;
  counter-reset: menu;
}

.lcd-menu li {
  padding: 1px 8px;
  border-radius: 4px;
  counter-increment: menu;
  line-height: 1.55;
  white-space: nowrap;
}

.lcd-menu li::before {
  content: counter(menu) ":";
  font-weight: 700;
}

.lcd-menu li:first-child {
  background: var(--lcd-ink);
  color: var(--lcd);
}

/* Math OCR illustration */
.ocr-demo {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.ocr-paper {
  width: min(100%, 340px);
  padding: 26px 22px 22px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(transparent 0 31px, rgba(70, 130, 200, 0.22) 31px 32px),
    #fffdf7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 18px 34px -18px rgba(0, 0, 0, 0.4);
  color: #1c3d7a;
  font: 400 clamp(1.5rem, 1.25rem + 1vw, 1.9rem) / 1.2 var(--hand);
  text-align: center;
  transform: rotate(-2.5deg);
}

.ocr-scan {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ocr-scan svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.ocr-lcd {
  width: min(100%, 340px);
  padding: 14px 16px;
  font-size: 1.02rem;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--lcd-ink);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- Screenshot gallery ---------- */

.gallery-controls {
  display: flex;
  gap: 10px;
}

.gallery-controls button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.gallery-controls button:hover:not(:disabled) {
  background: var(--surface-2);
}

.gallery-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery-controls svg {
  width: 20px;
  height: 20px;
}

.gallery {
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2));
  --shot-h: clamp(440px, 46vw, 600px);
  display: flex;
  /* App Store spacing: a 20px gap per 230px of iPhone screenshot width */
  gap: calc(var(--shot-h) * 0.0401);
  margin: 0;
  padding: 8px var(--edge) 36px;
  overflow-x: auto;
  list-style: none;
  scroll-padding-inline: var(--edge);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery:focus-visible {
  outline-offset: -3px;
}

.gallery li {
  flex: none;
  scroll-snap-align: start;
}

.gallery img {
  width: auto;
  height: var(--shot-h);
  border-radius: calc(var(--shot-h) * 0.0346);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}

.gallery-note {
  margin-top: -12px;
  color: var(--ink-3);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Keys band ---------- */

.band {
  background: var(--band);
  color: var(--band-ink);
  border-block: 1px solid var(--band-line);
}

.band .eyebrow {
  color: #7fe3d3;
}

.band .lead {
  color: var(--band-ink-2);
}

.band h2 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  letter-spacing: -0.03em;
}

.band .section-head .lead {
  margin-top: 18px;
}

.key-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}

@media (max-width: 900px) {
  .key-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

.key-steps li {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--band-line);
  border-radius: var(--radius-sm);
  background: var(--band-card);
}

.key-steps h3 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

.key-steps p {
  margin-top: -8px;
  color: var(--band-ink-2);
  font-size: 0.97rem;
}

.band .key-sep {
  color: #7d8a88;
}

/* ---------- Premium ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 940px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

@media (max-width: 760px) {
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

.plan {
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.plan-term {
  color: var(--ink-3);
  font: 700 0.75rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan h3 {
  margin-top: 12px;
  font-size: 1.4rem;
}

.plan p:not(.plan-term) {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.fine-print {
  max-width: 700px;
  margin: 32px auto 0;
  color: var(--ink-3);
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- Closing call to action ---------- */

.cta-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(72px, 10vw, 120px);
  background: linear-gradient(135deg, var(--cta-a), var(--cta-b));
  color: var(--cta-ink);
  text-align: center;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(10, 60, 60, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 60, 60, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000 20%, transparent 75%);
}

.cta-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 26px;
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 18px 36px -14px rgba(10, 60, 60, 0.5);
}

.cta-band h2 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  letter-spacing: -0.03em;
}

.cta-band p {
  margin-top: 14px;
  color: var(--cta-ink-2);
  font-size: 1.1rem;
}

.cta-band .store-badge {
  margin-top: 30px;
}

/* ---------- Sub-page hero ---------- */

.page-hero {
  padding-block: clamp(48px, 7vw, 88px) clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(2.3rem, 1.6rem + 2.8vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.033em;
}

.page-hero .lead {
  max-width: 36em;
  margin-top: 16px;
}

.page-meta {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ---------- Support ---------- */

.support-body {
  padding-block: clamp(40px, 6vw, 72px) clamp(72px, 10vw, 120px);
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-card h2 {
  font-size: 1.45rem;
}

.contact-card .email {
  display: inline-block;
  margin-top: 8px;
  font-size: 1.12rem;
  font-weight: 600;
}

.contact-card .muted {
  max-width: 30em;
  margin-top: 10px;
  font-size: 0.95rem;
}

.faq-title {
  margin: clamp(48px, 7vw, 72px) 0 12px;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
}

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 44px 20px 0;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.4;
  list-style: none;
}

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

.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-75%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-25%) rotate(-135deg);
}

.faq summary:hover {
  color: var(--accent);
}

.faq .answer {
  display: grid;
  gap: 12px;
  padding: 0 0 24px;
  color: var(--ink-2);
}

.faq ol {
  display: grid;
  gap: 4px;
  padding-left: 1.3em;
}

.help-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(40px, 6vw, 64px);
}

@media (max-width: 560px) {
  .help-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

.help-links a {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.help-links a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.help-links strong {
  display: block;
  font-size: 1.05rem;
}

.help-links span {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 0.92rem;
}

/* ---------- Legal pages ---------- */

.legal-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(40px, 6vw, 64px) clamp(72px, 10vw, 120px);
}

@media (max-width: 900px) {
  .legal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
}

.toc-title {
  margin-bottom: 12px;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc ol {
  padding: 0;
  border-left: 1px solid var(--line);
  list-style: none;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover {
  border-left-color: var(--accent);
  color: var(--ink);
}

.prose {
  max-width: 70ch;
  color: var(--ink-2);
  font-size: 1.04rem;
  line-height: 1.72;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  color: var(--ink);
  font-size: 1.5rem;
  scroll-margin-top: 96px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.1em;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin: 0.4em 0;
}

.prose li::marker {
  color: var(--ink-3);
}

.table-wrap {
  margin: 0 0 1.4em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.prose table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 650;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td:first-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.effective {
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.95rem;
}

/* ---------- 404 ---------- */

.notfound {
  padding-block: clamp(56px, 10vw, 120px);
  text-align: center;
}

.notfound .bezel {
  width: min(100%, 380px);
  margin: 0 auto 40px;
}

.lcd-error {
  padding: 18px 20px 20px;
  font-size: 1.1rem;
  line-height: 1.7;
  text-align: left;
}

.lcd-error .err {
  font-weight: 700;
}

.lcd-error ol {
  padding: 0;
  list-style: none;
}

.lcd-error a {
  display: block;
  margin-inline: -6px;
  padding: 0 6px;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
}

.lcd-error a:hover,
.lcd-error a:focus-visible {
  background: var(--lcd-ink);
  color: var(--lcd);
  outline: none;
}

.notfound h1 {
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.notfound .lead {
  max-width: 28em;
  margin: 14px auto 30px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 56px 36px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 36px 28px;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

.footer-brand p {
  max-width: 24em;
  margin-top: 14px;
}

.site-footer h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.site-footer ul a {
  color: var(--ink-2);
  text-decoration: none;
}

.site-footer ul a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-base {
  display: grid;
  gap: 8px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.82rem;
}
