@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap');

:root {
  --bg: #0a0a0c;
  --bg-elev: #131318;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-h: rgba(255, 255, 255, 0.06);
  --fg: #f4f2ee;
  --fg-dim: rgba(244, 242, 238, 0.65);
  --fg-faint: rgba(244, 242, 238, 0.35);
  --fg-rule: rgba(244, 242, 238, 0.08);
  --accent: #d6b896;
  --accent-cool: #88b3c4;
  --warn: #c97b5a;
  --urgent: #e85d52;       /* coral-garnet — used to flag waiting-too-long cues */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
.serif { font-family: 'Cormorant Garamond', Georgia, serif; }

#gl { position: fixed; inset: 0; display: block; z-index: 0; touch-action: none; }
/* In the menu, only HINT at the visualization: reveal a band near the top
   (the header) and fade it out below, so the practice list sits clean. The
   full grid is reserved for the session — seeing only a peek is what makes
   the reveal during practice feel like something. */
#gl {
  /* Lift the crest up so it fills the header band, then fade out. The
     opaque .home-sheet below the hero covers the fade tail and everything
     beneath it (and on scroll), so the grid never spills past the header. */
  transform: translateY(-12%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 38%, transparent 60%);
          mask-image: linear-gradient(180deg, #000 0%, #000 38%, transparent 60%);
}
body.session-active #gl { transform: none; -webkit-mask-image: none; mask-image: none; }

/* Opaque sheet holding the practice list — scrolls over the fixed canvas so
   the visualization stays confined to the header. */
.home-sheet {
  position: relative; z-index: 1;
  background: var(--bg);
  padding-top: 24px;
  padding-bottom: 40px;
  min-height: 56vh;
}

.app {
  position: fixed; inset: 0;
  z-index: 5;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s cubic-bezier(.2,.6,.2,1);
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
.view.active { opacity: 1; pointer-events: auto; }
.view.transparent { background: transparent; }

/* ─── Top bar — non-sticky, simple ──────────── */
.topbar {
  padding: calc(var(--safe-top) + 18px) 22px 18px;
  display: flex; align-items: center; justify-content: space-between;
  /* Soft scrim instead of a solid bar, so the ambient grid stays visible
     behind the header on transparent views while the title stays legible. */
  background: linear-gradient(180deg, rgba(10,10,12,0.90) 0%, rgba(10,10,12,0.55) 55%, rgba(10,10,12,0) 100%);
  position: relative;
  z-index: 2;
}
.topbar .ttl {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 400;
  letter-spacing: 0.06em;
}
.topbar .back, .topbar .menu {
  appearance: none; background: transparent; border: 0;
  color: var(--fg); font-family: inherit;
  font-size: 22px; line-height: 1; cursor: pointer;
  width: 34px; height: 34px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.topbar .back:hover, .topbar .menu:hover { background: var(--bg-card-h); }
.topbar .spacer { width: 34px; }

/* ─── Home view ────────────────────────────── */
.home-hero {
  margin: 0 22px 0;
  padding: 28px 24px 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(214, 184, 150, 0.10), rgba(136, 179, 196, 0.08));
  border: 1px solid var(--fg-rule);
  position: relative; overflow: hidden;
}
.home-hero::before {
  content: ''; position: absolute;
  top: -40%; right: -10%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(214,184,150,0.18), transparent 65%);
  pointer-events: none;
}
.home-hero .greet { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 6px; }
.home-hero .title { font-family: 'Cormorant Garamond', serif; font-size: 32px; line-height: 1.1; font-weight: 400; margin-bottom: 6px; letter-spacing: 0.01em; max-width: 80%; }
.home-hero .sub { font-size: 14px; color: var(--fg-dim); font-style: italic; font-family: 'Cormorant Garamond', serif; margin-bottom: 22px; }
.home-hero .cta {
  appearance: none; background: var(--fg); color: var(--bg);
  border: 0; font-family: inherit;
  font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 13px 22px; border-radius: 99px;
  cursor: pointer; transition: all 0.25s;
  display: inline-flex; align-items: center; gap: 8px;
}
.home-hero .cta:hover { transform: translateY(-1px); }
.home-hero .cta::after { content: '→'; transition: transform 0.25s; }
.home-hero .cta:hover::after { transform: translateX(3px); }
.home-hero .stats {
  margin-top: 22px;
  display: flex; gap: 22px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-dim);
}
.home-hero .stats b {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400;
  display: block; color: var(--fg);
  letter-spacing: 0; line-height: 1.1; margin-bottom: 2px;
}

