/* ═══════════════════════════════════════════════════════════════════
 * foliocampus.com — landing-page stylesheet
 * ═══════════════════════════════════════════════════════════════════
 *
 * Loads on every public page (index.html, folio.html, institutions.html,
 * privacy.html, terms.html, accessibility.html). Palette mirrors the
 * Folio app (src/renderer/src/app.css) for visual continuity between
 * the marketing surface and the installed product.
 *
 * File layout (top-to-bottom):
 *   1. Design tokens (the dictionary — every magic value used elsewhere
 *      should reference these)
 *   2. Reset + page chrome (body, main, light/dark theme, mobile chrome)
 *   3. Hero + downloads + ghost button
 *   4. Language tabs (he/ar/en toggle)
 *   5. Section systems: explain, trust, share, bring, faq, institutions
 *   6. Send-to-laptop (mobile-only)
 *   7. Footer
 *   8. Legal-page (privacy/terms/accessibility) layout
 *   9. Institutions handout (vertical card layout)
 *  10. Mobile tightening (≤600px overrides)
 *
 * Locked rules echoed by this file:
 *   - "No emojis" → SVG icons in HTML (cf. feedback_folio_no_emojis)
 *   - "Attention to detail" → considered easing curves, never default ease
 *   - "Three languages equal weight" → every visible string passes through
 *     a language toggle that hides non-active blocks
 *
 * ───────────────────────────────────────────────────────────────────── */

/* ── 1. Design tokens — the dictionary ─────────────────────────────────
 *
 * Every common value used by this stylesheet (colors, spacing, easing,
 * timing) lives here. When you change a token, every consumer updates
 * automatically. When you reach for a value, look here first.
 *
 *   COLORS
 *     --bg / --bg-2          → page background, secondary surface tint
 *     --fg / --fg-muted /
 *     --fg-faint             → text color stack: primary → secondary → tertiary
 *     --accent / -deep /
 *     -bright / -warm / -soft → accent palette: primary CTA, gradient ends,
 *                                gradient tops, hover lift, soft tint
 *     --border               → 1px hairline color
 *
 *   SHAPE
 *     --radius / --radius-sm → pill/card corner / smaller controls
 *
 *   MOTION
 *     --t-base               → 220ms — most hover/transition transitions
 *     --ease-out             → considered ease, never default
 *
 * Palette: "Sky Soft" — locked 2026-05-06. Mirrors app.css.
 */
:root {
  /* Color tokens */
  --bg: #f0f9ff;                /* sky-tinted canvas (whole page) */
  --bg-2: #e0f2fe;              /* card surfaces, hover states */
  --fg: #0c2340;                /* primary text — deep navy, max contrast */
  --fg-muted: #506980;          /* secondary text — labels, captions */
  --fg-faint: #7e9bbb;          /* tertiary text — fine print, meta */
  --accent: #0284c7;            /* primary CTA, focus ring (sky-600) */
  --accent-deep: #075985;       /* gradient ends, hover-press (sky-800) */
  --accent-bright: #38bdf8;     /* gradient tops, light accents (sky-400) */
  --accent-warm: #7dd3fc;       /* hover-lift kicker (sky-300) */
  --accent-soft: #e0f2fe;       /* soft tint backgrounds (sky-100) */
  --border: #cce4f5;            /* hairline divider, card outline */

  /* Shape tokens */
  --radius: 10px;               /* default for cards, pills, large buttons */
  --radius-sm: 6px;             /* smaller controls, inline tags */

  /* Motion tokens */
  --t-base: 220ms;              /* hover-state default */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);  /* settle ease — never default ease */
}

/* Landing page stays in the app's light theme regardless of OS dark mode.
   The app itself uses `[data-theme]` toggling — not OS-driven — so a
   media-query auto-flip on the site would just create a mismatch. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
               "Helvetica Neue", "Heebo", "Assistant", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 18px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle gradient mesh — three radial blooms in the brand accent that
   sit far behind everything. Adds depth without ever pulling focus.
   Pinned to the page, not the viewport, so it scrolls with content. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 700px at 12% -8%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(ellipse 800px 600px at 100% 30%, rgba(7, 89, 133, 0.08), transparent 60%),
    radial-gradient(ellipse 700px 500px at 28% 78%, rgba(125, 211, 252, 0.06), transparent 65%),
    radial-gradient(ellipse 500px 350px at 75% 100%, rgba(7, 89, 133, 0.05), transparent 70%);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 88px 24px 96px;
  position: relative;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-bottom: 24px;
}

/* Staggered hero entrance — every direct child of .hero rises gently and
   fades in. Each step ~140ms after the previous. Subtle, not flashy:
   opacity + slight Y-shift only. No blur (smudges crisp typography). */
