/* ==========================================================================
   Слово.Проповеди — landing page styles
   Theme: dual-mode (light / dark), brand orange.
   Self-hosted Unbounded + Onest.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Typography — self-hosted, Cyrillic-capable, subset via unicode-range
   -------------------------------------------------------------------------- */

/* Unbounded — display / headings */
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/unbounded-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/unbounded-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/unbounded-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/unbounded-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/unbounded-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/unbounded-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Onest — body text */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/onest-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/onest-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/onest-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/onest-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/onest-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/onest-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* --------------------------------------------------------------------------
   2. Color & theme — dual light/dark, brand orange
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  /* Surfaces */
  --bg: #fff;
  --bg-2: #f5f5f5;
  --bg-3: #e8e8e8;
  /* Accent family */
  --accent: #f16031;
  --accent-soft: #ff8a3d;
  --accent-text: #c44e20;
  --accent-deep: #d1542a;
  --on-accent: #fff;
  /* Text */
  --text: #000;
  --text-dim: #666;
  /* Lines & dividers */
  --line: rgba(241, 96, 49, 0.28);
  --line-soft: rgba(0, 0, 0, 0.1);
  /* Shadows */
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --accent-glow: rgba(241, 96, 49, 0.25);
  --accent-glow-strong: rgba(241, 96, 49, 0.35);
  --accent-tint: rgba(241, 96, 49, 0.06);
  --accent-tint-strong: rgba(241, 96, 49, 0.12);
  /* Mesh atmosphere */
  --mesh-accent: rgba(241, 96, 49, 0.12);
  --mesh-neutral: rgba(180, 195, 220, 0.25);
  --mesh-accent-2: rgba(241, 96, 49, 0.06);
  /* QR card — fixed light for scannability */
  --qr-bg: #fff;
  --qr-text: #000;
  /* Layout */
  --radius: 18px;
  --radius-sm: 14px;
  /* Typography */
  --font-display: 'Unbounded', Georgia, serif;
  --font-body: 'Onest', Georgia, serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  /* Surfaces */
  --bg: #000;
  --bg-2: #151515;
  --bg-3: #252525;
  /* Accent family (identical) */
  --accent: #f16031;
  --accent-soft: #ff8a3d;
  --accent-text: #f16031;
  --accent-deep: #d1542a;
  --on-accent: #fff;
  /* Text */
  --text: #fff;
  --text-dim: #9ca3af;
  /* Lines & dividers */
  --line: rgba(241, 96, 49, 0.4);
  --line-soft: rgba(255, 255, 255, 0.1);
  /* Shadows */
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --accent-glow: rgba(241, 96, 49, 0.3);
  --accent-glow-strong: rgba(241, 96, 49, 0.45);
  --accent-tint: rgba(241, 96, 49, 0.08);
  --accent-tint-strong: rgba(241, 96, 49, 0.16);
  /* Mesh atmosphere */
  --mesh-accent: rgba(241, 96, 49, 0.16);
  --mesh-neutral: rgba(64, 84, 140, 0.28);
  --mesh-accent-2: rgba(241, 96, 49, 0.08);
  /* QR card stays light */
  --qr-bg: #fff;
  --qr-text: #000;
}

/* Без JS data-theme не устанавливается — следуем системной теме.
   ВНИМАНИЕ: дублирует значения из [data-theme="dark"], НЕ рефакторить в
   light-dark() (деградирует в бесцветность на старых браузерах; дублирование
   деградирует корректно до светлой темы). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    /* Surfaces */
    --bg: #000;
    --bg-2: #151515;
    --bg-3: #252525;
    /* Accent family (identical) */
    --accent: #f16031;
    --accent-soft: #ff8a3d;
    --accent-text: #f16031;
    --accent-deep: #d1542a;
    --on-accent: #fff;
    /* Text */
    --text: #fff;
    --text-dim: #9ca3af;
    /* Lines & dividers */
    --line: rgba(241, 96, 49, 0.4);
    --line-soft: rgba(255, 255, 255, 0.1);
    /* Shadows */
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --accent-glow: rgba(241, 96, 49, 0.3);
    --accent-glow-strong: rgba(241, 96, 49, 0.45);
    --accent-tint: rgba(241, 96, 49, 0.08);
    --accent-tint-strong: rgba(241, 96, 49, 0.16);
    /* Mesh atmosphere */
    --mesh-accent: rgba(241, 96, 49, 0.16);
    --mesh-neutral: rgba(64, 84, 140, 0.28);
    --mesh-accent-2: rgba(241, 96, 49, 0.08);
    /* QR card stays light */
    --qr-bg: #fff;
    --qr-text: #000;
  }
}

