@font-face {
  font-family: "Book Track Roboto";
  src: url("./roboto.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* =============================================================================
   Book Track v3 Semantic Tokens — Warm Paper (Light) & Night Paper (Dark)
   ============================================================================= */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f3f2ed;
  --paper-glass: rgba(243, 242, 237, 0.84);
  --card: #ffffff;
  --surface-subtle: #eae8e0;
  --ink-surface: #141716;
  --on-ink-surface: #ffffff;
  --on-ink-muted: #c0c4bf;
  --ink-border: rgba(255, 255, 255, 0.1);

  --ink: #15161a;
  --muted: #5b5d63;
  --line: #e2e0d6;

  --forest: #12704a;
  --forest-hover: #0e5c3c;
  --on-forest: #ffffff;
  --forest-soft: #e3f2eb;
  --dock-selection: #e4efe9;

  --lime: #dcf26b;
  --on-lime: #1a2414;

  --rating: #c97d10;
  --rating-soft: #fdf3e1;

  --ribbon: #9b2335;
  --ribbon-soft: #fae6e9;
  --bar-dim: #cbe1d5;
  --bar-peak: #85b89e;

  --seg-thumb: #ffffff;
  --img-outline: oklch(0 0 0 / 0.1);
  --shadow-soft: 0 16px 38px -18px rgba(21, 22, 26, 0.16), 0 2px 8px rgba(21, 22, 26, 0.05);
  --shadow-device: 0 32px 72px -20px rgba(0, 0, 0, 0.56), 0 8px 22px rgba(0, 0, 0, 0.24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #151716;
    --paper-glass: rgba(21, 23, 22, 0.84);
    --card: #1f2220;
    --surface-subtle: #282c29;
    --ink-surface: #1b201d;
    --on-ink-surface: #eceee8;
    --on-ink-muted: #aeb4ac;
    --ink-border: #323a34;

    --ink: #e6e7e0;
    --muted: #9ea19a;
    --line: #323733;

    --forest: #7fc7a3;
    --forest-hover: #96d4b5;
    --on-forest: #0c2117;
    --forest-soft: #1e352a;
    --dock-selection: #2a352e;

    --lime: #c2d966;
    --on-lime: #182012;

    --rating: #f0b95b;
    --rating-soft: #332a19;

    --ribbon: #c74b5e;
    --ribbon-soft: #361d22;
    --bar-dim: #2e3d34;
    --bar-peak: #496d5a;

    --seg-thumb: #2e3430;
    --img-outline: oklch(1 0 0 / 0.1);
    --shadow-soft: 0 18px 42px -18px rgba(0, 0, 0, 0.58), 0 2px 8px rgba(0, 0, 0, 0.32);
    --shadow-device: 0 32px 72px -18px rgba(0, 0, 0, 0.78), 0 8px 24px rgba(0, 0, 0, 0.42);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151716;
  --paper-glass: rgba(21, 23, 22, 0.84);
  --card: #1f2220;
  --surface-subtle: #282c29;
  --ink-surface: #1b201d;
  --on-ink-surface: #eceee8;
  --on-ink-muted: #aeb4ac;
  --ink-border: #323a34;

  --ink: #e6e7e0;
  --muted: #9ea19a;
  --line: #323733;

  --forest: #7fc7a3;
  --forest-hover: #96d4b5;
  --on-forest: #0c2117;
  --forest-soft: #1e352a;
  --dock-selection: #2a352e;

  --lime: #c2d966;
  --on-lime: #182012;

  --rating: #f0b95b;
  --rating-soft: #332a19;

  --ribbon: #c74b5e;
  --ribbon-soft: #361d22;
  --bar-dim: #2e3d34;
  --bar-peak: #496d5a;

  --seg-thumb: #2e3430;
  --img-outline: oklch(1 0 0 / 0.1);
  --shadow-soft: 0 18px 42px -18px rgba(0, 0, 0, 0.58), 0 2px 8px rgba(0, 0, 0, 0.32);
  --shadow-device: 0 32px 72px -18px rgba(0, 0, 0, 0.78), 0 8px 24px rgba(0, 0, 0, 0.42);
}

.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* Circular Wave View Transition for Theme Morph */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

/* =============================================================================
   Top Reading-Ribbon Progress (CSS Scroll-Driven Timeline)
   ============================================================================= */
.reading-ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ribbon) 0%, var(--forest) 60%, var(--lime) 100%);
  opacity: 0;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .reading-ribbon {
      opacity: 1;
      animation: ribbon-progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@keyframes ribbon-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* =============================================================================
   Base & Typography
   ============================================================================= */
html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Book Track Roboto", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-color: var(--line) var(--paper);
  scroll-behavior: smooth;
  overflow-x: clip;
}

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

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  caret-color: var(--forest);
  overflow-x: clip;
}

