/* ============================================================
 * ApplyCH website — Swiss-modernist redesign
 * Design doc: docs/plans/2026-05-08-website-redesign-design.md
 * ============================================================ */

/* ---- 1. Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

/* ---- 2. Tokens ---- */
:root {
  /* Type */
  --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Color */
  --bg:          #FFFFFF;
  --bg-alt:      #F7F7F5;
  --bg-dark:     #0A0A0A;
  --ink:         #0A0A0A;
  --ink-2:       #3F3F3F;
  --muted:       #6E6E6E;
  --line:        #E5E5E5;
  --line-dark:   #1F1F1F;
  --accent:      #DC0018;       /* Swiss flag red */
  --accent-deep: #A50012;
  --ok:          #0F7B3F;

  /* Layout */
  --container:   1200px;
  --gutter:      32px;
  --gutter-mob:  20px;
  --section-y:   96px;
  --section-y-mob: 64px;

  /* Radius */
  --r-card: 8px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.22,.6,.36,1);
}

/* ---- 3. Body / type defaults ---- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

h1 { font-size: clamp(36px, 4.6vw, 56px); text-wrap: balance; }
h2 { font-size: clamp(30px, 3.6vw, 44px); text-wrap: balance; }
h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }

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

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

/* ---- 4. Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (max-width: 640px) {
  .container { padding-inline: var(--gutter-mob); }
}

main > section { padding-block: var(--section-y); }
@media (max-width: 768px) {
  main > section { padding-block: var(--section-y-mob); }
}

/* ---- 5. Eyebrow + signature red rule ---- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.rule {
  border: 0;
  height: 1px;
  width: 64px;
  background: var(--accent);
  margin: 24px 0;
}

/* ---- 6. Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
  cursor: pointer;
}
.btn-lg { padding: 14px 26px; font-size: 15px; }

.btn-red {
  background: var(--accent);
  color: #FFFFFF;
}
.btn-red:hover { background: var(--accent-deep); color: #FFFFFF; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.btn-ink {
  background: var(--ink);
  color: #FFFFFF;
}
.btn-ink:hover { background: var(--accent); color: #FFFFFF; }

/* Visible focus on every interactive element */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- 7. Skip link ---- */
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  inset-block-start: 16px;
  padding: 10px 14px;
  background: var(--ink);
  color: #FFFFFF;
  border-radius: var(--r-card);
  font-size: 14px;
  z-index: 200;
  transform: translateY(-150%);
  transition: transform 150ms var(--ease);
}
.skip-link:focus { transform: translateY(0); color: #FFFFFF; }

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

/* ---- 9. Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  video[autoplay] { display: none; }
  .video-fallback { display: block !important; }
}

/* ============================================================
 * Section: NAV
 * ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}
.footer-brand .brand { font-size: 18px; gap: 8px; }
.footer-brand .brand-mark { width: 24px; height: 24px; border-radius: 5px; }

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.nav-list a:not(.nav-cta) {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
.nav-list a:not(.nav-cta):hover { color: var(--ink); }
.nav-cta { padding: 8px 16px; font-size: 13px; }

/* Language picker (8 supported langs) */
.lang-picker {
  position: relative;
  /* Reset default <details> marker */
}
.lang-picker[open] .lang-trigger { border-color: var(--ink); }
.lang-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 150ms var(--ease), color 150ms var(--ease);
}
.lang-trigger::-webkit-details-marker { display: none; }
.lang-trigger:hover { border-color: var(--ink); color: var(--ink); }
.lang-trigger svg {
  width: 10px; height: 10px;
  transition: transform 200ms var(--ease);
}
.lang-picker[open] .lang-trigger svg { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 6px;
  list-style: none;
  margin: 0;
  min-width: 160px;
  z-index: 60;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 14px 28px -12px rgba(0,0,0,0.10);
}
.lang-menu li { margin: 0; }
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 120ms var(--ease);
}
.lang-menu button:hover { background: var(--bg-alt); }
.lang-menu button .code {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.lang-menu button[aria-current="true"] {
  background: var(--ink);
  color: #FFFFFF;
}
.lang-menu button[aria-current="true"] .code { color: rgba(255,255,255,0.7); }

@media (max-width: 880px) {
  .lang-picker .lang-menu {
    right: auto;
    left: 0;
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #FFFFFF;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 200ms var(--ease);
  }
  .nav-list.is-open { transform: scaleY(1); }
  .nav-list li { border-bottom: 1px solid var(--line); }
  .nav-list li:last-child { border-bottom: 0; padding: 12px 32px; }
  .nav-list a:not(.nav-cta) {
    display: block;
    padding: 14px 32px;
    font-size: 16px;
  }
  .nav-cta { width: 100%; }
}

/* ============================================================
 * Section: HERO — copy left, autoplay product video right
 * The video IS the moat. There is no separate dark RAV section.
 * ============================================================ */
.hero { padding-block: 56px 80px; }
@media (max-width: 768px) { .hero { padding-block: 40px 56px; } }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
}
@media (max-width: 968px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero-copy .eyebrow { margin-bottom: 22px; }
.hero-copy h1 .accent { color: var(--accent); }
.hero-copy .lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 540px;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  margin-bottom: 24px;
}