/* --------------------------------------------------------------------------
   3. Base & atmosphere — layered radial mesh + grain
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Layered radial gradient mesh for depth */
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, var(--mesh-accent), transparent 60%),
    radial-gradient(50rem 36rem at -10% 20%, var(--mesh-neutral), transparent 55%),
    radial-gradient(40rem 30rem at 60% 110%, var(--mesh-accent-2), transparent 60%);
  background-attachment: fixed;
  /* Grain overlay via tiny SVG data-URI (allowed by CSP img-src data:) */
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* iOS Safari downlevel: `background-attachment: fixed` is unsupported and
   `position: fixed` overlays repaint on URL-bar show/hide. Fall back to a
   scrolling mesh + absolute grain that still covers the full page height. */
@supports not (background-attachment: fixed) {
  body {
    background-attachment: scroll;
  }
  body::after {
    position: absolute;
  }
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-text);
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 2;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.wordmark-mark {
  display: inline-flex;
  align-items: center;
}

.wordmark-mark img {
  display: block;
}

.header-nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.95rem;
}

.header-nav a {
  color: var(--text-dim);
}

.header-nav a:hover {
  color: var(--accent);
}

/* --- Theme toggle — compact segmented control --- */

.theme-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px;
  background: var(--bg-2);
}

.theme-toggle button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-toggle button:hover {
  color: var(--accent-text);
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.theme-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Screen-reader-only — accessible hidden text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   5. Hero — asymmetric composition, oversized display type
   -------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(4rem, 8vw, 6rem);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.hero-eyebrow {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  /* Grid-breaking oversized display type */
  max-width: 12ch;
}

.hero-title-accent {
  display: block;
  color: var(--accent);
}

.hero-sub {
  margin: 0 0 2.25rem;
  max-width: 46ch;
  color: var(--text-dim);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.55rem;
}

/* The UA [hidden] { display: none } rule doesn't reliably apply to
   SVG-namespace elements (and any future .btn-icon display rule would
   defeat it) — force it so the platform swap reliably hides the icon. */
.btn-icon[hidden] {
  display: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px var(--accent-glow-strong);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-note {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: var(--accent-text);
}

.hero-source {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
}

/* Web-app fallback — quiet alternative to the APK download. Dim text keeps it
   secondary to the primary CTA; the link keeps the brand accent (global `a`)
   and gains an underline on hover for affordance. Tokens handle both themes. */
.hero-alt {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.hero-alt a:hover {
  text-decoration: underline;
}

/* --- Hero side: metadata + QR (offset, grid-breaking) --- */

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* Offset the side column so it breaks the grid rhythm */
  transform: translateY(2rem);
}

.meta-card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  /* Gradient backgrounds snap by design — CSS cannot interpolate
     linear-gradient() unless the stops are registered custom properties. */
}

.meta-card-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.meta-list {
  margin: 0;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
}

.meta-row:last-child {
  border-bottom: 0;
}

.meta-row dt {
  color: var(--text-dim);
  transition: color 0.25s ease;
}

.meta-row dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.sha-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-end;
}