.hero > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 850ms var(--ease-out) forwards;
}
.hero > *:nth-child(1) { animation-delay: 100ms; }
.hero > *:nth-child(2) { animation-delay: 260ms; }
.hero > *:nth-child(3) { animation-delay: 420ms; }
.hero > *:nth-child(4) { animation-delay: 580ms; }
.hero > *:nth-child(5) { animation-delay: 740ms; }
.hero > *:nth-child(6) { animation-delay: 900ms; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.logo-wrap {
  position: relative;
  width: 260px;
  height: 140px;
  margin-bottom: 4px;
}

/* Floating dots that gently drift inward — the "scattered → tidy" feel.
   Each dot starts at a random position and slowly drifts toward center,
   then pauses, fades back, repeats. Animation is subtle, ~6s per cycle. */
.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: drift 6s var(--ease-out) infinite;
}
.dot-1 { top:  10%; left:  10%; animation-delay: 0s; }
.dot-2 { top:  15%; right:  8%; animation-delay: 1.1s; }
.dot-3 { bottom: 12%; left: 15%; animation-delay: 2.4s; }
.dot-4 { bottom:  8%; right: 12%; animation-delay: 3.7s; }
.dot-5 { top:  50%; left:   2%; animation-delay: 4.9s; }

@keyframes drift {
  0%   { transform: translate(0, 0)         scale(1);   opacity: 0; }
  20%  {                                                opacity: 0.7; }
  60%  { transform: translate(var(--dx, -42px), var(--dy, 42px)) scale(0.4); opacity: 0.9; }
  85%  {                                                opacity: 0; }
  100% { transform: translate(0, 0)         scale(1);   opacity: 0; }
}
.dot-1 { --dx:  42px; --dy:  42px; }
.dot-2 { --dx: -38px; --dy:  38px; }
.dot-3 { --dx:  35px; --dy: -35px; }
.dot-4 { --dx: -38px; --dy: -38px; }
.dot-5 { --dx:  50px; --dy:   0;   }

/* The wordmark in the center — the destination the dots drift toward.
   Pure typography (no enclosing pill); a soft accent halo glows behind
   it and breathes in counter-phase, giving a subtle "alive but calm" feel. */
.folio-mark {
  position: absolute;
  inset: 50% 0 0 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 76px;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, serif;
  background: linear-gradient(180deg, var(--accent) 0%, #075985 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  animation: breathe 4.5s ease-in-out infinite;
  z-index: 1;
}

.folio-mark::before {
  content: "";
  position: absolute;
  inset: -24px -32px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2, 132, 199, 0.18) 0%, rgba(2, 132, 199, 0) 70%);
  z-index: -1;
  animation: halo 4.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.035); }
}

@keyframes halo {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .folio-mark, .folio-mark::before { animation: none; }
  .dot { opacity: 0.6; transform: translate(var(--dx), var(--dy)) scale(0.5); }
  .hero > * { animation: none; opacity: 1; transform: none; }
  .explain ul.proven-list li { opacity: 1; transform: none; transition: none; }
  .btn.primary::after { display: none; }
}

/* Slogan — larger, more dramatic, with a subtle tracking-tight signature feel. */
.slogan {
  font-size: clamp(40px, 7.5vw, 84px);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--fg);
  background: linear-gradient(180deg, var(--fg) 0%, #4a5160 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Typing-indicator dots after the slogan — each dot fades + lifts in
   sequence, like Folio is "working on you." Three real <span> dots so
   we can stagger them independently; the parent .dots gives spacing. */
.slogan .dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  margin-inline-start: 14px;
  vertical-align: baseline;
  height: 1em;
}
.slogan .dots > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #075985);
  -webkit-text-fill-color: initial;
  display: inline-block;
  opacity: 0.25;
  transform: translateY(0);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.slogan .dots > span:nth-child(1) { animation-delay: 0s; }