.hero-proof-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0;
}
.proof-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 150ms var(--ease);
}
.proof-pill:hover { border-color: var(--ink); color: var(--ink); }
.proof-stars {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}
.proof-fact {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  max-width: 480px;
  line-height: 1.5;
}
.proof-fact strong {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.01em;
}
.proof-fact code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Right-column hero figure: the rav-form-fill video. */
.hero-shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 24px 48px -16px rgba(0,0,0,0.14);
}
.hero-video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}
.video-fallback {
  display: block;
  width: 100%;
  height: auto;
}
.hero-shot-cap {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--muted);
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #FFFFFF;
}
.hero-shot-cap code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 4px;
}
@media (max-width: 768px) {
  .hero-shot-cap { font-size: 11px; padding: 10px 14px; }
}

/* ============================================================
 * Section: HOW IT WORKS
 * ============================================================ */
.sec-head { margin-bottom: 56px; max-width: 720px; }
.sec-head .eyebrow { margin-bottom: 16px; }
.sec-head h2 { margin-bottom: 0; }
.sec-head-center { margin-inline: auto; text-align: center; }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 0;
  margin: 0;
}
@media (max-width: 880px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.step {
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}
.step-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--ink-2); font-size: 15px; }

/* ============================================================
 * Section: TRY IT — interactive 3-stage demo
 * ============================================================ */
.try { padding-block: var(--section-y); background: var(--bg); }
.try .sec-head { text-align: center; margin: 0 auto 40px; max-width: 760px; }
.try-sub {
  font-size: 16px;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.55;
}
.try-sub em { font-style: italic; color: var(--ink-2); }

.demo-stage {
  max-width: 1100px;
  margin: 0 auto;
}

/* Sample picker */
.sample-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 720px) { .sample-picker { grid-template-columns: 1fr; } }
.sample-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.sample-btn:hover { border-color: var(--ink); }
.sample-btn.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #FFFFFF;
}
.sample-co {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.sample-role { font-size: 13px; margin-top: 2px; }
.sample-loc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.sample-btn.is-active .sample-loc { color: rgba(255,255,255,0.6); }

/* Progress strip + controls */
.demo-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: #FFFFFF;
  padding: 14px 18px;
  margin-top: 8px;
  border-bottom: 0;
}
.stage-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
}
.stage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
}
.stage-item.is-done,
.stage-item.is-active { color: var(--ink); }
.stage-num {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  flex-shrink: 0;
}
.stage-item.is-active .stage-num { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.stage-item.is-done .stage-num { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.stage-name { flex-shrink: 0; }
.stage-bar {
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-left: 4px;
}
.stage-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.stage-item.is-done .stage-fill { width: 100% !important; }

.demo-controls { display: flex; gap: 8px; }
.ctrl-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 150ms var(--ease);
}
.ctrl-btn:hover { border-color: var(--ink); color: var(--ink); }

/* Stage pane */
.demo-pane {
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r-card) var(--r-card);
  background: var(--bg-alt);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}