::selection {
  background: var(--forest-soft);
  color: var(--ink);
}

h1, h2, h3, p {
  margin: 0;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  color: inherit;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 4.8vw, 3.625rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.625rem, 3.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.24;
  letter-spacing: -0.015em;
}

p {
  color: var(--muted);
  text-wrap: pretty;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* 3D Section Unfold Reveals */
@media (prefers-reduced-motion: no-preference) {
  html.motion-ready [data-reveal].is-pending {
    opacity: 0;
    transform: perspective(1100px) translateY(30px) rotateX(4deg) scale(0.97);
  }
  html.motion-ready [data-reveal] {
    transform-origin: center top;
    transition: opacity 680ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 740ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  html.motion-ready [data-reveal].is-visible {
    opacity: 1;
    transform: perspective(1100px) translateY(0) rotateX(0deg) scale(1);
  }
}

/* =============================================================================
   Sticky Glass Header (Always-Accessible Top Install CTA)
   ============================================================================= */
.header-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--paper-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header {
  width: min(100%, 1160px);
  margin-inline: auto;
  padding: 12px clamp(16px, 4vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  transition: transform 260ms cubic-bezier(0.28, 0.9, 0.3, 1);
}

@media (hover: hover) {
  @media (prefers-reduced-motion: no-preference) {
    .brand:hover img {
      transform: scale(1.07) rotate(-4deg);
    }
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}

@media (hover: hover) {
  .site-nav a:hover {
    color: var(--ink);
    background: var(--surface-subtle);
  }
}

.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  background: var(--forest);
  color: var(--on-forest);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}

@media (hover: hover) {
  .header-install:hover {
    background: var(--forest-hover);
  }
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background-color 150ms ease-out;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}

.icon-btn .icon-sun { display: none; }
.icon-btn .icon-moon { display: block; }
.icon-btn[data-resolved-theme="dark"] .icon-sun { display: block; }
.icon-btn[data-resolved-theme="dark"] .icon-moon { display: none; }

@media (hover: hover) {
  .lang-link:hover,
  .icon-btn:hover {
    background: var(--surface-subtle);
  }
}

/* =============================================================================
   Main Layout Shell
   ============================================================================= */
.layout {
  width: min(100%, 1160px);
  min-height: calc(100svh - 65px);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 36px);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: clamp(20px, 3vw, 32px) 0 clamp(48px, 7vw, 88px);
}

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(48px, 7vw, 88px);
}

.landing > *,
.hero > *,
.story-shell > *,
.journal-grid > *,
.journal-side > *,
.theme-grid > *,
.download-band > * {
  min-width: 0;
}

/* =============================================================================
   Magnetic Buttons & Liquid Segmented Controls
   ============================================================================= */
.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 24px 13px 21px;
  color: var(--on-forest);
  background: var(--forest);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out, transform 180ms cubic-bezier(0.28, 0.9, 0.3, 1);
}

.button-lime {
  background: var(--lime);
  color: var(--on-lime);
}