.slogan .dots > span:nth-child(2) { animation-delay: 0.18s; }
.slogan .dots > span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0) scale(0.85); }
  30%           { opacity: 1;    transform: translateY(-6px) scale(1); }
}

/* @keyframes blink — superseded by dotPulse, kept here in case we
   want to revert to a simpler animation later. */

.lede {
  font-size: clamp(18px, 1.6vw, 26px);
  color: var(--fg-muted);
  margin: 0 auto;
  max-width: 640px;
  line-height: 1.6;
  font-weight: 400;
  text-align: center;
}

/* ── Downloads ────────────────────────────────────────────── */

.downloads {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: clamp(14px, 1.2vw, 18px) clamp(24px, 2.2vw, 36px);
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
  transition: transform var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(7, 89, 133, 0.18);
  position: relative;
}
.btn.primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(7, 89, 133, 0.24);
}
.btn.primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(7, 89, 133, 0.18); }

/* Ghost — for "What is Folio?" secondary action */
.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 500;
}
.btn.ghost:hover {
  background: var(--bg-2);
  border-color: var(--accent);
  color: var(--accent);
}

.btn .icon { font-size: 18px; }

.subtle {
  margin: 8px 0 0;
  font-size: clamp(14px, 1.05vw, 16px);
  color: var(--fg-muted);
}

/* ── Send-to-laptop (mobile only) ──────────────────────────── */
.send-to-laptop {
  text-align: center;
  margin-top: 4px;
  animation: fadeIn 600ms 200ms var(--ease-out) both;
}
.send-to-laptop[hidden] { display: none; }
.btn-laptop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-base), transform var(--t-base);
}
.btn-laptop:hover { background: var(--bg-2); transform: translateY(-1px); }
.btn-laptop:active { transform: translateY(0); }
.btn-laptop .laptop-icon { color: var(--fg-muted); flex-shrink: 0; }
.laptop-hint {
  font-size: 13.5px;
  color: var(--fg-muted);
  margin: 8px 0 0;
  line-height: 1.5;
  max-width: 360px;
  margin-inline: auto;
}

/* ── Language tabs ────────────────────────────────────────── */

.lang-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 56px 0 24px;
  padding: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  width: max-content;
  margin-inline: auto;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.lang-tab {
  background: transparent;
  border: 0;
  padding: 11px 26px;
  font-size: 15px;
  color: var(--fg-muted);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 999px;
  transition: background var(--t-base), color var(--t-base);
  letter-spacing: 0.01em;
}
.lang-tab:hover { color: var(--fg); background: rgba(0,0,0,0.03); }
/* Global language toggle: hide non-active language blocks across the site.
   Section-specific rules below (.explain > div.active, etc.) override the
   default display value (block/grid) when the block becomes active. */
[data-lang-content] > [data-lang] { display: none; }
[data-lang-content] > [data-lang].active { display: block; animation: langFade 300ms var(--ease-out); }
.downloads[data-lang-content] > [data-lang].active { display: flex; gap: 8px; flex-wrap: wrap; animation: langFade 300ms var(--ease-out); }

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

.lang-tab.active {
  background: var(--bg);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}

/* ── Explain section ──────────────────────────────────────── */

.explain {
  max-width: 600px;
  margin: 0 auto;
}

.explain > div { display: none; }
.explain > div.active { display: block; animation: fadeIn 350ms var(--ease-out); }

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

.explain h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.explain ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.explain li {
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--accent);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
}
.explain li strong { color: var(--accent); display: block; margin-bottom: 2px; }

/* ── Proven list (a more concrete, honest "what works today" block) ── */

.proven-h2 {
  margin-top: 56px !important;
}

.proven-lede {
  font-size: 14px;
  color: var(--fg-muted);
  margin: -8px 0 18px;
  font-style: italic;
}

.explain ul.proven-list {
  gap: 8px;
}

.explain ul.proven-list li {
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-inline-start: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}
.explain ul.proven-list li:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.10);
}

