/* ===== MATH Keys — shared site styles =====
   Palette and typography follow the extension's style guide
   (chrome_extention/math_extention_main.css): mint keys, deep
   teal-green ink, the #589983→#3C7871 gradient, Fira Sans. */
:root {
  --ink: #212529;
  --ink-muted: #5a6862;
  --heading: #022e16;
  --accent: #3C7871;
  --accent-dark: #2e5f59;
  --grad: linear-gradient(#589983, #3C7871);
  --grad-hover: linear-gradient(#66a893, #458a80);
  --key-bg: #DCEEE7;
  --key-bg-hover: #C7E5D9;
  --key-bg-active: #B3DBC9;
  --key-text: #0B4A3B;
  --bg: #ffffff;
  --bg-soft: #f3f7f5;
  --bg-mint: #e8f3ee;
  --border: #d8e3de;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(2, 46, 22, 0.07);
  --shadow-soft: 0 2px 12px rgba(2, 46, 22, 0.05);
  --maxw: 1120px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  font-family: "Fira Sans", "Segoe UI", Roboto, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100%;
}

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--heading); }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 247, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.94);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  min-height: var(--header-h);
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  color: var(--accent);
  white-space: nowrap;
  z-index: 2;
}

.brand-logo {
  width: 24px;
  height: 24px;
  display: block;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--ink); font-weight: 400; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.main-nav a {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.main-nav a:hover {
  background: var(--key-bg);
  text-decoration: none;
  color: var(--key-text);
}
.main-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--heading);
  cursor: pointer;
  z-index: 2;
}

.nav-toggle-bars {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, transform 0.15s var(--ease), background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

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

.btn-key { background: var(--key-bg); color: var(--key-text); }
.btn-key:hover { background: var(--key-bg-hover); color: var(--key-text); }
.btn-key:active { background: var(--key-bg-active); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

.btn-text {
  background: transparent;
  color: var(--key-text);
  padding: 10px 14px;
  font-weight: 600;
}
.btn-text:hover { color: var(--accent); transform: none; }

.header-cta {
  white-space: nowrap;
  padding: 7px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.header-actions .header-cta + .header-cta {
  margin-left: 0;
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }

  .header-actions {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 88vw);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: calc(var(--header-h) + 16px) 20px 28px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(2, 46, 22, 0.08);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
    z-index: 1;
  }

  body.nav-open .header-actions {
    transform: translateX(0);
  }

  .main-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    order: 2;
  }

  .main-nav a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .header-cta {
    order: -1;
    text-align: center;
    margin-bottom: 4px;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 46, 22, 0.28);
    z-index: 40;
  }

  body.nav-open .site-header { z-index: 51; }
}

/* ---------- Homepage hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 70% 40%, rgba(88, 153, 131, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(220, 238, 231, 0.9), transparent 50%),
    linear-gradient(165deg, #eef5f2 0%, #f7faf8 45%, #e3efe9 100%);
  color: var(--heading);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 40px 0 20px;
  max-width: 560px;
  animation: heroRise 0.85s var(--ease) both;
}

.hero-brand {
  margin: 0 0 14px;
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.05;
}

.hero-brand span {
  color: var(--heading);
  font-weight: 400;
}

.hero-headline {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.hero-tagline {
  margin: 0 0 28px;
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 420px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.hero-visual {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: auto;
  animation: heroFade 1s var(--ease) 0.15s both;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(48vh, 420px);
  object-fit: cover;
  object-position: top center;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 88%, transparent 100%);
}

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.15fr);
    align-items: center;
    gap: 32px;
    padding: 0;
    min-height: calc(100vh - var(--header-h));
  }

  .hero .container {
    display: contents;
  }

  .hero-copy {
    padding: 64px 0 64px 24px;
    margin-left: max(0px, calc((100vw - var(--maxw)) / 2));
    max-width: 480px;
  }

  .hero-visual {
    height: 100%;
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: stretch;
    margin: 0;
  }

  .hero-visual img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: left center;
    mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 100%);
  }
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Compatible apps (horizontal strip) ---------- */
.compat-band {
  position: relative;
  padding: 72px 0 64px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.compat-band-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.compat-band-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  text-align: center;
}