.button-ghost-ink {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--on-ink-surface);
  padding-inline: 22px;
}

.button-subtle {
  background: var(--surface-subtle);
  color: var(--ink);
  padding-inline: 18px;
}

.button-sm {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
}

.button-magnetic::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -120%;
  width: 65%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  opacity: 0;
}

@media (hover: hover) {
  .button:not(:disabled):hover { background: var(--forest-hover); }
  .button-lime:not(:disabled):hover { filter: brightness(0.95); }
  .button-ghost-ink:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
  }
  .button-subtle:not(:disabled):hover { background: var(--line); }
  @media (prefers-reduced-motion: no-preference) {
    .button-magnetic:hover::after {
      opacity: 1;
      animation: cta-sheen 680ms cubic-bezier(0.16, 1, 0.3, 1);
    }
  }
}

@keyframes cta-sheen {
  from { transform: translateX(0) skewX(-18deg); }
  to { transform: translateX(460%) skewX(-18deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .button:not(:disabled):active,
  .header-install:active,
  .icon-btn:not(:disabled):active,
  .bar-btn:not(:disabled):active {
    transform: scale(0.96);
  }
}

/* Liquid Segmented Control */
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  isolation: isolate;
}

.seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 10px;
  background: var(--seg-thumb);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .seg-thumb {
    transition: transform 360ms cubic-bezier(0.28, 0.9, 0.3, 1);
  }
}

.seg-btn {
  position: relative;
  z-index: 1;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease-out;
}

.seg-btn.is-active { color: var(--ink); }

/* =============================================================================
   Section 1: Cinematic WebGL Raymarched SDF Hero
   ============================================================================= */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 340px);
  gap: clamp(32px, 6vw, 72px);
  min-height: min(640px, 82svh);
  border: 1px solid var(--ink-border);
  border-radius: 28px;
  background:
    radial-gradient(60% 70% at 78% 48%, rgba(18, 112, 74, 0.45), transparent 72%),
    var(--ink-surface);
  color: var(--on-ink-surface);
  padding: clamp(28px, 5vw, 60px);
  box-shadow: var(--shadow-soft);
}

.webgl-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms ease-out;
}

.webgl-bg.is-ready {
  opacity: 1;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(13, 18, 16, 0.78) 0%, rgba(13, 18, 16, 0.48) 48%, rgba(13, 18, 16, 0.04) 76%);
}

.hero-copy,
.hero-stage {
  position: relative;
  z-index: 2;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 20px;
}

.hero-copy h1 {
  max-width: 14ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-lead {
  color: rgba(244, 246, 242, 0.88);
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.55;
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.hero-stage {
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.phone-frame {
  position: relative;
  width: min(100%, 288px);
  justify-self: center;
  padding: 8px;
  border-radius: 28px;
  background: #0d0f0e;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-device);
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 360ms ease-out;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-stage .phone-frame:not(.is-tilting) {
    animation: hero-float 6.8s ease-in-out infinite;
  }
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0px) rotateX(1.5deg) rotateY(-4deg); }
  50% { transform: translateY(-10px) rotateX(-1.5deg) rotateY(4deg); }
}

.phone-ribbon {
  position: absolute;
  top: -5px;
  right: 32px;
  width: 16px;
  height: 22px;
  z-index: 4;
  background: var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.phone-screen {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper);
}

.phone-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  outline: 1px solid var(--img-outline);
  outline-offset: -1px;
}

.phone-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: 20px;
  background: radial-gradient(
    240px circle at var(--sheen-x, 50%) var(--sheen-y, 35%),
    rgba(255, 255, 255, 0.16),
    transparent 65%
  );
  transition: opacity 220ms ease-out;
}

@media (hover: hover) {
  .phone-frame.is-tilting .phone-sheen { opacity: 1; }
}

/* =============================================================================
   Section Headers & Panels
   ============================================================================= */