#meta-sha256 {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.sha-copy {
  flex-shrink: 0;
  /* >= 24px tap target (WCAG 2.5.8): 0.45rem vertical padding + 0.78rem text */
  padding: 0.45rem 0.8rem;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sha-copy:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.sha-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.qr-card {
  align-self: flex-end;
  background: var(--qr-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
  /* Rotate slightly for a hand-placed, manuscript feel */
  transform: rotate(1.5deg);
  max-width: 220px;
}

.qr-img {
  display: block;
  width: 160px;
  height: 160px;
  margin-inline: auto;
}

.qr-caption {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--qr-text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. Sections — features & install
   -------------------------------------------------------------------------- */

.features,
.install {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line-soft);
}

.section-eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  margin: 0 0 2.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
}

.feature-card:hover .feature-icon {
  background: var(--accent-tint-strong);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--accent);
  transition: background-color 0.25s ease;
}

.feature-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.feature-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.feature-text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  transition: color 0.25s ease;
}

.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1.25rem;
  max-width: 720px;
}

.install-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.step-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.4rem;
  color: var(--accent);
}

.install-step p {
  margin: 0;
  padding-top: 0.35rem;
  color: var(--text-dim);
}

.install-note {
  margin: 2rem 0 0;
  max-width: 720px;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

/* --------------------------------------------------------------------------
   6b. Screenshots gallery — phone frames, staggered manuscript feel
   -------------------------------------------------------------------------- */

.screenshots {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line-soft);
}

.screenshots-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.5rem;
  align-items: start;
}

.screenshot-item {
  /* Hand-placed tilt + staggered vertical rhythm break the uniform grid */
  --tilt: 0deg;
  transform: translateY(0) rotate(var(--tilt));
  transition: transform 0.25s ease;
}

.screenshot-item:nth-child(3n + 2) {
  --tilt: 0.8deg;
  margin-top: 2.75rem;
}

.screenshot-item:nth-child(3n + 3) {
  --tilt: -0.6deg;
  margin-top: 1.25rem;
}

.screenshot-item:nth-child(3n + 1) {
  --tilt: 0.4deg;
}

.screenshot-item:hover {
  transform: translateY(-6px) rotate(0deg);
  z-index: 2;
}

.screenshot-frame {
  margin: 0;
  position: relative;
  aspect-ratio: 1080 / 2340;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-3));
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Fade-in once the image loads (is-loaded added by JS) */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.25s ease;
}

.screenshot-frame.is-loaded {
  opacity: 1;
  transform: translateY(0);
}

.screenshot-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 17px;
}

.screenshots-source {
  margin: 2.5rem 0 0;
  font-size: 0.95rem;
}

.screenshots-credit {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.footer-legal {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   8. Motion — one orchestrated staggered hero reveal (CSS only)
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: reveal-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal[data-reveal]:nth-child(1) { animation-delay: 0.05s; }
.reveal[data-reveal]:nth-child(2) { animation-delay: 0.18s; }
.reveal[data-reveal]:nth-child(3) { animation-delay: 0.31s; }
.reveal[data-reveal]:nth-child(4) { animation-delay: 0.44s; }
.reveal[data-reveal]:nth-child(5) { animation-delay: 0.57s; }

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Universal transition reset — covers .theme-toggle button, .sha-copy,
     and any future transition-bearing selectors without per-element maintenance. */
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
  body {
    transition: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .screenshot-frame {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .header-inner {
    gap: 0.75rem;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-side {
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .meta-card {
    flex: 1 1 100%;
  }
  .qr-card {
    /* Hidden on small screens per spec — QR is a desktop convenience */
    display: none;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .header-nav {
    display: none;
  }
  /* Screenshots: horizontal scroll-snap carousel on small screens */
  .screenshots-list {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -4vw;
    padding-inline: 4vw;
    padding-bottom: 1rem;
  }
  .screenshot-item {
    flex: 0 0 72vw;
    scroll-snap-align: center;
    margin-top: 0;
  }
}

@media (max-width: 400px) {
  .wordmark-text {
    display: none;
  }
  .theme-toggle button {
    width: 1.75rem;
    height: 1.75rem;
  }
}