.stage {
  display: none;
  padding: 28px;
  animation: stageIn 350ms var(--ease);
}
.stage.is-active { display: block; }
@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .stage { animation: none; }
}

/* STAGE 1 — Save (cursor → click → card slides in) */
.stage-save { display: none; }
.stage-save.is-active { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: center; }
@media (max-width: 880px) { .stage-save.is-active { grid-template-columns: 1fr; } }

.browser-mock {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -12px rgba(0,0,0,0.10);
  position: relative;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #F1F1ED;
  border-bottom: 1px solid var(--line);
}
.browser-bar .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #D8D5CC;
}
.browser-bar .url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-left: 12px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-stub {
  position: relative;
  padding: 24px;
  min-height: 220px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAF7 100%);
}
.page-line {
  display: block;
  height: 8px;
  background: #ECEAE3;
  border-radius: 4px;
  margin-bottom: 12px;
  width: 100%;
}
.page-line.short { width: 65%; }
.fab {
  position: absolute;
  bottom: 20px; right: 20px;
  width: 44px; height: 44px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: 0 8px 24px -8px rgba(220,0,24,0.5);
  animation: fabPulse 1.4s var(--ease) infinite;
  transform-origin: center;
}
@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.cursor {
  position: absolute;
  top: 28%; left: 32%;
  width: 16px; height: 22px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
/* Cursor only animates during substep 0 (the journey + click). */
.stage-save[data-substep="0"] .cursor {
  animation: cursorJourney 1.7s cubic-bezier(.5,0,.3,1) 1 forwards;
}
@keyframes cursorJourney {
  0%   { top: 28%; left: 32%; transform: scale(1); opacity: 1; }
  85%  { top: calc(100% - 70px); left: calc(100% - 56px); transform: scale(1); opacity: 1; }
  92%  { transform: scale(0.7); }
  100% { top: calc(100% - 70px); left: calc(100% - 56px); transform: scale(1); opacity: 1; }
}
.stage-save[data-substep="1"] .cursor,
.stage-save[data-substep="2"] .cursor,
.stage-save[data-substep="3"] .cursor {
  top: calc(100% - 70px);
  left: calc(100% - 56px);
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.stage-save[data-substep="1"] .fab,
.stage-save[data-substep="2"] .fab {
  animation: fabPulse 1.4s var(--ease) infinite, fabFlash 0.55s var(--ease) 1;
}
@keyframes fabFlash {
  0%, 100% { box-shadow: 0 8px 24px -8px rgba(220,0,24,0.5); }
  40%      { box-shadow: 0 0 0 18px rgba(220,0,24,0.22), 0 8px 24px -8px rgba(220,0,24,0.5); }
}

/* Red scan-line sweeps the page-stub at the moment of click (substep 1). */
.scan-line {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px var(--accent);
  opacity: 0;
  top: 0;
  pointer-events: none;
}
.stage-save[data-substep="1"] .scan-line {
  animation: scanSweep 800ms ease-out 1 forwards;
}
@keyframes scanSweep {
  0%   { top: 0;   opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fab, .cursor, .scan-line { animation: none !important; }
  .cursor { opacity: 0; }
}

/* The job card slides in EMPTY at substep 1, then fields populate at substep 2. */
.job-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}
.stage-save[data-substep="1"] .job-card,
.stage-save[data-substep="2"] .job-card,
.stage-save[data-substep="3"] .job-card {
  opacity: 1;
  transform: translateX(0);
}

/* Card children hidden until substep 2 (the AI extraction moment). */
.job-card-tag,
.job-card-title,
.job-card-meta-1,
.job-card-meta-2,
.job-card-reqs-label,
.job-card-reqs li {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.stage-save[data-substep="2"] .job-card-tag       { opacity: 1; transform: none; transition-delay:    0ms; }
.stage-save[data-substep="2"] .job-card-title     { opacity: 1; transform: none; transition-delay:  140ms; }
.stage-save[data-substep="2"] .job-card-meta-1    { opacity: 1; transform: none; transition-delay:  300ms; }
.stage-save[data-substep="2"] .job-card-meta-2    { opacity: 1; transform: none; transition-delay:  420ms; }
.stage-save[data-substep="2"] .job-card-reqs-label{ opacity: 1; transform: none; transition-delay:  580ms; }
.stage-save[data-substep="2"] .job-card-reqs li:nth-child(1) { opacity: 1; transform: none; transition-delay:  720ms; }
.stage-save[data-substep="2"] .job-card-reqs li:nth-child(2) { opacity: 1; transform: none; transition-delay:  860ms; }
.stage-save[data-substep="2"] .job-card-reqs li:nth-child(3) { opacity: 1; transform: none; transition-delay: 1000ms; }

.stage-save[data-substep="3"] .job-card-tag,
.stage-save[data-substep="3"] .job-card-title,
.stage-save[data-substep="3"] .job-card-meta-1,
.stage-save[data-substep="3"] .job-card-meta-2,
.stage-save[data-substep="3"] .job-card-reqs-label,
.stage-save[data-substep="3"] .job-card-reqs li { opacity: 1; transform: none; transition-delay: 0ms; }

/* Brief red highlight pulse on each populating field */
.stage-save[data-substep="2"] .job-card-title,
.stage-save[data-substep="2"] .job-card-meta-1,
.stage-save[data-substep="2"] .job-card-meta-2,
.stage-save[data-substep="2"] .job-card-reqs li {
  animation: extractPulse 600ms var(--ease) backwards;
}
.stage-save[data-substep="2"] .job-card-title     { animation-delay:  140ms; }
.stage-save[data-substep="2"] .job-card-meta-1    { animation-delay:  300ms; }
.stage-save[data-substep="2"] .job-card-meta-2    { animation-delay:  420ms; }
.stage-save[data-substep="2"] .job-card-reqs li:nth-child(1) { animation-delay:  720ms; }
.stage-save[data-substep="2"] .job-card-reqs li:nth-child(2) { animation-delay:  860ms; }
.stage-save[data-substep="2"] .job-card-reqs li:nth-child(3) { animation-delay: 1000ms; }
@keyframes extractPulse {
  0%   { background: rgba(220,0,24,0.18); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .job-card { transition: none; opacity: 1; transform: none; }
  .job-card-tag, .job-card-title, .job-card-meta-1, .job-card-meta-2,
  .job-card-reqs-label, .job-card-reqs li {
    transition: none; opacity: 1; transform: none; animation: none;
  }
}

.job-card-tag-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: 2px;
  box-shadow: 0 0 0 3px rgba(220,0,24,0.18);
}
.job-card-tag {
  display: flex;
  align-items: center;
}
.job-card-reqs-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 4px;
}
.job-card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.job-card-title {
  font-size: 20px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}
.job-card-meta {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.job-card-reqs {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.job-card-reqs li {
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
}
.job-card-reqs li::before {
  content: '↳';
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  flex-shrink: 0;
}
.job-card-reqs li:first-child { border-top: 0; }

/* STAGE 2 — Tailor (multi-substep)
 *
 * data-substep on .stage-tailor controls the visible step:
 *   0 → CV: skills        | CL: thinking dots
 *   1 → CV: experiences   | CL: typing letter
 *   2 → CV: A4 PDF        | CL: full letter
 */
.stage-tailor.is-active { display: block; }
.tailor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 880px) { .tailor-grid { grid-template-columns: 1fr; } }

.tailor-pane {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
  position: relative;
  min-height: 520px;
}
/* When showing the A4 pages, swap to a softer paper-like backdrop. */
.stage-tailor[data-substep="2"] .tailor-pane {
  background: #F5F4EE;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Substep stacking — each .cv-step / .cl-step occupies the same space, only one visible */
.cv-step, .cl-step {
  position: absolute;
  inset: 22px;
  top: 50px; /* leave room for card-tag */
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease);
}
.stage-tailor[data-substep="0"] .cv-step-skills,
.stage-tailor[data-substep="0"] .cl-step-thinking,
.stage-tailor[data-substep="1"] .cv-step-experience,
.stage-tailor[data-substep="1"] .cl-step-typing,
.stage-tailor[data-substep="2"] .cv-step-pdf,
.stage-tailor[data-substep="2"] .cl-step-final {
  opacity: 1;
  pointer-events: auto;
}

.cv-substep-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cv-substep-num {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
}

/* CV — Skills list */
.skills-list { list-style: none; margin: 0; padding: 0; }
.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-2);
  background: var(--bg-alt);
  margin-bottom: 6px;
  transition: transform 350ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
  animation: skillIn 350ms var(--ease) backwards;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes skillIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .skill { animation: none; } }
.skill.is-match {
  background: #FFE8EB;
  color: #8C0010;
  font-weight: 500;
}
.skill-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* CV — Experience list */
.exp-list { list-style: none; margin: 0; padding: 0; }
.exp {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--bg-alt);
  margin-bottom: 8px;
  border: 1px solid transparent;
  transition: background 250ms var(--ease), border-color 250ms var(--ease), transform 250ms var(--ease);
  animation: expIn 380ms var(--ease) backwards;
  animation-delay: calc(var(--i) * 110ms);
}
@keyframes expIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .exp { animation: none; } }
.exp.is-emph {
  background: #FFE8EB;
  border-color: rgba(220,0,24,0.25);
}
.exp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.exp-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.exp-years {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.exp-co {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.exp-bullet {
  font-size: 13px;
  color: var(--ink-2);
  margin: 6px 0 0;
  line-height: 1.5;
}
.exp:not(.is-emph) .exp-bullet { opacity: 0.55; }

/* ---- A4 page shared shell (used by both .cv-pdf and .cl-pdf) ---- */
.cv-pdf,
.cl-pdf {
  background: #FFFFFF;
  border: 1px solid #DDD9CF;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.05),
    0 24px 60px -20px rgba(0,0,0,0.22),
    0 6px 14px -8px rgba(0,0,0,0.1);
  border-radius: 2px;
  position: relative;
  margin: 4px auto 0;
  /* True A4 ratio (210 × 297 mm) at a width that fits the pane comfortably. */
  width: 100%;
  max-width: 320px;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  animation: pdfReveal 700ms var(--ease) backwards;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}
@keyframes pdfReveal {
  0%   { opacity: 0; transform: translateY(24px) scale(0.94); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cv-pdf, .cl-pdf { animation: none; }
}
/* Soft fade-out at bottom of each page (suggests page-break) */
.cv-pdf::after,
.cl-pdf::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, #FFFFFF);
  pointer-events: none;
}

/* ---- A4 CV (Swiss Classic) ---- */
.cv-pdf { padding: 16px 18px; line-height: 1.4; }
.cv-pdf-header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.cv-pdf-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  line-height: 1.05;
}
.cv-pdf-title {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--ink-2);
  margin: 2px 0 0;
  letter-spacing: 0.02em;
}
.cv-pdf-contact { font-size: 8px; color: var(--muted); margin: 3px 0 0; line-height: 1.3; }
.cv-pdf-section { margin-bottom: 7px; }
.cv-pdf-section:last-of-type { margin-bottom: 0; }
.cv-pdf-section h5 {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 3px;
  font-weight: 600;
}
.cv-pdf-profile {
  font-size: 8.5px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0;
  text-align: justify;
  hyphens: auto;
}