.section-h {
  padding: 0 22px;
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.section-h .label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400;
}
.section-h .meta {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-faint);
}

.card-grid {
  padding: 0 22px calc(40px + var(--safe-bot));
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.practice-card {
  appearance: none; background: var(--bg-card);
  border: 1px solid var(--fg-rule);
  border-radius: 14px;
  color: var(--fg); font-family: inherit;
  text-align: left; cursor: pointer;
  padding: 16px;
  transition: all 0.3s cubic-bezier(.2,.6,.2,1);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 150px;
}
.practice-card:hover {
  background: var(--bg-card-h);
  transform: translateY(-2px);
  border-color: var(--fg-faint);
}
.practice-card .icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-family: 'Cormorant Garamond', serif;
  color: var(--accent); font-style: italic;
}
.practice-card .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 27px; font-weight: 400; line-height: 1.05;
  letter-spacing: 0.005em;
}
.practice-card .trad {
  font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-faint); margin-top: -4px;
}
.practice-card .desc {
  font-size: 13px; color: var(--fg-dim);
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  line-height: 1.4;
  flex: 1;
}
.practice-card .footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-faint);
  margin-top: 4px; gap: 6px;
}
.practice-card .ptn { font-variant-numeric: tabular-nums; }
.practice-card.advanced .icon { color: var(--warn); }
.practice-card.advanced .name::after {
  content: ' ⚠'; color: var(--warn); font-size: 12px;
}
/* Mic badge — small icon in the top-right corner of a card.
   Marks practices that use the microphone (e.g. Bhramari). */
.practice-card .card-badge {
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--fg-rule);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  opacity: 0.75;
  transition: opacity 0.3s, border-color 0.3s;
}
.practice-card:hover .card-badge {
  opacity: 1;
  border-color: var(--accent);
}

/* ─── Detail view ─────────────────────────── */
.detail-inner {
  padding: 0 22px 40px;
  max-width: 540px; margin: 0 auto;
}
.detail-hero { padding: 12px 0 8px; }
.detail-hero .pre { font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 6px; }
.detail-hero .title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px; line-height: 1.05; font-weight: 400;
  letter-spacing: 0.01em; margin-bottom: 4px;
}
.detail-hero .trad-name {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 10px;
}
.detail-hero .sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; color: var(--fg-dim);
  font-style: italic; line-height: 1.4; margin-bottom: 20px;
}
.detail-hero .badges {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.badge {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid var(--fg-rule);
  border-radius: 99px; color: var(--fg-dim);
  display: inline-flex; align-items: center; gap: 6px;
}
.badge.warn { color: var(--warn); border-color: rgba(201, 123, 90, 0.4); }

/* ─── "Best for" filter row (home) ─────────── */
.filter-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.filter-chip {
  appearance: none; cursor: pointer;
  font-family: inherit;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 13px;
  background: transparent;
  border: 1px solid var(--fg-rule);
  border-radius: 99px;
  color: var(--fg-dim);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.filter-chip:hover { border-color: var(--fg-faint); color: var(--fg); }
.filter-chip.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.detail-section {
  border-top: 1px solid var(--fg-rule);
  padding: 22px 0;
}
.detail-section h3 {
  font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--fg-dim); font-weight: 500; margin-bottom: 12px;
}
.detail-section p {
  font-size: 15px; color: var(--fg);
  line-height: 1.65; font-weight: 300;
}
.detail-section p + p { margin-top: 14px; }
.benefits-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.benefits-list li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px; line-height: 1.5; color: var(--fg);
}
.benefits-list li::before {
  content: '◦'; color: var(--accent);
  font-size: 18px; line-height: 1.2;
  flex-shrink: 0; margin-top: -1px;
}
.caution-box {
  background: rgba(201, 123, 90, 0.06);
  border: 1px solid rgba(201, 123, 90, 0.2);
  padding: 14px 16px; border-radius: 10px;
  margin-top: 8px;
}
.caution-box .head {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--warn); margin-bottom: 6px;
}
.caution-box p { font-size: 13px; line-height: 1.55; color: var(--fg-dim); font-weight: 300; }