.section-head {
  display: grid;
  gap: 8px;
  max-width: 56ch;
  margin-bottom: clamp(18px, 2.8vw, 30px);
}

.section-head p {
  font-size: 1rem;
  line-height: 1.5;
}

.panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 28px);
}

.panel-ink {
  border: 1px solid var(--ink-border);
  background: var(--ink-surface);
  color: var(--on-ink-surface);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 28px);
}

.panel-ink p { color: var(--on-ink-muted); }

/* =============================================================================
   Section 2: Dedicated Feature Showcases — Alternating Splits + Bento Pair
   ============================================================================= */
.story-halo {
  position: absolute;
  width: 340px;
  height: 340px;
  z-index: 0;
  pointer-events: none;
  color: var(--forest);
  opacity: 0.14;
  transition: transform 720ms cubic-bezier(0.22, 1, 0.36, 1), opacity 400ms ease-out;
}

.showcase-stack {
  display: grid;
  gap: clamp(20px, 3vw, 28px);
}

.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.feature-split.is-reversed {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.feature-split.is-reversed .feature-media {
  order: 2;
  border-right: 0;
  border-left: 1px solid var(--line);
}

.feature-media {
  position: relative;
  min-height: 410px;
  padding: 34px 28px 0;
  display: grid;
  align-items: end;
  justify-items: center;
  border-right: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  perspective: 1200px;
}

.feature-media.tone-forest {
  background:
    radial-gradient(75% 70% at 50% 25%, var(--forest-soft), transparent 72%),
    var(--paper);
}

.feature-media.tone-paper {
  background:
    radial-gradient(75% 70% at 50% 25%, rgba(18, 112, 74, 0.14), transparent 72%),
    var(--surface-subtle);
}

.feature-media.tone-lime {
  background:
    radial-gradient(75% 65% at 50% 22%, rgba(220, 242, 107, 0.2), transparent 68%),
    var(--paper);
}

.feature-media .story-halo {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%) rotate(-8deg);
}

@media (hover: hover) {
  @media (prefers-reduced-motion: no-preference) {
    .feature-split:hover .feature-media .story-halo {
      transform: translate(-50%, -46%) rotate(12deg) scale(1.06);
      opacity: 0.2;
    }
  }
}

.showcase-device,
.bento-device {
  position: relative;
  z-index: 2;
  padding: 8px 8px 0;
  border-radius: 26px 26px 0 0;
  background: #0d0f0e;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 0;
  box-shadow: var(--shadow-device);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 540ms cubic-bezier(0.22, 1, 0.36, 1);
}

.showcase-device {
  width: min(100%, 272px);
  aspect-ratio: 9 / 12.2;
}

.bento-device {
  width: min(100%, 256px);
  aspect-ratio: 9 / 10.6;
}

.showcase-device img,
.bento-device img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 19px 19px 0 0;
  outline: 1px solid var(--img-outline);
  outline-offset: -1px;
}

@media (hover: hover) {
  @media (prefers-reduced-motion: no-preference) {
    .feature-split:hover .showcase-device:not(.is-tilting),
    .bento-card:hover .bento-device:not(.is-tilting) {
      transform: translateY(-6px);
    }
    .showcase-device.is-tilting .phone-sheen,
    .bento-device.is-tilting .phone-sheen {
      opacity: 1;
    }
  }
}

.feature-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(26px, 4.5vw, 52px);
}

.feature-copy h2 {
  font-size: clamp(1.5rem, 2.7vw, 2.125rem);
  line-height: 1.12;
  max-width: 18ch;
}

.feature-copy p {
  font-size: 1.03125rem;
  line-height: 1.58;
  max-width: 38ch;
}

.feature-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 0.8125rem;
  font-weight: 600;
}

.feature-eyebrow svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.feature-eyebrow.is-on-ink {
  background: rgba(220, 242, 107, 0.14);
  color: var(--lime);
}

/* Contrasting 2-Column Bento Pair (Goals on Ink + Notes on Card) */
.feature-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 24px);
}