/* Experience entries */
.cv-pdf-exp { list-style: none; padding: 0; margin: 0; }
.cv-pdf-exp li { font-size: 8.5px; margin-bottom: 5px; line-height: 1.4; }
.cv-pdf-exp li:last-child { margin-bottom: 0; }
.cv-pdf-exp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.cv-pdf-exp strong { color: var(--ink); font-weight: 600; font-size: 9px; }
.cv-pdf-yrs {
  color: var(--muted);
  font-size: 7.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.cv-pdf-co {
  color: var(--ink-2);
  font-size: 8px;
  margin-bottom: 1px;
}
.cv-pdf-bullet {
  color: var(--ink-2);
  font-size: 8.5px;
  margin: 1px 0 0;
  line-height: 1.4;
}

/* Skills as chips */
.cv-pdf-chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.cv-pdf-chips li {
  font-size: 7.5px;
  padding: 2px 6px;
  background: #F5F4EE;
  border: 1px solid #E7E4D9;
  border-radius: 3px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

/* Languages as inline pairs */
.cv-pdf-langs {
  margin: 0;
  font-size: 8.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.cv-pdf-lang {
  display: inline;
  margin-right: 8px;
}
.cv-pdf-lang strong { color: var(--ink); font-weight: 600; }
.cv-pdf-lang em {
  font-style: normal;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  margin-left: 3px;
}
.cv-pdf-lang::after {
  content: '·';
  margin-left: 5px;
  color: var(--line);
}
.cv-pdf-lang:last-child::after { content: ''; }

/* Education uses the same row layout as experience */
.cv-pdf-edu .cv-pdf-exp-row strong { font-size: 9px; }
.cv-pdf-edu .cv-pdf-co { font-size: 8px; }

.cv-pdf-mark {
  position: absolute;
  bottom: 4px; right: 8px;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 0.06em;
  z-index: 1;
}

/* ---- A4 Cover Letter (Swiss formal layout) ---- */
.cl-pdf {
  /* Slight delay so the two pages don't pop in at the exact same instant. */
  animation-delay: 120ms;
  padding: 18px 24px 14px;
  font-size: 9px;
  line-height: 1.5;
}
.cl-pdf-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.cl-pdf-sender p,
.cl-pdf-recipient p {
  margin: 0;
  font-size: 8.5px;
  color: var(--ink);
  line-height: 1.35;
}
.cl-pdf-sender { text-align: right; }
.cl-pdf-sender p:first-child { font-weight: 600; }
.cl-pdf-recipient {
  margin-bottom: 12px;
}
.cl-pdf-recipient p:first-child { font-weight: 600; }
.cl-pdf-place {
  font-size: 8.5px;
  color: var(--ink-2);
  margin: 0 0 10px;
  text-align: right;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.cl-pdf-subject {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 9.5px;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
  line-height: 1.35;
}
.cl-pdf-salutation {
  font-size: 8.5px;
  margin: 0 0 6px;
  color: var(--ink);
}
.cl-pdf-body p {
  font-size: 8.5px;
  margin: 0 0 6px;
  color: var(--ink-2);
  line-height: 1.5;
  text-align: justify;
  hyphens: auto;
}
.cl-pdf-body p:last-child { margin-bottom: 0; }
.cl-pdf-close {
  font-size: 8.5px;
  color: var(--ink);
  margin: 8px 0 4px;
}
.cl-pdf-signature {
  font-family: 'Snell Roundhand', 'Apple Chancery', 'Brush Script MT', 'Lucida Handwriting', cursive;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 6px;
  font-style: italic;
  line-height: 1;
  /* Slight tilt for a more handwritten feel without being kitsch. */
  transform: rotate(-2deg);
  transform-origin: left;
}
.cl-pdf-enclosures {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  border-top: 1px solid #ECEAE3;
  padding-top: 6px;
}
.cl-pdf-mark {
  position: absolute;
  bottom: 4px; right: 8px;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 0.06em;
  z-index: 1;
}

/* Cover letter — thinking state (substep 0) */
.cl-thinking {
  display: grid;
  place-items: center;
  text-align: center;
  height: 100%;
  padding: 24px 12px;
}
.cl-thinking-dots {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 16px;
}
.cl-thinking-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBlink 1.2s ease-in-out infinite;
}
.cl-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.cl-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.0); }
}
@media (prefers-reduced-motion: reduce) { .cl-thinking-dots span { animation: none; opacity: 1; } }
.cl-thinking-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 8px;
}
.cl-thinking-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  max-width: 280px;
}