.compat-band-sub {
  margin: 0 auto 28px;
  text-align: center;
  color: var(--ink-muted);
  max-width: 40ch;
}

.compat-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 640px) {
  .compat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .compat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.compat-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.compat-grid li:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.compat-grid img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: block;
}

.compat-grid span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--key-text);
  text-align: center;
}

/* Open (non-sticky) content blocks */
.open-steps {
  display: grid;
  gap: 24px;
}

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

.open-step {
  display: flex;
  flex-direction: column;
  padding: 8px 0 0;
}

.open-step-num {
  display: block;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

/* Shared media slot so Click / Copy / Paste headings share one baseline */
.open-step > img,
.open-step-logos,
.paste-doc {
  display: block;
  width: 100%;
  height: 180px;
  flex: 0 0 180px;
  object-fit: contain;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-mint);
  border: 1px solid var(--border);
}

.open-step-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.open-step-logos img {
  width: 40px;
  height: 40px;
  margin: 0;
  border: none;
  background: transparent;
  height: auto;
}

/* Docs paste mock — same height as sibling step images */
.paste-doc {
  padding: 0;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.paste-doc-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 6px 10px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.paste-doc-chrome img {
  width: 16px;
  height: 16px;
  margin: 0;
  border: none;
  background: transparent;
  object-fit: contain;
}

.paste-doc-page {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 12px 12px;
  overflow: hidden;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(180deg, #fafbfc, #fff) border-box;
}

.paste-doc-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paste-doc-text {
  display: none;
}

.paste-doc-eq {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  max-height: 88px;
  margin: 0;
  padding: 6px 4px;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

.open-step h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.open-step > p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.open-features,
.open-graphs {
  display: grid;
  gap: 24px;
}

@media (min-width: 880px) {
  .open-features,
  .open-graphs {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

.open-feature img,
.open-graphs img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 14px;
}

.open-feature h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
}

.open-feature p {
  margin: 0 0 8px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.open-feature a {
  font-weight: 600;
  font-size: 0.92rem;
}

.open-graphs figure {
  margin: 0;
}

.open-graphs figcaption {
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
  color: var(--key-text);
  font-size: 0.9rem;
}

/* Modes button slideshow — dark green band */
.modes-band {
  background: #0f1f1a;
  color: #e8e6e3;
  padding-bottom: 64px;
}

.modes-band .section-head h2 {
  color: #fff;
}

.modes-band .section-head .sub {
  color: #b7c7c0;
}

.mode-show {
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .mode-show {
    grid-template-columns: 1.25fr 0.85fr;
    gap: 40px;
  }
}

.mode-show-stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.mode-show-frame {
  overflow: hidden;
  border-radius: var(--radius);
  background: #163028;
  border: 1px solid rgba(143, 221, 192, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  min-height: 240px;
}

.mode-show-frame img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}

.mode-show-frame img.is-switching {
  opacity: 0;
  transform: translateX(18px);
}

.show-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(143, 221, 192, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #8FDDC0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.show-nav:hover {
  background: rgba(143, 221, 192, 0.16);
  border-color: #8FDDC0;
  transform: scale(1.05);
}

.mode-show-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8FDDC0;
}

.mode-show-copy h3 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  color: #fff;
}

.mode-show-copy p {
  margin: 0;
  color: #b7c7c0;
  font-size: 1.05rem;
  max-width: 36ch;
}

.show-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.show-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease);
}

.show-dot.is-active {
  background: #8FDDC0;
  transform: scale(1.25);
}

/* legacy thin rail / horizontal scroll strip (unused) */
.compat-rail,
.compat-scroll,
.compat-scroll-hint { display: none; }

