/* ============================================================
   Shroud Image Analyzer — single-page informational site
   No framework, no build step. System fonts only.
   Dark theme, matching the app's own palette.
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --surface: #14141c;
  --surface-2: #1e1e28;
  --text: #ffffff;
  --muted: #bdbdc6;
  --faint: #7c7c85;
  --rule: #2a2a35;
  --primary: #7aa7ff;
  --primary-deep: #3d6fd6;
  --neg: #4a7fb5;
  --phosphor: #39ff14;
  --gold: #ffeb3b;
  --stone: #c9c4b8;
  --stone-ink: #16161a;

  --radius-pill: 999px;
  --radius-card: 18px;

  --max-w: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-pad: clamp(4rem, 10vh, 7rem);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5),
    0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 0 1px rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3, p {
  margin: 0;
}

/* Type scale */
.display {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

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

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.lede-left {
  margin-left: 0;
  margin-right: 0;
}

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

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
  white-space: nowrap;
  /* A long label in a translation must not push the page sideways. The
     button shrinks to fit its container and wraps its text instead. */
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Below this width a single-line label is too long for a pill, so the text
   is allowed to wrap onto a second line. */
@media (max-width: 420px) {
  .btn {
    white-space: normal;
    text-align: center;
  }
}

.btn-sm {
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
}

.btn-ios {
  background: #007aff;
  color: #fff;
}

.btn-ios:hover {
  background: #0051d5;
}

.btn-android {
  background: #34a853;
  color: #fff;
}

.btn-android:hover {
  background: #1e8e3e;
}

.btn-primary {
  background: var(--primary);
  color: #0a0a0f;
}

.btn-primary:hover {
  background: var(--primary-deep);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}

.btn-secondary:hover {
  border-color: var(--text);
}

.btn[disabled],
.btn.is-pending {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cta-row-center {
  justify-content: center;
}

/* ----- Nav ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 15, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.875rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  min-width: 0;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 560px) {
  .brand-name {
    max-width: 7.5rem;
  }
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
  font-size: 0.9375rem;
  color: var(--muted);
}

.nav-links a {
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a[aria-current="page"] {
  color: var(--text);
}

/* Language selector */
.lang-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  order: 2;
  /* Keep the locale switcher LTR even on RTL pages (ar). */
  direction: ltr;
}

/* The no-JavaScript fallback: without JS there is no dropdown, so the
   list itself is the affordance. */
.lang-noscript {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  max-width: min(24rem, 90vw);
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(20, 20, 28, 0.98);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  font-size: 0.875rem;
  font-weight: 600;
}

.lang-noscript a {
  color: var(--text);
  white-space: nowrap;
}

.lang-noscript a:hover,
.lang-noscript a:focus-visible {
  color: var(--primary);
}

.lang-noscript a.is-current {
  color: var(--primary);
}

/* A planned locale with no page yet: listed, but not a link. This is the
   no-JavaScript equivalent of the disabled entry the JS selector renders. */
.lang-noscript .is-pending {
  color: var(--faint);
  white-space: nowrap;
  cursor: default;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--faint);
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-code {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.lang-toggle .lang-code,
.lang-toggle .lang-label {
  display: none;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 13.5rem;
  max-height: 20rem;
  overflow-y: auto;
  scrollbar-width: thin;
  list-style: none;
  margin: 0;
  padding: 0.375rem;
  background: rgba(20, 20, 28, 0.98);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  z-index: 60;
}

.lang-menu[hidden],
.lang-menu.is-open[hidden] {
  display: none;
}

.lang-menu.is-open {
  display: block;
}

.lang-menu li {
  margin: 0;
}

.lang-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s ease;
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.lang-menu a[aria-selected="true"],
.lang-menu a.is-current {
  background: var(--primary);
  color: #0a0a0f;
  font-weight: 700;
}

.lang-menu a[aria-selected="true"] .lang-code {
  color: rgba(10, 10, 15, 0.7);
}

/* A locale that is scaffolded but not published yet: listed, not linked. */
.lang-menu a.is-pending {
  color: var(--faint);
  cursor: default;
}

.lang-menu a.is-pending:hover,
.lang-menu a.is-pending:focus-visible {
  background: transparent;
  outline: none;
}

.lang-menu a.is-pending .lang-flag {
  filter: grayscale(1);
  opacity: 0.55;
}

@media (min-width: 721px) {
  .lang-menu a .lang-label {
    display: inline;
  }
}

.nav-controls {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

/* Hamburger toggle */
.menu-btn {
  display: none;
  margin-left: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border: none;
  background: transparent;
  order: 4;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* Open state: X shape */
.menu-btn[aria-expanded="true"] .hamburger {
  background: transparent;
}

.menu-btn[aria-expanded="true"] .hamburger::before {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .hamburger::after {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 720px) {
  .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-controls {
    order: 2;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.5rem 0;
  }

  .nav-links a {
    padding: 0.875rem var(--gutter);
    border-top: 1px solid var(--rule);
  }

  .nav-links a:first-child {
    border-top: none;
  }

  .nav-links.is-open {
    display: flex;
  }
}

@media (min-width: 721px) {
  .nav-inner {
    justify-content: flex-start;
  }

  .nav-links {
    order: 5;
    margin-left: 0.75rem;
  }
}

/* ----- Hero ----- */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(2.5rem, 7vh, 5rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* The Shroud weave as a soft backdrop behind the hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 140%;
  background-image: url("assets/background.png");
  background-size: cover;
  background-position: center top;
  opacity: 0.16;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

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

.hero-logo {
  width: clamp(140px, 22vw, 220px);
  height: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.7));
}

.hero .lede {
  margin-top: 1.5rem;
}

.hero .cta-row {
  justify-content: center;
}

.features-cta {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

/* ----- Chip buttons ----- */
.chip-row {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0.5rem;
  margin-top: 1.75rem;
  justify-content: center;
}

@media (max-width: 640px) {
  .chip-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.chip:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--faint);
  transform: translateY(-1px);
}

/* ----- Features (Z-layout) ----- */
.features {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-pad) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

/* Two equal columns. Which side the copy lands on is decided by DOM order:
   `.feature-media` first = media on the left, `.feature-copy` first = text on
   the left. In an RTL locale the whole grid mirrors automatically, because
   `dir="rtl"` flips the column axis. */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.feature-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--surface) 0%, #16203a 100%);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.feature-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Phone-frame treatment for any feature with a screenshot. The phone column
   is the narrow one; the copy takes the rest. */
.feature-phone {
  grid-template-columns: minmax(170px, 250px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}

/* Text-left variant: the copy column comes first in the DOM, so give the
   phone the second (right-hand) column. */
.feature-phone.feature-text-left {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 250px);
}

.feature-phone .feature-media {
  aspect-ratio: 1206 / 2622;
  border-radius: 28px;
  padding: 10px;
  background: linear-gradient(160deg, #16161e 0%, #16203a 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 6px 14px rgba(0, 0, 0, 0.4);
}

.feature-phone .feature-img {
  position: static;
  border-radius: 20px;
  object-fit: contain;
  width: 100%;
  height: auto;
}

.feature-hero .feature-copy h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

.feature-copy p {
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 32rem;
}

.feature-copy p + p {
  margin-top: 0.75rem;
}

.feature-copy h3 {
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.feature-copy ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.feature-copy li {
  margin-bottom: 0.4rem;
}

.feature-copy strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 800px) {
  .feature,
  .feature-text-left {
    grid-template-columns: minmax(0, 1fr);
    direction: ltr;
  }
  .feature-phone,
  .feature-phone.feature-text-left {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature-text-left > * {
    direction: ltr;
  }
  .feature-media {
    order: -1;
    aspect-ratio: 16 / 10;
    width: 100%;
  }
  .feature-hero,
  .feature-phone {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }
  .feature-hero .feature-media,
  .feature-phone .feature-media {
    max-width: 220px;
    width: 100%;
    margin: 0 auto;
  }
  .feature-text-left .feature-copy,
  .feature-image-left .feature-copy {
    padding-left: 0;
    text-align: center;
  }
  .feature-hero .feature-copy p,
  .feature-phone .feature-copy p,
  .feature-phone .feature-copy ul {
    margin-left: auto;
    margin-right: auto;
  }
  .feature-copy ul {
    text-align: left;
  }
}

/* ----- Callout cards (privacy / free / languages) ----- */
.callout {
  padding: clamp(3rem, 7vh, 5rem) var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}

.callout-inner {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.callout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #0a0a0f;
  margin-bottom: 1rem;
}

.callout-icon.is-gold {
  background: var(--gold);
}

.callout-icon.is-stone {
  background: var(--stone);
  color: var(--stone-ink);
}

.callout-headline {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.875rem;
}

.callout-lede {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.callout-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primary);
  transition: color 0.15s ease, gap 0.15s ease;
}

.callout-link:hover {
  color: #a9c3ff;
  gap: 0.6rem;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1.25rem;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  text-align: left;
}

.check-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

@media (max-width: 480px) {
  .check-list {
    grid-template-columns: 1fr;
  }
}

/* ----- Languages callout ----- */
.languages-inner {
  max-width: 54rem;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-soft);
}

.languages-stat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.languages-number {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--primary);
}

.languages-label {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.625rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
}

/* A language the app speaks but the site is not published in yet. */
.lang-badge.is-pending {
  color: var(--faint);
  border-style: dashed;
  background: transparent;
}

@media (max-width: 640px) {
  .languages-inner {
    padding: clamp(1.5rem, 5vw, 2rem) var(--gutter);
  }
  .languages-stat {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
  .languages-label {
    text-align: center;
    letter-spacing: 0.06em;
  }
  .languages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .lang-badge {
    padding: 0.5rem 0.5rem;
    font-size: 0.875rem;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .languages-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- The Shroud story (stone band) ----- */
.story {
  background: var(--stone);
  color: var(--stone-ink);
  margin-top: var(--section-pad);
  padding: var(--section-pad) var(--gutter);
}

.story-inner {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.story .eyebrow {
  color: #6b5a3e;
}

.story h2 {
  color: var(--stone-ink);
}

.story .lede {
  color: #3c372e;
}

.story p {
  color: #3c372e;
}

.story .callout-link {
  color: #2f4a86;
}

.story .callout-link:hover {
  color: #1c3059;
}

.story-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: left;
}

.story-fact {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(22, 22, 26, 0.12);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}

.story-fact h3 {
  color: var(--stone-ink);
  margin-bottom: 0.4rem;
}

.story-fact p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ----- VP-8 band (phosphor) ----- */
.vp8-band {
  background: #04120a;
  color: var(--phosphor);
  padding: var(--section-pad) var(--gutter);
  border-top: 1px solid rgba(57, 255, 20, 0.15);
  border-bottom: 1px solid rgba(57, 255, 20, 0.15);
}

.vp8-band-inner {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.vp8-band .eyebrow {
  color: var(--phosphor);
  opacity: 0.75;
}

.vp8-band h2 {
  color: var(--phosphor);
}

.vp8-band p {
  color: rgba(57, 255, 20, 0.8);
}

.vp8-band .lede {
  color: rgba(57, 255, 20, 0.75);
}

.vp8-band .callout-link {
  color: var(--phosphor);
}

.vp8-band .callout-link:hover {
  color: #7dff5e;
}

/* ----- CTA band ----- */
.get {
  text-align: center;
  padding: var(--section-pad) var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}

.get .display {
  margin-bottom: 0.5rem;
}

.get .cta-row {
  justify-content: center;
}

/* The closing band inverts to the parchment/stone treatment so the page ends
   on a light note rather than fading into the background. */
.get.is-stone {
  background: var(--stone);
  color: var(--stone-ink);
  max-width: none;
  margin-top: var(--section-pad);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.get.is-stone .display {
  color: var(--stone-ink);
}

.get.is-stone .footnote {
  color: #4a4438;
}

.get.is-stone .btn-secondary {
  color: var(--stone-ink);
  border-color: rgba(22, 22, 26, 0.25);
}

.get.is-stone .btn-secondary:hover {
  border-color: var(--stone-ink);
}

.footnote {
  margin-top: 2rem;
  color: var(--faint);
  font-size: 0.875rem;
}

/* ----- Footer ----- */
.footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 2.5rem var(--gutter);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.footer-credits img {
  height: 26px;
  width: auto;
  opacity: 0.75;
}

@media (max-width: 720px) {
  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

/* ----- Legal pages (privacy) ----- */
.legal {
  background: var(--bg);
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.legal-inner {
  max-width: 48rem;
  margin: 0 auto;
}

.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.legal-header .eyebrow {
  margin-bottom: 0.75rem;
}

.legal-header .display {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  text-align: left;
}

.legal-updated {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.legal-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: none;
}

.legal-section {
  margin-top: 2.5rem;
  scroll-margin-top: 7rem;
}

.legal-section h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.875rem;
  scroll-margin-top: 6.5rem;
}

.legal-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.625rem;
  color: var(--text);
}

.legal-section p,
.legal-section li {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.legal-section ul,
.legal-section ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.5rem;
}

.legal-section li {
  margin-bottom: 0.5rem;
}

.legal-section li::marker {
  color: var(--faint);
}

.legal-section code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--text);
  border: 1px solid var(--rule);
}

.legal-section a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.legal-section a:hover {
  color: #a9c3ff;
}

.legal-contact {
  font-size: 1rem;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .legal {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .legal-header .display {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }
}

/* ----- Features page (long-form overview) ----- */
.features-page {
  background: var(--bg);
}

.features-page-inner {
  max-width: 50rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.features-page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.features-page-header .eyebrow {
  margin-bottom: 0.75rem;
}

.features-page-header .display {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  text-align: left;
}

.features-page-header .lede {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.features-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  font-size: 0.875rem;
}

.features-toc a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  border: 1px solid var(--rule);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.features-toc a:hover {
  color: var(--text);
  border-color: var(--faint);
}

.features-page-section {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 7rem;
}

.features-page-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.features-page-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  scroll-margin-top: 6.5rem;
}

.features-page-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.625rem;
  color: var(--text);
}

.features-page-section p {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.features-page-section ul,
.features-page-section ol {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.5rem;
}

.features-page-section li {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.features-page-section li::marker {
  color: var(--faint);
}

.features-page-section li > ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.features-page-section li > ul li {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.features-page-section strong {
  color: var(--text);
  font-weight: 600;
}

.features-page-section code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--text);
  border: 1px solid var(--rule);
}

.features-page-section a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.features-page-section a:hover {
  color: #a9c3ff;
}

/* Small spec table used on the features and VP-8 pages */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1.25rem 0;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.spec-table th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.spec-table td:first-child {
  color: var(--muted);
  white-space: nowrap;
}

.spec-table tbody tr:last-child td {
  border-bottom: none;
}

/* A table cannot wrap its way out of a narrow viewport the way prose can,
   so on a phone it scrolls sideways inside its own box. The first column
   keeps its no-wrap rule only while there is room for it: a long
   translation ("Dimensione campione", "Tamaño de muestra") is wider than
   a third of a 320px screen, and forcing it to stay on one line is what
   pushes the whole page sideways. */
@media (max-width: 560px) {
  .spec-table td:first-child {
    white-space: normal;
  }

  .spec-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .features-page-inner {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .features-page-header .display {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }
  .features-toc {
    font-size: 0.8125rem;
  }
  .features-toc a {
    padding: 0.35rem 0.7rem;
  }
}

/* ----- Page heroes (features / vp8 / faq / screenshots) ----- */
.page-hero {
  background: linear-gradient(180deg, #101520 0%, var(--bg) 100%);
  color: var(--text);
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
  border-bottom: 1px solid var(--rule);
}

.page-hero-inner {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.page-hero-inner .display {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 1.25rem;
  text-align: center;
}

.page-hero-inner .lede {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.page-hero.is-phosphor {
  background: linear-gradient(180deg, #04120a 0%, var(--bg) 100%);
}

.page-hero.is-phosphor .display {
  color: var(--phosphor);
}

.page-hero.is-phosphor .lede {
  color: rgba(57, 255, 20, 0.72);
}

.page-hero.is-phosphor .eyebrow {
  color: var(--phosphor);
  opacity: 0.75;
}

@media (max-width: 720px) {
  .page-hero-inner .display {
    font-size: clamp(2rem, 9vw, 2.75rem);
  }
}

/* ----- FAQ page ----- */
.faq-page {
  background: var(--bg);
}

.faq-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.faq-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 6.5rem;
}

.faq-content h2:first-child {
  margin-top: 0;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--faint);
}

.faq-item summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.45;
  list-style: none;
  color: var(--text);
  transition: background 0.15s ease;
}

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

.faq-item summary:hover {
  background: var(--surface-2);
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Chevron */
.faq-item summary::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 0.45rem;
  margin-left: auto;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 0.7rem;
}

.faq-item > p {
  padding: 0 1.25rem 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.faq-item > p strong {
  color: var(--text);
  font-weight: 600;
}

.faq-item > p a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

[dir="rtl"] .faq-item summary {
  text-align: right;
}

[dir="rtl"] .faq-item summary::after {
  margin-left: 0;
  margin-right: auto;
}

/* ----- Screenshots page ----- */
.screenshots-page {
  background: var(--bg);
}

.screenshots-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.screenshots-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  scroll-margin-top: 6.5rem;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.screenshot-item {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.screenshot-item img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-item figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.screenshot-inline {
  max-width: 520px;
  margin: 1.5rem auto;
}

@media (max-width: 720px) {
  .screenshot-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

/* ----- Back to top ----- */
.back-to-top {
  position: fixed;
  bottom: 4rem;
  right: 1.5rem;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 20, 28, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--rule);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  box-shadow: var(--shadow-soft);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 720px) {
  .back-to-top {
    bottom: 3.5rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ----- RTL ----- */
[dir="rtl"] .feature-text-left {
  direction: rtl;
}

[dir="rtl"] .feature-copy {
  text-align: right;
}

[dir="rtl"] .hero,
[dir="rtl"] .callout-inner,
[dir="rtl"] .languages-inner,
[dir="rtl"] .page-hero-inner,
[dir="rtl"] .story-inner,
[dir="rtl"] .vp8-band-inner,
[dir="rtl"] .get {
  text-align: center;
}

[dir="rtl"] .features-toc,
[dir="rtl"] .chip-row {
  justify-content: center;
}

[dir="rtl"] .check-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .check-list li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .features-page-section ul,
[dir="rtl"] .features-page-section ol,
[dir="rtl"] .legal-section ul,
[dir="rtl"] .legal-section ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .feature-copy ul {
  padding-left: 0;
  padding-right: 1.25rem;
}

[dir="rtl"] .spec-table th,
[dir="rtl"] .spec-table td {
  text-align: right;
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