/* Cover letter — typing state (substep 1) */
.cl-step-typing {
  overflow: hidden;
}
.cl-step-typing .letter-text {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  background: #FAFAF7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 0;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  /* Reveal text via clip-path animation — the right edge of the visible area sweeps down. */
  clip-path: inset(0 0 100% 0);
  animation: letterTypeSweep 2.8s linear forwards;
}
@keyframes letterTypeSweep {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0   0% 0); }
}
@media (prefers-reduced-motion: reduce) {
  .cl-step-typing .letter-text { animation: none; clip-path: none; }
}
.cl-caret {
  display: none; /* visual reads cleanly without a literal caret */
}

/* Cover letter — final state (substep 2) */
.cl-step-final .letter-text {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  background: #FAFAF7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 0 0 12px;
  max-height: 280px;
  overflow: hidden;
  position: relative;
}
.cl-step-final .letter-text::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 50px;
  background: linear-gradient(to bottom, transparent, #FAFAF7);
  pointer-events: none;
}
.letter-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* STAGE 3 — Fill RAV (filling → green checks → submit-ready) */
.stage-rav.is-active { display: block; }
.rav-mock {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
}
.rav-mock-tag { color: var(--accent); }
.rav-fields {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rav-fields .span-2 { grid-column: 1 / -1; }
.rav-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  position: relative;
}
.rav-fields input {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 38px 10px 12px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  height: 40px;
  transition: background 250ms var(--ease), border-color 250ms var(--ease);
}
.rav-fields input.is-filled {
  background: #FFE8EB;
  border-color: #DC0018;
}
.rav-fields input.is-validated {
  background: #E8F5EE;
  border-color: #0F7B3F;
}