/* ---------- Cinematic sticky chapters (legacy; unused on home) ---------- */
.cine {
  --cine-frames: 3;
  position: relative;
  height: calc(var(--cine-frames) * 100vh);
  background: #fff;
}

.cine--dark {
  background: #0f1f1a;
  color: #e8e6e3;
}

.cine--dark .cine-kicker { color: #8FDDC0; }
.cine--dark .cine-panel h2 { color: #fff; }
.cine--dark .cine-panel p { color: #b7c7c0; }
.cine--dark .cine-progress { background: rgba(255, 255, 255, 0.12); }
.cine--dark .cine-progress > i { background: #8FDDC0; }
.cine--dark .cine-dots span { background: rgba(255, 255, 255, 0.22); }
.cine--dark .cine-dots span.is-active { background: #8FDDC0; }

.cine--mint {
  background: var(--bg-mint);
}

.cine-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 12px) 24px 32px;
  box-sizing: border-box;
}

.cine-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .cine-layout {
    grid-template-columns: minmax(260px, 0.92fr) minmax(300px, 1.15fr);
    gap: 48px;
  }
  .cine-layout--reverse {
    grid-template-columns: minmax(300px, 1.15fr) minmax(260px, 0.92fr);
  }
  .cine-layout--reverse .cine-copy { order: 2; }
  .cine-layout--reverse .cine-stage { order: 1; }
}

.cine-kicker {
  margin: 0 0 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.cine-panels {
  position: relative;
  min-height: 180px;
}

@media (min-width: 900px) {
  .cine-panels { min-height: 220px; }
}

.cine-panel {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  transform: translateX(48px);
  pointer-events: none;
  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease);
}

.cine-panel.is-past {
  opacity: 0;
  transform: translateX(-36px);
}

.cine-panel.is-ahead {
  opacity: 0;
  transform: translateX(48px);
}

.cine-panel.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.cine-index {
  display: block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.cine-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  color: var(--heading);
}

.cine-panel p {
  margin: 0;
  max-width: 34ch;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.cine-link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
}

.cine-progress {
  margin-top: 28px;
  height: 2px;
  width: 100%;
  max-width: 220px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.cine-progress > i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--accent);
  transition: transform 0.12s linear;
}

.cine-dots {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.cine-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease, transform 0.25s var(--ease);
}

.cine-dots span.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.cine-stage {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
}

.cine-stage--product {
  min-height: min(62vh, 560px);
}

.cine-shot {
  grid-area: 1 / 1;
  width: min(100%, 520px);
  height: auto;
  max-height: min(62vh, 560px);
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(2, 46, 22, 0.14);
  background: #fff;
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease);
  pointer-events: none;
}

.cine-shot.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cine--dark .cine-shot {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.cine-shot--logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 48px 28px;
  background: var(--bg-mint);
  border: 1px solid var(--border);
  min-height: 200px;
  width: min(100%, 420px);
  box-sizing: border-box;
}

.cine-shot--logos img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* Reduced-motion / compact: stack as normal sections */
@media (max-width: 640px) {
  .cine {
    height: auto !important;
  }
  .cine-pin {
    position: relative;
    height: auto;
    padding: 56px 20px;
  }
  .cine-panels {
    position: static;
    display: grid;
    gap: 28px;
    min-height: 0;
  }
  .cine-panel {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .cine-stage {
    display: none;
  }
  .cine-progress,
  .cine-dots {
    display: none;
  }
}

.cine--static {
  height: auto !important;
}
.cine--static .cine-pin {
  position: relative;
  height: auto;
  padding: 72px 24px;
}
.cine--static .cine-panels {
  position: static;
  display: grid;
  gap: 28px;
  min-height: 0;
}
.cine--static .cine-panel {
  position: static !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto;
}
.cine--static .cine-shot {
  position: relative;
  opacity: 1 !important;
  transform: none !important;
  margin-bottom: 16px;
}
.cine--static .cine-stage {
  display: grid;
  gap: 16px;
}
.cine--static .cine-shot:not(.is-active) {
  display: none;
}

/* Closing */
.closing {
  padding: 64px 0;
  background: #fff;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.closing.is-visible {
  opacity: 1;
  transform: none;
}

.closing-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 880px) {
  .closing-grid {
    grid-template-columns: 1.2fr 0.9fr;
    gap: 64px;
    align-items: start;
  }
}