.explain ul.proven-list li em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

/* Scroll-reveal: items fade-up as they enter the viewport (JS adds .in-view). */
.explain ul.proven-list li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.explain ul.proven-list li.in-view {
  opacity: 1;
  transform: translateY(0);
}

.proven-list .check {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #075985);
  display: inline-block;
  margin-top: 8px;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.08);
}

/* ── Share with a friend ─────────────────────────────────────── */

.share {
  max-width: 760px;
  margin: 56px auto 0;
  padding: 0 24px;
  text-align: center;
}
.share-line {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 14px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 200ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.share-btn.whatsapp {
  /* Toned-down WhatsApp green — bright but not neon. Drops the saturated
     #25D366 to a calmer tealed-green that matches the page palette. */
  background: #1ea660;
  color: white;
  box-shadow: 0 3px 10px rgba(30, 166, 96, 0.18);
}
.share-btn.whatsapp:hover {
  background: #178f50;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(30, 166, 96, 0.24);
}
.share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Bring Folio to your university ─────────────────────────── */

.bring {
  max-width: 760px;
  margin: 64px auto 0;
  padding: 36px 28px 32px;
  text-align: center;
}
.bring-h {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink);
}
.bring-block { display: none; }
.bring-block.active { display: block; }

.bring-lede {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(15, 23, 42, 0.85);
  margin: 0 0 22px;
}

.bring-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22);
  transition: transform 120ms ease, box-shadow 200ms ease;
  margin-bottom: 28px;
}
.bring-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.32);
}
.bring-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.bring-cta-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 200ms ease;
}
.bring-cta:hover .bring-cta-arrow {
  transform: translateX(3px);
}
[dir="rtl"] .bring-cta:hover .bring-cta-arrow,
.bring-block[dir="rtl"] .bring-cta:hover .bring-cta-arrow {
  transform: translateX(-3px);
}

.bring-help {
  font-size: 15px;
  margin: 0 0 18px;
  color: rgba(15, 23, 42, 0.72);
  font-weight: 500;
}

.bring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0 0 22px;
  text-align: start;
}
.bring-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(2, 132, 199, 0.14);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 160ms ease, transform 160ms ease;
}
.bring-card:hover {
  border-color: rgba(2, 132, 199, 0.32);
  transform: translateY(-1px);
}
.bring-card strong {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.bring-card span {
  font-size: 14px;
  color: rgba(15, 23, 42, 0.78);
  line-height: 1.45;
}
.bring-card code {
  background: rgba(2, 132, 199, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: ui-monospace, Menlo, monospace;
}

.bring-foot {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
}

/* ── FAQ ─────────────────────────────────────────────────────── */

.faq {
  max-width: 760px;
  margin: 64px auto 48px;
  padding: 0 24px;
}
.faq-h {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--ink);
}
.faq-item {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 14px 0;
}
.faq-item:last-of-type { border-bottom: 1px solid rgba(15, 23, 42, 0.08); }
.faq-item summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  list-style: none;
  outline: none;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+';
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.10);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  transition: transform 200ms;
}
.faq-item[open] summary::before {
  content: '−';
  transform: rotate(0);
  background: var(--accent);
  color: white;
}
.faq-item p {
  margin: 8px 0 4px 32px;
  color: rgba(15, 23, 42, 0.80);
  font-size: 15px;
  line-height: 1.65;
}

/* ── Download modal ─────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 22, 36, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease-out);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 24px 64px rgba(15, 22, 36, 0.30),
    0 8px 24px rgba(7, 89, 133, 0.18);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px 28px 22px;
  text-align: start;
  transform: translateY(12px) scale(0.98);
  transition: transform 320ms var(--ease-out);
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms var(--ease-out),
              color 180ms var(--ease-out),
              border-color 180ms var(--ease-out),
              transform 120ms var(--ease-out);
}
.modal-close:hover {
  background: var(--bg-2);
  color: var(--fg);
  border-color: var(--fg-faint);
  transform: scale(1.05);
}
.modal-close:active { transform: scale(0.95); }

.modal-head {
  margin-bottom: 18px;
}

.platform-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 10px;
}

.modal-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--fg);
}

.modal-meta {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

.modal-cta {
  width: 100%;
  justify-content: center;
  margin: 18px 0 22px;
  padding: 16px 24px;
  font-size: 16px;
}

/* ───── Registration form (download gate) ───── */