/* Green check that pops in when input becomes validated */
.rav-check {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #0F7B3F;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
  pointer-events: none;
}
.rav-check::before {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  transform: rotate(-45deg) translate(1px, -1px);
}
.rav-fields label:has(input.is-validated) .rav-check {
  opacity: 1;
  transform: scale(1);
}

/* Submit-ready block (substep 2 only) */
.rav-ready {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 350ms var(--ease), transform 350ms var(--ease);
}
.stage-rav[data-substep="2"] .rav-ready {
  opacity: 1;
  transform: translateY(0);
}
.rav-install {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(220,0,24,0.4);
  transition: background 150ms var(--ease);
}
.rav-install:hover { background: var(--accent-deep); color: #FFFFFF; }
.stage-rav[data-substep="2"] .rav-install {
  animation: installPulse 2s var(--ease) infinite;
}
@keyframes installPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,0,24,0.0); }
  50%      { box-shadow: 0 0 0 10px rgba(220,0,24,0.18); }
}
@media (prefers-reduced-motion: reduce) { .rav-install { animation: none; } }
.rav-install-icon { font-size: 16px; }

.rav-ready-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rav-ready-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #0F7B3F;
  box-shadow: 0 0 0 4px rgba(15,123,63,0.18);
  animation: greenPulse 1.6s var(--ease) infinite;
}
@keyframes greenPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(15,123,63,0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(15,123,63,0.10); }
}
@media (prefers-reduced-motion: reduce) { .rav-ready-dot { animation: none; } }