.closing-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
}

.closing-copy > p {
  margin: 0 0 22px;
  color: var(--ink-muted);
  max-width: 46ch;
  font-size: 1.05rem;
}

.closing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.closing-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  color: var(--key-text);
}

.closing-cta {
  background: linear-gradient(145deg, #589983, #3C7871);
  color: #fff;
  padding: 36px 32px;
  border-radius: var(--radius);
}

.closing-cta h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.45rem;
}

.closing-cta p {
  margin: 0 0 22px;
  opacity: 0.92;
}

.closing-cta .btn {
  margin: 0 10px 10px 0;
}

.closing-cta .btn-primary {
  background: #fff;
  color: var(--accent);
}

.closing-cta .btn-primary:hover {
  background: var(--key-bg);
  color: var(--key-text);
}

.closing-cta .btn-outline {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.closing-cta .btn-outline:hover {
  background: #fff;
  color: var(--accent);
}

.section {
  padding: 80px 0;
}

.section.alt {
  background: var(--bg-soft);
}

.section-head {
  max-width: 560px;
  margin-bottom: 40px;
}

.section-head.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section h2 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.section .sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: calc(var(--reveal-i, 0) * 80ms);
}

.reveal-stagger.is-visible > *,
.reveal.is-visible .reveal-stagger > * {
  opacity: 1;
  transform: none;
}

/* Nested stagger inside a section.reveal */
.reveal .reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
}

.reveal.is-visible .reveal-stagger > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: calc(var(--reveal-i, 0) * 80ms);
}

/* how-to steps — lean numbered rows */
.steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.step-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px 28px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
  border-radius: var(--radius-sm);
}

.step-row:hover {
  background: var(--bg-mint);
  padding-left: 10px;
}

.step-num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  padding-top: 4px;
  transition: transform 0.25s var(--ease);
}

.step-row:hover .step-num {
  transform: translateX(4px);
}

.step-row h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: var(--heading);
}

.step-row p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 520px;
}

@media (min-width: 720px) {
  .step-row {
    grid-template-columns: 72px 160px 1fr;
    align-items: center;
  }

  .step-row img {
    width: 100%;
    height: 96px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-mint);
  }
}

.step-row img {
  display: none;
}

@media (min-width: 720px) {
  .step-row img { display: block; }
}

/* compatibility logos */
.compat-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.compat-label {
  text-align: center;
  margin: 0 0 22px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.compat-logos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 28px;
}

.compat-logos li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: default;
  transition: color 0.2s var(--ease), transform 0.25s var(--ease);
}

.compat-logos img {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.compat-logos li:hover {
  color: var(--key-text);
  transform: translateY(-4px);
}

.compat-logos li:hover img {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 24px rgba(2, 46, 22, 0.12);
}

.compat-line {
  text-align: center;
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: 0.01em;
}

.compat-line strong {
  color: var(--key-text);
  font-weight: 600;
}

.step-paste-visual {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 96px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-mint);
}

.step-paste-visual img {
  width: 36px;
  height: 36px;
  display: block !important;
  border-radius: 8px;
  background: transparent !important;
  height: auto !important;
  object-fit: contain;
}

@media (min-width: 720px) {
  .step-paste-visual { display: flex; }
}

/* feature showcase */
.feature-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.feature-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 8px;
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease);
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.feature-card:hover {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-4px);
}