.duration-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dur-btn {
  appearance: none; background: transparent;
  border: 1px solid var(--fg-rule); color: var(--fg);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 12px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dur-btn:hover { background: var(--bg-card-h); }
.dur-btn.active {
  border-color: var(--accent); color: var(--accent);
  background: rgba(214, 184, 150, 0.06);
}
.dur-btn .min { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 400; line-height: 1; }
.dur-btn .lbl { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-faint); }

.detail-start {
  position: sticky;
  bottom: 0;
  margin: 24px -22px 0;
  padding: 16px 22px calc(16px + var(--safe-bot));
  background: linear-gradient(0deg, var(--bg) 60%, transparent);
}
.start-btn {
  appearance: none; width: 100%;
  background: var(--fg); color: var(--bg);
  border: 0; font-family: inherit;
  font-size: 14px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 17px; border-radius: 99px;
  cursor: pointer; transition: transform 0.2s;
}
.start-btn:hover { transform: translateY(-1px); }
.start-btn:active { transform: scale(0.98); }

/* ─── Session view ─────────────────────────── */
.session-top {
  position: absolute;
  top: calc(var(--safe-top) + 18px); left: 22px; right: 22px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 2;
}
.session-top .info { display: flex; flex-direction: column; }
.session-top .info .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 400; line-height: 1;
}
.session-top .info .ptn {
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg-dim); margin-top: 4px; font-variant-numeric: tabular-nums;
}
.session-top .end {
  appearance: none; background: transparent;
  border: 1px solid var(--fg-rule); color: var(--fg-dim);
  font-family: inherit; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 99px;
  cursor: pointer; transition: all 0.2s;
}
.session-top .end:hover { color: var(--fg); border-color: var(--fg-dim); }

/* Phase cue — fades managed by JS opacity */
.phase-cue {
  position: fixed; left: 50%; top: 32%;
  transform: translate(-50%, 0);
  z-index: 2; text-align: center; pointer-events: none;
  opacity: 0;
  --cue-urgent: 0;        /* 0 = normal, 1 = full urgent red */
}
.phase-cue .word {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px; font-weight: 300; letter-spacing: 0.04em;
  line-height: 1;
  /* Interpolate text colour from --fg toward --urgent based on --cue-urgent.
     The transition is smooth because we drive --cue-urgent from JS each frame. */
  color: color-mix(in srgb, var(--fg) calc((1 - var(--cue-urgent)) * 100%), var(--urgent));
  /* Soft dark halo — keeps the text legible on bright warm peaks. */
  text-shadow:
    0 0 18px rgba(8, 6, 12, 0.85),
    0 0 6px rgba(8, 6, 12, 0.9),
    0 1px 2px rgba(8, 6, 12, 0.6);
}
.phase-cue .count {
  font-size: 12px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--fg-dim); margin-top: 12px;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 12px rgba(8, 6, 12, 0.8),
    0 0 4px rgba(8, 6, 12, 0.85);
}

/* Mic permission prompt — overlaid in centre of session view while
   the browser dialog is open or before the user grants access. */
.mic-prompt {
  position: fixed; inset: 0;
  z-index: 4;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  animation: micPromptFadeIn 0.4s ease forwards;
}
.mic-prompt[hidden] { display: none; }
.mic-prompt-inner {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 36px 44px;
  background: rgba(12, 10, 16, 0.55);
  border: 1px solid var(--fg-rule);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 320px;
}
.mic-prompt-icon { color: var(--accent); opacity: 0.85; }
.mic-prompt-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 400; letter-spacing: 0.02em;
  color: var(--fg);
}
.mic-prompt-sub {
  font-size: 13px; line-height: 1.5;
  color: var(--fg-dim); text-align: center;
}
@keyframes micPromptFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.session-bottom {
  position: absolute;
  bottom: calc(var(--safe-bot) + 22px); left: 22px; right: 22px;
  display: flex; align-items: flex-end; justify-content: space-between;
  z-index: 2;
}
.session-bottom .stat {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg-dim);
}
.session-bottom .stat .v {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400; color: var(--fg);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.session-bottom .stat.r { align-items: flex-end; text-align: right; }

.session-tools {
  position: absolute;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 2;
}
.tool {
  appearance: none; width: 40px; height: 40px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--fg-rule);
  border-radius: 50%; color: var(--fg-dim);
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: all 0.3s;
}
.tool:hover { color: var(--fg); border-color: var(--fg-dim); }
.tool.active { color: var(--accent); border-color: var(--accent); }