.rav-mock-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
  letter-spacing: 0.04em;
}
.rav-mock-note code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 4px;
}

/* CTA line below the stage */
.demo-cta-line {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}
.demo-cta-link {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
 * Section: MID CTA
 * ============================================================ */
.mid-cta {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
  padding-block: 32px;
}
.mid-cta-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.mid-cta p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

/* ============================================================
 * Section: PRICING
 * ============================================================ */
.pricing { background: var(--bg-alt); }

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 880px;
  margin-inline: auto;
  text-align: left;
}
@media (max-width: 720px) {
  .price-grid { grid-template-columns: 1fr; }
}

.price-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.price-card-featured {
  border-color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 24px 48px -16px rgba(0,0,0,0.14);
}
.price-card-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.price-card .badge {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.price-card .card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.price-card-featured .card-tag { color: var(--accent); }
.upgrade-note {
  text-align: center;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.price-card h3 {
  font-size: 24px;
  margin-bottom: 12px;
}
.price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}
.price .amount {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.price .period {
  font-size: 14px;
  color: var(--muted);
}
.price-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}
.price-features {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  flex-grow: 1;
}
.price-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.price-features li:last-child { border-bottom: 0; }
.price-features li::before {
  content: '';
  width: 14px; height: 14px;
  flex-shrink: 0;
  margin-top: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8l3.2 3.2L13 5' stroke='%23DC0018' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}
.full { width: 100%; }
.price-fine {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 28px;
}

/* ============================================================
 * Section: FAQ
 * ============================================================ */
.faq { background: var(--bg-alt); }
.faq-list { max-width: 820px; margin-inline: auto; }
.faq-item {
  border-top: 1px solid var(--line);
  padding-block: 4px;
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #FFFFFF;
  flex-shrink: 0;
  margin-left: 16px;
  position: relative;
  transition: background 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--ease);
}
.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  background: var(--ink);
  transition: background 200ms var(--ease), transform 200ms var(--ease), opacity 200ms var(--ease);
}
.faq-icon::before {
  width: 12px; height: 1.5px;
  transform: translate(-50%, -50%);
}
.faq-icon::after {
  width: 1.5px; height: 12px;
  transform: translate(-50%, -50%);
}
.faq-item[open] .faq-icon {
  background: var(--accent);
  border-color: var(--accent);
}
.faq-item[open] .faq-icon::before,
.faq-item[open] .faq-icon::after {
  background: #FFFFFF;
}
.faq-item[open] .faq-icon::after { opacity: 0; }
.faq-body {
  padding-bottom: 22px;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 720px;
}
.faq-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
}
.faq-body p + p { margin-top: 12px; }
.faq-body a { color: var(--accent); font-weight: 500; }