.bento-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.bento-ink {
  background:
    radial-gradient(85% 65% at 50% 100%, rgba(18, 112, 74, 0.42), transparent 72%),
    var(--ink-surface);
  color: var(--on-ink-surface);
  border-color: var(--ink-border);
}

.bento-ink p {
  color: var(--on-ink-muted);
}

.bento-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(24px, 3.6vw, 36px) clamp(24px, 3.6vw, 36px) 22px;
}

.bento-copy h3 {
  font-size: clamp(1.375rem, 2.3vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.022em;
}

.bento-copy p {
  font-size: 0.96875rem;
  line-height: 1.55;
  max-width: 38ch;
}

.bento-visual {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 6px 24px 0;
  perspective: 1200px;
}

/* =============================================================================
   Section 3: Live Statistics & Ex-Libris Challenge Proof (#stats)
   ============================================================================= */
.journal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.stats-panel { display: grid; gap: 20px; }

.stats-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.stats-big {
  font-size: clamp(2.5rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stats-caption { color: var(--muted); font-size: 0.9375rem; }

.bars-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  min-height: 144px;
  padding-top: 8px;
}

.bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}

@media (hover: hover) {
  .bar-btn:hover { background: var(--surface-subtle); }
}

.bar-num {
  min-height: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar-fill {
  width: 100%;
  max-width: 28px;
  height: 48px;
  border-radius: 7px;
  background: var(--bar-dim);
  transform-origin: bottom center;
  transition: height 340ms cubic-bezier(0.28, 0.9, 0.3, 1), background-color 180ms ease-out;
}

.bar-btn.is-peak .bar-fill { height: 92px; background: var(--bar-peak); }
.bar-btn.is-empty .bar-fill { height: 5px; background: var(--line); }
.bar-btn.is-selected .bar-fill { background: var(--forest); }
.bar-btn.is-selected .bar-num { color: var(--forest); }

.bar-month {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.bar-btn.is-selected .bar-month {
  background: var(--forest-soft);
  color: var(--forest);
}

.month-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

.kpi-tile {
  background: var(--paper);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 3px;
}

.kpi-val {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi-val svg { color: var(--rating); flex: none; }
.kpi-lbl { font-size: 0.8125rem; color: var(--muted); }

.challenge-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.challenge-head {
  display: grid;
  gap: 6px;
}

.challenge-head p {
  font-size: 0.9375rem;
}

.challenge-stack {
  display: grid;
  gap: 12px;
}

.challenge-mini {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--paper);
}

.challenge-mini-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.challenge-mini-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.challenge-mini-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.challenge-mini-track {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.challenge-mini-fill {
  display: block;
  width: 67%;
  height: 100%;
  border-radius: 999px;
  background: var(--forest);
}

.challenge-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--paper);
}

.ring-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  flex: none;
  display: grid;
  place-items: center;
}

.ring-svg { width: 68px; height: 68px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-progress {
  fill: none;
  stroke: var(--forest);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 175.93;
  stroke-dashoffset: 26.39;
  transition: stroke-dashoffset 480ms cubic-bezier(0.28, 0.9, 0.3, 1);
}

.ring-pct {
  position: absolute;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.exlibris-seal {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--forest);
}

.exlibris-seal[hidden],
.ring-pct[hidden] { display: none; }

.exlibris-seal .seal-check {
  position: absolute;
  display: inline-flex;
  color: var(--on-forest);
}

@media (prefers-reduced-motion: no-preference) {
  .challenge-panel.is-complete .exlibris-seal {
    animation: seal-pop 460ms cubic-bezier(0.22, 1.25, 0.36, 1) both;
  }
}

@keyframes seal-pop {
  0% { opacity: 0; transform: scale(0.45) rotate(-26deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.seal-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid var(--lime);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .challenge-panel.is-complete .seal-pulse {
    animation: seal-ripple 650ms cubic-bezier(0.16, 1, 0.3, 1) 90ms both;
  }
}

@keyframes seal-ripple {
  0% { opacity: 0.78; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.48); }
}

.challenge-meta { min-width: 0; display: grid; gap: 3px; }
.challenge-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
.challenge-sub { font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.challenge-panel.is-complete .challenge-sub { color: var(--forest); font-weight: 600; }

/* =============================================================================
   Section 5: Full-Bleed WebGL Download Finale (#download) & Footer
   ============================================================================= */
.download-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 40px;
  align-items: center;
  border-radius: 28px;
  padding: clamp(32px, 5.5vw, 56px);
  background: var(--forest);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.download-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 44, 30, 0.72) 0%, rgba(10, 44, 30, 0.35) 58%, rgba(10, 44, 30, 0.16) 100%);
}

.download-band > :not(.webgl-bg) {
  position: relative;
  z-index: 2;
}

.download-copy {
  display: grid;
  gap: 12px;
  max-width: 52ch;
}

.download-copy p {
  color: rgba(255, 255, 255, 0.88);
}

.download-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

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

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

/* =============================================================================
   Shared / Privacy / Activation / Error Subpages
   ============================================================================= */
.subpage-stage {
  min-height: calc(100svh - 210px);
  display: grid;
  place-items: center;
  padding-block: clamp(16px, 4vw, 44px);
}

.share-card {
  position: relative;
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: minmax(190px, 232px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 36px);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  padding: clamp(22px, 3.6vw, 34px);
  box-shadow: var(--shadow-soft);
}

.share-ribbon {
  top: -5px;
  right: 34px;
}

.share-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 248px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(85% 85% at 50% 45%, var(--forest-soft), transparent 72%),
    var(--paper);
  overflow: hidden;
  isolation: isolate;
}