.feature-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--bg-mint);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.feature-card:hover img {
  box-shadow: 0 14px 36px rgba(2, 46, 22, 0.12);
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.feature-card p {
  margin: 0 0 8px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.feature-card a {
  font-weight: 600;
  font-size: 0.92rem;
}

.graph-showcase {
  display: grid;
  gap: 20px;
}

@media (min-width: 880px) {
  .graph-showcase {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

.graph-showcase figure {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  margin: 0;
  transition: transform 0.25s var(--ease);
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.graph-showcase figure:hover {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-6px);
}

.graph-showcase img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  transition: box-shadow 0.3s var(--ease);
}

.graph-showcase figure:hover img {
  box-shadow: 0 16px 40px rgba(2, 46, 22, 0.12);
}

.graph-showcase figcaption {
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
  color: var(--key-text);
  font-size: 0.9rem;
}

.cap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

@media (min-width: 800px) {
  .cap-list {
    grid-template-columns: 1fr 1fr;
    gap: 16px 28px;
  }
}

.cap-list li {
  padding: 18px 20px;
  border-top: 2px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.cap-list li:hover {
  transform: translateY(-3px);
  background: var(--key-bg);
  box-shadow: var(--shadow-soft);
}

.cap-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
  font-size: 1.02rem;
}

.cap-list span {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.cap-list code {
  background: var(--key-bg);
  color: var(--key-text);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* visual callouts on content pages */
.visual-stack {
  display: grid;
  gap: 20px;
  margin: 28px 0;
}

.visual-stack img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-mint);
}

.howto-steps {
  counter-reset: howto;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.howto-steps li {
  counter-increment: howto;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  margin: 0;
}

.howto-steps li::before {
  content: counter(howto, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 4px;
}

.page-wide {
  max-width: var(--maxw);
}

/* ---------- Custom-buttons / guide pages ---------- */
.guide-intro {
  display: grid;
  gap: 28px;
  align-items: center;
  margin: 8px 0 40px;
}

@media (min-width: 880px) {
  .guide-intro {
    grid-template-columns: 1.15fr 0.95fr;
    gap: 40px;
  }
}

.guide-hero-shot {
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(220, 238, 231, 0.9), transparent 55%),
    linear-gradient(160deg, #eef6f2 0%, #f7faf8 55%, #e8f3ee 100%);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.guide-hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
}

.guide-intro-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
}

.guide-intro-copy > p {
  margin: 0 0 16px;
  color: var(--ink-muted);
}

.guide-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.guide-checklist li {
  position: relative;
  padding: 10px 14px 10px 38px;
  background: var(--bg-mint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.98rem;
}

.guide-checklist li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.guide-section-title {
  margin: 8px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.guide-step {
  display: grid;
  gap: 22px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.guide-step:last-child {
  border-bottom: none;
}

@media (min-width: 880px) {
  .guide-step {
    grid-template-columns: 1fr 1.05fr;
    gap: 36px;
  }

  .guide-step:nth-child(even) .guide-step-copy {
    order: 2;
  }

  .guide-step:nth-child(even) .guide-step-media {
    order: 1;
  }
}

.guide-step-num {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.guide-step-copy h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.guide-step-copy p {
  margin: 0 0 12px;
  color: var(--ink-muted);
}

.guide-step-copy p:last-child {
  margin-bottom: 0;
}

.guide-note {
  padding: 12px 14px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
}

.guide-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 0 0.35em;
  border: 1px dashed #9bb5ab;
  border-radius: 6px;
  background: #fff;
  color: var(--key-text);
  font-weight: 700;
  line-height: 1.4;
}

.guide-step-media {
  margin: 0;
  background: linear-gradient(165deg, #f4f9f6, #e8f3ee);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.guide-step-media--dialog {
  padding: 28px 24px;
}

.guide-step-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
}

.guide-step-media figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-align: center;
}

.guide-aside {
  margin: 12px 0 28px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}

.guide-aside--soft {
  background: var(--bg-mint);
}

.guide-aside h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.guide-aside > p {
  margin: 0 0 16px;
  color: var(--ink-muted);
}

.guide-aside > p:last-child {
  margin-bottom: 0;
}

.guide-examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.guide-examples div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.guide-examples code {
  font-size: 0.95rem;
  color: var(--key-text);
}

.guide-examples span {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* modes — featured stage + list */
.modes-stage {
  display: grid;
  gap: 36px;
  align-items: center;
}

@media (min-width: 880px) {
  .modes-stage {
    grid-template-columns: 1.2fr 0.9fr;
    gap: 48px;
  }
}

.modes-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-mint);
  min-height: 280px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.35s var(--ease);
}

.modes-visual:hover {
  box-shadow: 0 16px 40px rgba(2, 46, 22, 0.1);
}

.modes-visual img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  transition: opacity 0.28s var(--ease), transform 0.45s var(--ease);
}

.modes-visual img.is-fading {
  opacity: 0;
  transform: scale(0.985);
}

.mode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.mode-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.mode-list li[data-active="true"],
.mode-list li:hover {
  background: var(--key-bg);
  border-left-color: var(--accent);
  transform: translateX(4px);
}

.mode-list h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--key-text);
}

.mode-list p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* two-column (about, etc.) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split img {
  width: 100%;
  border-radius: var(--radius);
}

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

.split ul { padding-left: 20px; }
.split li { margin-bottom: 6px; }

/* page hero + content */
.page-hero {
  padding: 56px 0 40px;
  background:
    radial-gradient(700px 280px at 10% 0%, rgba(88, 153, 131, 0.14), transparent),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.page-hero .lead {
  margin: 0;
  max-width: 560px;
  font-size: 1.1rem;
  color: var(--ink-muted);
}

.page-content {
  padding: 48px 0 72px;
  max-width: 760px;
  margin: 0 auto;
}

.page-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
}

.page-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
  color: var(--key-text);
}

.page-content .lead {
  color: var(--ink-muted);
  font-size: 1.1rem;
}

.page-content code {
  background: var(--key-bg);
  color: var(--key-text);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.9em;
}

.page-content ul {
  padding-left: 1.25rem;
}

.page-content li {
  margin-bottom: 0.45rem;
  color: var(--ink);
}

/* tables */
.latex-table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

.latex-table th,
.latex-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.latex-table th {
  background: var(--key-bg);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--key-text);
}

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