.register-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* Smooth state transitions — when the modal swaps from registration
   form to install steps (after successful submit), each section eases
   in with a fade + tiny rise. The .hidden class fully removes the
   element from layout; the keyframe runs on whichever is currently
   visible to feel like a "card flip" without the literal flip. */
.register-form,
.install-state {
  animation: form-state-in 360ms var(--ease-out) both;
}
.register-form.hidden,
.install-state.hidden {
  display: none;
}
@keyframes form-state-in {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Each form field also rises slightly in sequence when the form first
   appears — staggered cascade, ~60ms per row, makes the form feel
   "assembled" rather than dumped. Field-by-field, not row-by-row. */
.register-form > * {
  opacity: 0;
  transform: translateY(6px);
  animation: form-field-in 360ms var(--ease-out) forwards;
}
.register-form > *:nth-child(1) { animation-delay: 80ms; }
.register-form > *:nth-child(2) { animation-delay: 130ms; }
.register-form > *:nth-child(3) { animation-delay: 180ms; }
.register-form > *:nth-child(4) { animation-delay: 230ms; }
.register-form > *:nth-child(5) { animation-delay: 280ms; }
.register-form > *:nth-child(6) { animation-delay: 330ms; }
.register-form > *:nth-child(7) { animation-delay: 380ms; }
.register-form > *:nth-child(8) { animation-delay: 430ms; }
@keyframes form-field-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .register-form,
  .install-state,
  .register-form > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.register-intro {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.5;
}

/* Friendly-but-mandatory welcome banner above the form fields. Soft
   accent tint, wave emoji on the start side, two-line layout: a bold
   greeting + a quiet explanation. Sets a warm tone before the user
   sees required fields. */
.register-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.register-banner-icon {
  font-size: 22px;
  line-height: 1.1;
  flex-shrink: 0;
}
.register-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  line-height: 1.45;
}
.register-banner-text strong {
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
}

.reg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reg-row-2col {
  flex-direction: row;
  gap: 10px;
}
.reg-row-2col .reg-field { flex: 1; }

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reg-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
}

.reg-field-hint {
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
  color: var(--fg-faint);
}

.reg-field input[type="text"],
.reg-field input[type="email"],
.reg-field select {
  padding: 11px 12px;
  font-size: 14.5px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--fg);
  font-family: inherit;
  font-weight: 400;
  cursor: text;
  transition: border-color 180ms var(--ease-out),
              box-shadow 180ms var(--ease-out),
              background 180ms var(--ease-out);
}
.reg-field select { cursor: pointer; }
.reg-field input:hover,
.reg-field select:hover {
  border-color: var(--fg-faint);
}
.reg-field input:focus,
.reg-field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fbfdff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.14);
}

.reg-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1.5;
  transition: background var(--t-base), border-color var(--t-base);
}
.reg-checkbox:hover {
  background: #ffffff;
  border-color: var(--fg-faint);
}
.reg-checkbox input {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.reg-checkbox a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.reg-checkbox a:hover { color: var(--accent-deep); }

.register-no-spam {
  margin: 4px 0 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}

.register-submit {
  width: 100%;
  justify-content: center;
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.005em;
}
.register-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 480px) {
  .reg-row-2col { flex-direction: column; gap: 12px; }
}

.btn.primary.coming-soon {
  background: linear-gradient(180deg, #9aa4b8 0%, #6b7689 100%);
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}
.btn.primary.coming-soon:hover { transform: none; box-shadow: none; }
.btn.primary.coming-soon::after { display: none; }

.modal-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.08);
}

.step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14.5px;
  line-height: 1.45;
}
.step-text strong {
  font-weight: 600;
  color: var(--fg);
}
.step-text .small { font-size: 13px; }

.modal-foot {
  margin: 18px 0 0;
  text-align: center;
}

@media (max-width: 480px) {
  .modal { padding: 24px 20px 18px; }
  .modal-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop { transition: none; }
  .modal { transition: none; }
}