/* ─── Mic / voice panel ─── */
.mic-panel {
  position: absolute;
  bottom: calc(var(--safe-bot) + 80px); left: 22px; right: 22px;
  z-index: 3;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--fg-rule);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px; margin: 0 auto;
}
.mic-panel[hidden] { display: none !important; }
.mp-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg-dim);
}
.mp-row .mp-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 400; color: var(--fg);
  letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.mic-panel input[type="range"] {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 16px;
  background: transparent; padding: 0; cursor: pointer;
}
.mic-panel input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--fg-rule); }
.mic-panel input[type="range"]::-moz-range-track { height: 1px; background: var(--fg-rule); }
.mic-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); margin-top: -6px;
}
.mic-panel input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 0;
}
.mp-vu {
  height: 4px; background: var(--fg-rule);
  position: relative; overflow: hidden; border-radius: 2px;
}
.mp-vu-zone {
  position: absolute; top: 0; left: 30%; width: 50%; height: 100%;
  border-left: 1px solid var(--fg-faint);
  border-right: 1px solid var(--fg-faint);
  opacity: 0.5;
}
.mp-vu-level {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--accent-cool); width: 0%;
  transition: width 0.06s linear;
}
.mp-foot {
  display: flex; justify-content: space-between;
  font-size: 8px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-faint);
}
.mp-hint {
  font-size: 11px; color: var(--fg-dim); line-height: 1.5;
  text-align: center; padding: 4px 0;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
}

/* ─── Outro view ─────────────────────────── */
.outro-wrap {
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 22px;
  text-align: center; gap: 32px;
}
.outro-wrap .ok {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px; font-style: italic; font-weight: 300;
  line-height: 1.2; max-width: 320px;
}
.outro-wrap .stats-row { display: flex; gap: 36px; }
.outro-wrap .stat {
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg-dim);
}
.outro-wrap .stat b {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 300; display: block; color: var(--fg);
  margin-bottom: 4px; font-variant-numeric: tabular-nums;
}
.mood {
  display: flex; flex-direction: column; gap: 16px; align-items: center;
  padding: 24px;
  border: 1px solid var(--fg-rule); border-radius: 16px;
  max-width: 320px; width: 100%;
}
.mood .q { font-size: 13px; color: var(--fg-dim); }
.mood-buttons { display: flex; gap: 10px; }
.mood-buttons button {
  appearance: none; background: transparent;
  width: 42px; height: 42px;
  border: 1px solid var(--fg-rule);
  color: var(--fg); font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 400;
  border-radius: 50%; cursor: pointer;
  transition: all 0.2s;
}
.mood-buttons button:hover { border-color: var(--fg-dim); background: var(--bg-card-h); }
.mood-buttons button.sel { border-color: var(--accent); color: var(--accent); }

.outro-actions { display: flex; gap: 12px; flex-direction: column; width: 100%; max-width: 320px; }
.outro-actions .a {
  appearance: none; background: transparent;
  border: 1px solid var(--fg-rule); color: var(--fg);
  font-family: inherit; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 14px; border-radius: 99px; cursor: pointer;
  transition: all 0.2s;
}
.outro-actions .a:hover { background: var(--bg-card-h); }
.outro-actions .a.primary { background: var(--fg); color: var(--bg); border: 0; }