.share-halo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}

.share-halo .story-halo {
  position: static;
  width: 210px;
  height: 210px;
  opacity: 0.16;
  color: var(--forest);
}

.share-emblem {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--forest);
  color: var(--on-forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px -12px rgba(18, 112, 74, 0.55);
}

.share-emblem svg {
  width: 34px;
  height: 34px;
}

.cover {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 148px);
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  outline: 1px solid var(--img-outline);
  outline-offset: -1px;
  box-shadow: 0 18px 34px -14px rgba(0, 0, 0, 0.45);
}

.cover-collage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 172px);
}

.cover-collage.count-1 {
  grid-template-columns: 1fr;
  width: min(100%, 138px);
}

.cover-collage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  outline: 1px solid var(--img-outline);
  outline-offset: -1px;
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.38);
}

.share-body {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 12px;
}

.share-body h1 {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
}

.share-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 0.8125rem;
  font-weight: 600;
}

.share-badge svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.share-authors {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.share-books {
  margin: 4px 0;
  padding: 12px 14px;
  list-style: none;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: grid;
  gap: 8px;
}

.share-books li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  font-size: 0.875rem;
}

.share-book-title {
  color: var(--ink);
  font-weight: 600;
}

.share-book-author {
  color: var(--muted);
  font-size: 0.8125rem;
}

.share-book-more {
  color: var(--forest);
  font-weight: 600;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.share-note {
  font-size: 0.9375rem;
  color: var(--muted);
}

.subpage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.share-card .subpage-actions .button {
  padding: 12px 18px;
}

/* Centered Status Cards (Activation / 404 / 503) */
.status-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  padding: clamp(28px, 5vw, 44px) clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow-soft);
}

.status-card.tone-forest {
  background:
    radial-gradient(75% 55% at 50% 0%, var(--forest-soft), transparent 72%),
    var(--card);
}

.status-card.tone-ribbon {
  background:
    radial-gradient(75% 55% at 50% 0%, var(--ribbon-soft), transparent 72%),
    var(--card);
}