/* ── Trust section (privacy / accessibility / pricing summary) ── */

.trust {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 600px;
  margin-inline: auto;
}

.trust > div { display: none; }
.trust > div.active { display: block; }

.trust h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 6px;
  color: var(--accent);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.trust h3::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #075985);
  display: inline-block;
}
.trust h3:first-child { margin-top: 0; }

.trust p {
  font-size: 14.5px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Institutions banner ─────────────────────────────────── */

.institutions {
  margin: 80px auto 0;
  max-width: 720px;
  text-align: center;
  padding: 36px 32px 32px;
  background: linear-gradient(180deg, rgba(7, 89, 133, 0.04) 0%, rgba(7, 89, 133, 0.07) 100%);
  border: 1px solid rgba(7, 89, 133, 0.14);
  border-radius: 16px;
  position: relative;
}
.institutions::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 0%, rgba(7, 89, 133, 0.06), transparent 60%);
  pointer-events: none;
}
.institutions-h {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--fg);
  letter-spacing: -0.015em;
}
.institutions-lede {
  font-size: clamp(17px, 1.4vw, 21px);
  color: var(--fg);
  margin: 0 0 24px;
  line-height: 1.55;
  max-width: 620px;
  margin-inline: auto;
  font-weight: 500;
}
.institutions-cta {
  /* Institutional CTA — deeper, calmer slate-navy. Reads "business
     partnership" rather than "consumer download" — distinct register from
     the bright sky-blue .btn.primary. Warm enough to still feel inviting. */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #1f3a5e;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(31, 58, 94, 0.20);
  transition: background var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.institutions-cta:hover {
  background: #284e7d;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(31, 58, 94, 0.28);
}
.institutions-fine {
  font-size: 12.5px;
  color: var(--fg-faint);
  margin: 14px 0 0;
}

@media (max-width: 600px) {
  .institutions { margin-top: 56px; padding: 28px 20px 24px; }
  .institutions-cta { width: 100%; justify-content: center; }
}

/* ── Footer ───────────────────────────────────────────────── */

footer {
  margin-top: 64px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.muted { color: var(--fg-muted); }
.small { font-size: 13px; }

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

.legal-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
  font-size: 13px;
}

.copyright {
  margin: 8px 0 0;
}

/* ── Legal pages (privacy / terms / accessibility) ─────────── */

body.legal-page main {
  max-width: 720px;
  padding: 40px 24px 80px;
}

.legal-page article {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.legal-page h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.legal-page h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 8px;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.legal-page h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 6px;
  color: var(--fg);
}

.legal-page p,
.legal-page ul,
.legal-page ol {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--fg);
  margin: 0 0 8px;
}

.legal-page ul { padding-inline-start: 22px; }
.legal-page li { margin-bottom: 4px; }

.legal-page .legal-meta {
  font-size: 12.5px;
  color: var(--fg-faint);
  margin-bottom: 18px;
}

.legal-page .legal-lede {
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 28px;
}

.legal-page hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 48px 0 32px;
}

.legal-page code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.legal-page .back {
  margin: 0 0 20px;
  font-size: 13px;
}
.legal-page .back a { color: var(--fg-muted); text-decoration: none; }
.legal-page .back a:hover { color: var(--accent); }

/* ── Institutions handout ─────────────────────────────────── */

body.institutions-page main { max-width: 920px; }
.institutions-page article { padding: 40px 36px; }
.institutions-page .inst-header h1 {
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.2;
  margin-bottom: 6px;
}
.institutions-page .inst-en {
  font-size: 0.7em;
  color: var(--fg-muted);
  font-weight: 500;
  letter-spacing: 0;
}
.institutions-page .inst-meta {
  font-size: 13px;
  color: var(--fg-faint);
  margin: 0 0 28px;
}

.institutions-page .inst-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.institutions-page .inst-col p { font-size: 15.5px; line-height: 1.65; margin: 0; }