/* ============================================================
 * Section: BLOG PREVIEW
 * ============================================================ */
.blog-preview .sec-head { margin-bottom: 40px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.blog-card:hover {
  border-color: var(--ink);
  color: inherit;
  transform: translateY(-2px);
}
.blog-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.blog-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.blog-card > p:not(.blog-tag):not(.blog-link) {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.blog-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
}
.blog-all {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
}
.blog-all a { color: var(--accent); font-weight: 500; }

/* ============================================================
 * Section: FINAL CTA
 * ============================================================ */
.cta-final {
  padding-block: 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-final::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(220,0,24,0.04), transparent 60%);
  pointer-events: none;
}
.cta-final-inner { position: relative; }
.cta-final h2 {
  font-size: clamp(40px, 6vw, 84px);
  margin-bottom: 24px;
}
.rule-center { margin-inline: auto; }
.cta-final-sub {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 32px;
}
@media (max-width: 768px) { .cta-final { padding-block: 72px; } }

/* ============================================================
 * FOOTER
 * ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 48px;
  background: #FFFFFF;
}
.footer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
@media (max-width: 880px) {
  .footer-row { grid-template-columns: 1fr; gap: 28px; }
}
.footer-tag {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.footer-tag code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg-alt);
  padding: 1px 6px;
  border-radius: 4px;
}
.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.footer-nav a {
  font-size: 14px;
  color: var(--ink-2);
}
.footer-nav a:hover { color: var(--ink); }
.footer-end {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
@media (max-width: 880px) { .footer-end { text-align: left; } }
.footer-end .fine {
  margin-top: 6px;
  font-style: italic;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: -0.01em;
}

/* ============================================================
 * Reveal animation (used opportunistically by JS)
 * ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