.status-card h1 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.status-visual {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.status-halo {
  position: absolute;
  inset: -20px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.status-halo .story-halo {
  position: static;
  width: 136px;
  height: 136px;
  opacity: 0.14;
  color: var(--forest);
}

.status-card.tone-ribbon .status-halo .story-halo {
  color: var(--ribbon);
}

.status-icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-icon svg {
  width: 28px;
  height: 28px;
}

.status-icon.tone-forest {
  background: var(--forest);
  color: var(--on-forest);
  box-shadow: 0 12px 24px -10px rgba(18, 112, 74, 0.55);
}

.status-icon.tone-ribbon {
  background: var(--ribbon-soft);
  color: var(--ribbon);
  border: 1px solid var(--line);
}

.status-seal {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  color: var(--forest);
}

.status-seal > svg {
  width: 68px;
  height: 68px;
}

.status-seal .seal-check {
  position: absolute;
  display: inline-flex;
  color: var(--on-forest);
}

.status-seal .seal-check svg {
  width: 24px;
  height: 24px;
}

.status-code {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-body {
  max-width: 38ch;
  font-size: 0.9375rem;
  color: var(--muted);
}

.status-card .subpage-actions {
  justify-content: center;
  width: 100%;
  padding-top: 8px;
}

.status-form {
  display: contents;
}

/* Editorial Document Page (Privacy Policy) */
.doc-article {
  width: min(100%, 760px);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  padding: clamp(24px, 4.5vw, 48px);
  box-shadow: var(--shadow-soft);
}

.doc-header {
  display: grid;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.doc-header h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.1;
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.doc-body {
  display: grid;
  gap: 14px;
  font-size: 0.96875rem;
  line-height: 1.68;
}

.doc-body h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.doc-body ul,
.doc-body ol {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.doc-body li::marker {
  color: var(--forest);
}

/* =============================================================================
   Responsive Breakpoints (1440px, 920px, 720px, 390px, 320px)
   ============================================================================= */
@media (max-width: 920px) {
  .feature-split,
  .feature-split.is-reversed,
  .feature-bento,
  .journal-grid,
  .download-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-split.is-reversed .feature-media {
    order: 0;
    border-left: 0;
  }

  .feature-media {
    min-height: 310px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 26px 20px 0;
  }

  .showcase-device {
    width: min(100%, 236px);
    aspect-ratio: 9 / 10.6;
  }
}

@media (max-width: 720px) {
  .site-nav { display: none; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    gap: 28px;
    padding: 24px 20px 28px;
  }

  .hero::before {
    background: linear-gradient(180deg, rgba(13, 18, 16, 0.82) 0%, rgba(13, 18, 16, 0.62) 48%, rgba(13, 18, 16, 0.08) 78%);
  }

  .panel,
  .panel-ink {
    padding: 18px 16px;
  }

  .hero .phone-frame {
    width: min(100%, 248px);
  }

  .bars-chart { gap: 2px; }
  .bar-btn { padding: 4px 0; min-width: 0; }
  .bar-month { width: 18px; height: 18px; font-size: 0.6875rem; }

  .seg { max-width: 100%; }
  .seg-btn { padding: 6px 10px; font-size: 0.8125rem; }

  .kpi-row { gap: 8px; }
  .kpi-tile { padding: 10px; }
  .kpi-val { font-size: 1.0625rem; }

  .download-band {
    padding: 26px 20px;
  }

  .share-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .share-visual {
    min-height: 184px;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .brand span {
    font-size: 0.9375rem;
  }

  .header-tools {
    gap: 6px;
  }

  .header-install {
    padding: 0 11px;
    font-size: 0.8125rem;
    min-height: 36px;
  }

  .header-install svg {
    display: none;
  }

  .lang-link,
  .icon-btn {
    min-width: 36px;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0 6px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .download-actions .button,
  .subpage-actions .button {
    width: 100%;
  }

  .subpage-stage {
    min-height: auto;
    padding-block: 12px 24px;
  }
}