.latex-table code {
  background: var(--key-bg);
  color: var(--key-text);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

label {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  transition: border-color 0.15s ease;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-status {
  display: none;
  color: var(--accent);
  font-weight: 600;
  margin-top: 12px;
}

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 8px;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid img {
  width: 100%;
  border-radius: var(--radius);
}

/* CTA band */
.cta-band {
  background:
    radial-gradient(600px 240px at 20% 0%, rgba(255, 255, 255, 0.12), transparent),
    linear-gradient(125deg, #589983, #3C7871);
  background-size: 100% 100%, 200% 200%;
  color: #fff;
  text-align: center;
  padding: 64px 24px;
  animation: ctaShift 12s ease-in-out infinite alternate;
}

@keyframes ctaShift {
  from { background-position: 0 0, 0% 50%; }
  to { background-position: 0 0, 100% 50%; }
}

.cta-band h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.cta-band p {
  margin: 0 auto 24px;
  max-width: 480px;
  opacity: 0.92;
}

.cta-band .btn {
  background: #fff;
  color: var(--accent);
  transition: transform 0.2s var(--ease), background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.cta-band .btn:hover {
  background: var(--key-bg);
  color: var(--key-text);
  box-shadow: 0 8px 24px rgba(2, 46, 22, 0.2);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--key-text);
  color: #cfe5db;
  padding: 40px 0;
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-footer a { color: #DCEEE7; }
.site-footer .brand { color: #8FDDC0; }
.site-footer .brand span { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy,
  .hero-visual,
  .hero-scroll-hint span,
  .closing {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .cine-panel,
  .cine-shot {
    transition: none !important;
  }
  .btn:hover { transform: none; }
  .header-actions { transition: none; }
}