.institutions-page .inst-callout {
  background: linear-gradient(180deg, rgba(7, 89, 133, 0.05) 0%, rgba(7, 89, 133, 0.10) 100%);
  border: 1px solid rgba(7, 89, 133, 0.20);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 8px 0 36px;
}
.institutions-page .inst-callout strong {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.institutions-page .inst-callout p {
  font-size: 14.5px;
  line-height: 1.6;
  margin: 4px 0;
}
.institutions-page .inst-callout em { font-style: italic; }

.institutions-page table.inst-tiers {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 36px;
  font-size: 13.5px;
}
.institutions-page table.inst-tiers th,
.institutions-page table.inst-tiers td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  vertical-align: top;
  text-align: start;
  line-height: 1.55;
}
.institutions-page table.inst-tiers thead th {
  background: var(--bg);
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
}
.institutions-page table.inst-tiers .t-num {
  width: 96px;
  background: var(--bg);
  text-align: center;
  font-size: 14px;
}
.institutions-page table.inst-tiers .t-num strong {
  display: block;
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.institutions-page table.inst-tiers .t-num span {
  font-size: 12px;
  color: var(--fg-muted);
}
.institutions-page table.inst-tiers tr.t-highlight td {
  background: rgba(7, 89, 133, 0.04);
}
.institutions-page table.inst-tiers tr.t-highlight .t-num {
  background: rgba(7, 89, 133, 0.08);
}
.institutions-page .status-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 5px 9px;
  border-radius: 5px;
  letter-spacing: 0.01em;
  text-align: center;
}
.institutions-page .status-now {
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.25);
}
.institutions-page .status-build {
  background: rgba(7, 89, 133, 0.10);
  color: var(--accent-deep);
  border: 1px solid rgba(7, 89, 133, 0.30);
}
.institutions-page .status-future {
  background: rgba(120, 113, 108, 0.10);
  color: #57534e;
  border: 1px solid rgba(120, 113, 108, 0.25);
}

.institutions-page .inst-invariants,
.institutions-page .inst-compliance,
.institutions-page .inst-meeting {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 8px 0 24px;
  padding-inline-start: 24px;
}
.institutions-page .inst-invariants li,
.institutions-page .inst-compliance li,
.institutions-page .inst-meeting li {
  margin-bottom: 8px;
}
.institutions-page .inst-invariants em,
.institutions-page .inst-compliance em {
  color: var(--fg-muted);
  font-style: normal;
  font-size: 0.92em;
}

.institutions-page .inst-contact {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.institutions-page .inst-contact h2 {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}
.institutions-page .inst-contact p { font-size: 14.5px; line-height: 1.65; margin: 0; }
.institutions-page .inst-contact a { color: var(--accent); font-weight: 500; }
.institutions-page .inst-print-hint {
  grid-column: 1 / -1;
  margin-top: 12px !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-muted);
}
.institutions-page .inst-print-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-inline-start: 6px;
  transition: background var(--t-base), color var(--t-base);
}
.institutions-page .inst-print-btn:hover { background: var(--accent); color: #fff; }

@media (max-width: 720px) {
  .institutions-page .inst-intro { grid-template-columns: 1fr; }
  .institutions-page .inst-contact { grid-template-columns: 1fr; }
  .institutions-page table.inst-tiers { font-size: 12.5px; }
  .institutions-page table.inst-tiers th,
  .institutions-page table.inst-tiers td { padding: 10px 10px; }
  .institutions-page table.inst-tiers .t-num { width: 70px; }
}

@media print {
  body.institutions-page { background: #fff; }
  .institutions-page .back,
  .institutions-page .inst-print-hint { display: none; }
  .institutions-page article { border: 0; padding: 0; background: #fff; }
  .institutions-page table.inst-tiers { font-size: 11px; page-break-inside: avoid; }
  .institutions-page .inst-callout,
  .institutions-page .inst-contact { page-break-inside: avoid; }
}

/* ── Mobile tightening ────────────────────────────────────── */

@media (max-width: 600px) {
  main { padding: 40px 18px 60px; }
  .slogan { font-size: 36px; }
  .lede { font-size: 17px; max-width: 100%; }
  .downloads { width: 100%; }
  .btn { width: 100%; justify-content: center; padding: 14px 22px; font-size: 15px; }
  .subtle { font-size: 13px; }
  .lang-tabs { margin: 48px auto 16px; }
  .lang-tab { padding: 9px 20px; font-size: 14px; }
}