/* ─── Onboarding ─────────────────────────── */
.onb-wrap {
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: 0 22px calc(40px + var(--safe-bot)) 22px;
  max-width: 480px; margin: 0 auto;
}
.onb-step {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; gap: 16px;
  padding: 40px 0;
}
.onb-step .pre { font-size: 10px; letter-spacing: 0.42em; text-transform: uppercase; color: var(--fg-dim); }
.onb-step .ttl {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 400; line-height: 1.15;
  max-width: 360px;
}
.onb-step .body {
  font-size: 15px; color: var(--fg-dim);
  line-height: 1.6; max-width: 360px; font-weight: 300;
}
.onb-dots { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.onb-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-rule);
  transition: background 0.3s, width 0.3s;
}
.onb-dots span.active { background: var(--accent); width: 18px; border-radius: 3px; }
.onb-actions { display: flex; gap: 12px; }
.onb-actions .a {
  appearance: none; flex: 1;
  font-family: inherit; font-size: 13px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 15px; border-radius: 99px;
  cursor: pointer; transition: all 0.2s;
}
.onb-actions .a.primary { background: var(--fg); color: var(--bg); border: 0; }
.onb-actions .a.ghost {
  background: transparent; color: var(--fg-dim);
  border: 1px solid var(--fg-rule);
}
.onb-actions .a.ghost:hover { color: var(--fg); }

@media (max-width: 380px) {
  .card-grid { grid-template-columns: 1fr; }
  .home-hero .title { font-size: 26px; max-width: 100%; }
  .detail-hero .title { font-size: 30px; }
  .phase-cue .word { font-size: 38px; }
}

.view::-webkit-scrollbar { width: 0; }

/* ─── Pro / paywall ─────────────────────────── */
.practice-card .card-pro {
  position: absolute; top: 14px; right: 14px;
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(214,184,150,0.4);
  border-radius: 99px; padding: 3px 9px;
  opacity: 0.9;
}
.practice-card.locked .name { color: var(--fg-dim); }
.practice-card.locked .icon { opacity: 0.6; }
.practice-card.locked:hover .name { color: var(--fg); }

.badge.pro { color: var(--accent); border-color: rgba(214,184,150,0.4); }

.unlock-link {
  display: block; width: 100%; margin-top: 12px;
  appearance: none; background: transparent; border: 0; cursor: pointer;
  color: var(--fg-dim); font-family: inherit;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.25s;
}
.unlock-link:hover { color: var(--accent); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(6,6,8,0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: #121216;
  border: 1px solid var(--fg-rule);
  border-radius: 20px;
  padding: 30px 26px 26px;
  max-height: 88vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  appearance: none; background: transparent; border: 0; cursor: pointer;
  color: var(--fg-dim); font-size: 26px; line-height: 1;
  width: 34px; height: 34px; border-radius: 50%;
}
.modal-close:hover { color: var(--fg); }
.modal-card .eyebrow {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.modal-card h2 { font-weight: 400; font-size: 28px; line-height: 1.1; margin-bottom: 10px; }
.modal-sub { color: var(--fg-dim); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.modal-price { margin-bottom: 22px; }
.modal-price .serif { font-size: 34px; color: var(--accent); }
.modal-price-note { color: var(--fg-dim); font-size: 14px; }

.pay-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pay-btn {
  display: block; width: 100%; text-align: center;
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: 13px; letter-spacing: 0.08em;
  padding: 14px 16px; border-radius: 99px;
  background: transparent; border: 1px solid var(--fg-rule); color: var(--fg);
  transition: all 0.25s;
}
.pay-btn:hover { border-color: var(--accent); color: var(--accent); }
.pay-note { font-size: 12px; color: var(--fg-faint); line-height: 1.5; margin-bottom: 22px; word-break: break-word; }

.key-row { display: flex; gap: 8px; }
.key-row input {
  flex: 1; min-width: 0; background: transparent; color: var(--fg);
  border: 1px solid var(--fg-rule); border-radius: 99px;
  padding: 12px 16px; font-family: inherit; font-size: 13px;
}
.key-row input:focus { outline: none; border-color: var(--accent); }
.key-row button {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 12px 20px; border-radius: 99px; white-space: nowrap;
  background: var(--accent); color: #0a0a0c; border: 1px solid var(--accent);
  transition: all 0.25s;
}
.key-row button:hover { background: #e4caa8; }
.key-msg { font-size: 12px; min-height: 16px; margin-top: 10px; }
.key-msg.err { color: var(--urgent); }
.key-msg.ok { color: var(--accent); }
