/* ten — resources / lead-magnet layer
 * Extends v2.css (loaded first). Everything here is scoped to the resources
 * tab: the hub, the two guides, the audience calculator, the 24h-prototype
 * request, and the live code-audit tool. Same DNA as v2: warm white ground,
 * near-black text, one saturated accent (indigo → violet), Charter serif body,
 * Helvetica display. Color only ever appears inside contained rounded surfaces.
 */

/* ------------------------------------------------------------------ tokens */
:root {
  --accent: #6A53CE;
  --accent-2: #5B6FE0;
  --accent-grad: linear-gradient(120deg, #4452CE 0%, #6A53CE 55%, #8A66D6 100%);
  --good: #2E9E6B;
  --warn: #D98A3D;
  --crit: #D9534F;
  --r-tool: 18px;
}

/* The ambient .mglow decorative blooms are wider than the viewport and sit at
 * negative offsets, so on narrow screens their right edge pushes the page past
 * 100vw. The home page tolerates this because its glows bleed intentionally; on
 * the resources pages we clip horizontal overflow so the body never scrolls
 * sideways (playbook Appendix A). overflow-x: clip keeps position: sticky working
 * (unlike overflow: hidden, which would break the checklist progress bar). */
body.home { overflow-x: clip; }
.band { overflow-x: clip; }

/* the accent pill CTA (deeper cut of the hero glow; white text passes AA) */
.btn--accent {
  color: #FFFFFF;
  background: var(--accent-grad);
  box-shadow: 0 10px 26px -12px rgba(96, 82, 210, 0.55);
}
.btn--accent:hover, .btn--accent:focus-visible {
  background: linear-gradient(120deg, #3B49C4 0%, #5F49C6 55%, #7E5ACE 100%);
  box-shadow: 0 14px 30px -12px rgba(96, 82, 210, 0.65);
  color: #FFFFFF; transform: translateY(-1px);
}

/* a generic tinted lane tag ("For creators monetizing…" / "For creators building…") */
.lane-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px; margin: 0 0 22px;
}
.lane-tag i { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lane-tag--t1 { color: #4260C2; background: rgba(110,134,228,0.12); border: 1px solid rgba(110,134,228,0.26); }
.lane-tag--t3 { color: #7350B8; background: rgba(158,107,216,0.12); border: 1px solid rgba(158,107,216,0.26); }

/* a short back-to link at the top of each tool page */
/* the only "back to resources" escape hatch on every tool/guide page, sitting
 * under a nav whose links are behind a hamburger on mobile — so it needs a real
 * target, not a 19px line box. Negative margin holds the visual position. */
.res-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 500; font-size: 0.86rem;
  color: var(--mute); text-decoration: none;
  padding: 12px 4px; margin: -12px 0 16px -4px;
  transition: color 140ms var(--ease);
}
.res-back:hover, .res-back:focus-visible { color: var(--ink); }
.res-back .arw { transition: transform 140ms var(--ease); }
.res-back:hover .arw { transform: translateX(-3px); }

/* first band on a tool/guide page needs to clear the fixed nav. It also must NOT
 * inherit the home page's full-height vertical centering — content starts at the
 * top and flows naturally, so tools and guides are readable immediately. */
.band--top {
  padding-top: clamp(112px, 14vh, 156px);
  min-height: auto;
  display: block;
}

/* ============================================================ HUB (index) */
/* The hub stacks a hero + two lane sections. Unlike the home page, these should
 * NOT each be a full 100vh screen — the magnet cards are the point and must be
 * reachable fast. Collapse the bands to natural height with generous padding. */
#res-top { min-height: auto; padding-bottom: 0; }
#lane-monetize, #lane-build { min-height: auto; padding-top: clamp(20px, 4vw, 40px); padding-bottom: clamp(40px, 6vw, 72px); display: block; }
#lane-build { padding-bottom: clamp(64px, 9vw, 120px); }

.res-hero { text-align: left; }
.res-hero h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.3rem, 4.4vw, 3.7rem); letter-spacing: -0.02em; line-height: 1.08;
  /* ~32ch keeps the ~58-char headline to two balanced lines at every width
   * (instead of a fragile forced <br> that produced 3 lines on wide/zoomed
   * screens). text-wrap:balance evens the two lines. */
  max-width: 32ch; text-wrap: balance; margin: 0;
}
.res-hero h1 .it { font-style: italic; }
.res-hero h1 .grad {
  font-style: italic;
  background: linear-gradient(96deg, #5B6FE0 0%, #6A53CE 45%, #9E6BD8 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.res-hero-sub {
  font-family: var(--font-serif); font-size: clamp(1.1rem, 1.8vw, 1.34rem);
  line-height: 1.55; color: var(--ink); max-width: 56ch; margin: 26px 0 0;
}

/* lane heading that introduces each group of magnets */
.lane-head { margin: 0 0 6px; }
.lane-head h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.02em; line-height: 1.14; margin: 0;
}
.lane-head h2 .it { font-style: italic; }
.lane-sub {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.06rem, 1.6vw, 1.2rem); color: var(--mute); margin: 10px 0 0; max-width: 60ch;
}
.lane-block { margin-top: clamp(48px, 7vw, 84px); }
.lane-block:first-of-type { margin-top: clamp(40px, 6vw, 64px); }

/* the magnet cards grid */
.magnet-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px;
}
@media (max-width: 900px) { .magnet-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .magnet-grid { grid-template-columns: 1fr; } }

.magnet {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 26px 24px 24px; text-decoration: none;
  background: #FFFFFF; border: 1px solid var(--rule); border-radius: var(--r-card);
  box-shadow: 0 24px 44px -34px rgba(40, 36, 70, 0.4);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.magnet:hover, .magnet:focus-visible {
  transform: translateY(-4px); border-color: #E0DAF0;
  box-shadow: 0 34px 56px -30px rgba(70, 58, 160, 0.34);
}
.magnet-glow {
  position: absolute; top: -70px; right: -60px; width: 190px; height: 190px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 50% 50%, var(--c1, #B9A8F0) 0%, var(--c2, #7E96E8) 46%, transparent 72%);
  opacity: 0.34; filter: blur(16px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.magnet:hover .magnet-glow { opacity: 0.5; transform: scale(1.12); }
.magnet > *:not(.magnet-glow) { position: relative; z-index: 1; }

.magnet-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: #FFFFFF; background: var(--accent-grad); margin-bottom: 18px;
  box-shadow: 0 10px 22px -12px rgba(106,83,206,0.7);
}
.magnet-ico svg { width: 23px; height: 23px; }
.magnet-kind {
  font-family: var(--font-display); font-weight: 500; font-size: 0.64rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); margin: 0 0 8px;
}
.magnet h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 1.34rem; letter-spacing: -0.014em; line-height: 1.2; color: var(--ink); margin: 0;
}
.magnet p {
  font-family: var(--font-body); font-size: 0.99rem; line-height: 1.5;
  color: #3B3D42; margin: 10px 0 0;
}
.magnet-cta {
  margin-top: auto; padding-top: 18px;
  font-family: var(--font-display); font-weight: 500; font-size: 0.9rem; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.magnet-cta .arw { transition: transform 160ms var(--ease); }
.magnet:hover .magnet-cta .arw { transform: translateX(4px); }
.magnet-live {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-family: var(--font-display); font-weight: 500; font-size: 0.62rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--good);
  padding: 4px 10px; border-radius: 999px; background: rgba(46,158,107,0.1);
  border: 1px solid rgba(46,158,107,0.24); margin-bottom: 14px;
}
.magnet-live i { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(46,158,107,0.18); }

/* ===================================================== TOOL PAGE SCAFFOLD */
.tool-head { max-width: 46ch; }
.tool-head h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.3rem, 4.6vw, 3.5rem); letter-spacing: -0.02em; line-height: 1.08; margin: 0;
}
.tool-head h1 .it { font-style: italic; }
.tool-head .grad {
  font-style: italic;
  background: linear-gradient(96deg, #5B6FE0 0%, #6A53CE 45%, #9E6BD8 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tool-sub {
  font-family: var(--font-serif); font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  line-height: 1.55; color: var(--ink); margin: 22px 0 0; max-width: 58ch;
}
.tool-sub em { font-style: italic; }

/* a self-contained white panel that holds a tool's UI */
.tool-panel {
  margin-top: clamp(34px, 5vw, 52px);
  background: #FFFFFF; border: 1px solid var(--rule); border-radius: var(--r-panel);
  box-shadow: 0 40px 90px -50px rgba(40, 36, 70, 0.5);
  overflow: hidden;
}
.tool-panel-pad { padding: clamp(24px, 4vw, 40px); }

/* generic labeled field (light surface, unlike the dark contact-card fields) */
.rfield { margin: 0 0 18px; }
.rfield:last-child { margin-bottom: 0; }
.rfield label {
  display: block; font-family: var(--font-display); font-weight: 500; font-size: 0.82rem;
  letter-spacing: 0.01em; color: var(--ink); margin: 0 0 8px;
}
.rfield .hint { font-family: var(--font-display); font-weight: 400; font-size: 0.74rem; color: var(--mute); margin-left: 8px; }
.rfield input, .rfield select, .rfield textarea {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: #FBFAF8; border: 1px solid var(--rule); border-radius: 12px;
  padding: 14px 16px; transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
/* max(16px, …) is load-bearing, not cosmetic: iOS Safari force-zooms the viewport
 * when a focused field is under 16px and never zooms back out on blur, stranding
 * the user zoomed and scrolling sideways mid-task. This is the code-audit paste
 * box — the primary conversion action on that page. */
.rfield textarea { resize: vertical; min-height: 180px; font-family: var(--font-mono); font-size: max(16px, 0.86rem); line-height: 1.5; }
@media (min-width: 561px) { .rfield textarea { font-size: 0.86rem; } }
.rfield input::placeholder, .rfield textarea::placeholder { color: #9A9DA3; }
/* mono field (repo URL). Stays >=16px on phones for the same iOS zoom reason as
 * the textarea above; the smaller desktop size is restored past the breakpoint. */
.rfield input.is-mono { font-family: var(--font-mono); font-size: max(16px, 0.9rem); }
@media (min-width: 561px) { .rfield input.is-mono { font-size: 0.9rem; } }
.rfield input:hover, .rfield select:hover, .rfield textarea:hover { border-color: #CFC9DE; }
.rfield input:focus, .rfield select:focus, .rfield textarea:focus { outline: none; border-color: var(--accent); background: #FFFFFF; box-shadow: 0 0 0 3px rgba(106,83,206,0.12); }
/* The row owns its own spacing; its children must not. Previously each .rfield
 * kept its 18px bottom margin inside the grid, and :last-child zeroed only the
 * right-hand one — so the two cells had unequal trailing space and the gap to the
 * next field depended on which column happened to be taller. */
.rfield-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 18px; }
.rfield-row > .rfield { margin: 0; }
.rfield-row:last-child { margin-bottom: 0; }
/* stacked, the column gap becomes vertical rhythm, so match the 18px used between
 * standalone fields rather than leaving a tighter 16px */
@media (max-width: 560px) { .rfield-row { grid-template-columns: 1fr; gap: 18px; } }

/* segmented control (used by the audit input-mode switch + calculator toggles) */
.seg {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--rule);
}
.seg button {
  appearance: none; border: 0; cursor: pointer; background: transparent;
  font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--mute);
  padding: 9px 18px; border-radius: 999px; transition: color 140ms var(--ease), background 140ms var(--ease);
}
.seg button.is-on { color: var(--ink); background: #FFFFFF; box-shadow: 0 1px 2px rgba(17,18,19,0.1); }
/* The three labels need ~348px against ~279px of phone content width, and .seg
 * doesn't wrap — so the buttons shrank to min-content and every label broke
 * mid-word. Full-width equal columns fit them on one line each, at 44px tall. */
@media (max-width: 560px) {
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1 1 0; min-height: 44px; padding: 12px 8px; font-size: 0.8rem; white-space: nowrap; }
}

/* ---------------------------------------------------- AUDIENCE CALCULATOR */
.calc-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; }
.calc-inputs { padding: clamp(24px, 4vw, 40px); border-right: 1px solid var(--rule); }
/* Stacked, the sliders stay ABOVE the result: you move the levers, then you see
 * what they did. Reordering broke that causal reading. The cost is that the
 * number is off-screen while you drag, which .calc-sticky below solves instead. */
@media (max-width: 860px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-inputs { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* a slider row: label + live value, then the range input */
.slider-row { margin: 0 0 26px; }
.slider-row:last-child { margin-bottom: 0; }
.slider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.slider-head label { flex: 1 1 auto; min-width: 0; font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--ink); }
/* the .hint rule below was scoped to .rfield only, so slider hints rendered at
 * full label weight — the label and its explainer were indistinguishable and the
 * row's hierarchy collapsed into three lines of identical text on a phone. */
.slider-head .hint {
  display: block; margin: 3px 0 0;
  font-family: var(--font-display); font-weight: 400; font-size: 0.74rem; color: var(--mute);
}
.slider-val { font-family: var(--font-body); font-weight: 500; font-size: 1.16rem; letter-spacing: -0.01em; color: var(--accent); }
/* the audience value is a real input, not a readout — dashed underline is the
 * affordance. 16px min so iOS doesn't zoom when it takes focus. */
.slider-val--edit {
  flex: 0 0 auto; width: 7.5ch; padding: 2px 0; text-align: right;
  font-size: max(16px, 1.16rem);
  background: transparent; border: 0; border-bottom: 1px dashed rgba(106,83,206,0.45); border-radius: 0;
  transition: border-color 140ms var(--ease);
}
.slider-val--edit:hover { border-bottom-color: var(--accent); }
.slider-val--edit:focus { outline: none; border-bottom-color: var(--accent); border-bottom-style: solid; }
.slider-scale span:nth-child(2) { color: #8C88A0; }
/* The element itself is the touch target, so it must be finger-height (44px) and
 * transparent; the visible 6px track is painted on the runnable-track pseudo.
 * Setting height:6px on the input (the old rule) meant the thumb overflowed a
 * 6px hit box — the parts you could see above and below the track were not
 * tappable, which made all three calculator sliders nearly undraggable on touch.
 * touch-action:pan-y lets a vertical swipe still scroll the page from the slider. */
input[type="range"].slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px;
  background: transparent; outline: none; cursor: pointer; touch-action: pan-y;
  margin: -11px 0; /* keep the 44px box from changing the row's visual rhythm */
}
input[type="range"].slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #E4E0F2; }
input[type="range"].slider::-moz-range-track { height: 6px; border-radius: 3px; background: #E4E0F2; }
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: #FFFFFF; border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(106,83,206,0.4); cursor: pointer;
  margin-top: -10px; /* centers the 26px thumb on the 6px track */
}
input[type="range"].slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(106,83,206,0.4); cursor: pointer;
}
input[type="range"].slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(106,83,206,0.25); }
.slider-scale { display: flex; justify-content: space-between; margin-top: 7px; font-family: var(--font-display); font-size: 0.68rem; color: #6E6A82; }

/* the result panel (right / bottom) */
.calc-result {
  padding: clamp(24px, 4vw, 40px);
  background: linear-gradient(160deg, rgba(126,150,232,0.07), rgba(158,107,216,0.06));
  display: flex; flex-direction: column;
}
.calc-result-eyebrow { font-family: var(--font-display); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); margin: 0 0 10px; }
/* the 6vw middle term never wins on a phone (6vw of 375px = 22.5px, well under
 * the old 2.8rem floor), so the number stayed desktop-sized against ~285px of
 * usable width. A lower floor + steeper vw makes it actually responsive while
 * still hitting 4rem on desktop. */
.calc-big {
  font-family: var(--font-body); font-weight: 500; font-size: clamp(2.2rem, 9vw, 4rem);
  letter-spacing: -0.03em; line-height: 1; color: var(--ink); margin: 0;
  font-feature-settings: 'pnum';
}
.calc-big .per { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; letter-spacing: 0; color: var(--mute); margin-left: 6px; }
.calc-note { font-family: var(--font-body); font-size: 0.95rem; line-height: 1.5; color: #3B3D42; margin: 12px 0 0; }

.calc-breakdown { margin-top: 26px; display: flex; flex-direction: column; gap: 0; border-top: 1px solid rgba(126,150,232,0.24); }
.calc-line { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(126,150,232,0.16); }
.calc-line:last-child { border-bottom: 0; }
.calc-line-k { font-family: var(--font-body); font-size: 0.98rem; color: #3B3D42; }
.calc-line-k b { color: var(--ink); font-weight: 500; }
.calc-line-v { font-family: var(--font-body); font-weight: 500; font-size: 1.06rem; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.calc-vs {
  margin-top: 22px; padding: 16px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.7); border: 1px solid rgba(126,150,232,0.28);
  font-family: var(--font-body); font-size: 0.98rem; line-height: 1.5; color: #3B3D42;
}
.calc-vs b { color: var(--ink); font-weight: 500; }
.calc-cta-row { margin-top: 26px; }
.calc-disclaimer { font-family: var(--font-display); font-size: 0.72rem; line-height: 1.5; color: var(--mute); margin: 18px 0 0; }
.calc-disclaimer b { color: var(--ink); font-weight: 600; }
/* this block holds the #comps footnote — the payoff for tapping .calc-fn — so it
 * can't stay 11.5px grey on the device most people read it on. */
@media (max-width: 860px) { .calc-disclaimer { font-size: 0.8rem; line-height: 1.6; color: #5A5D63; } }
/* a bare <sup> is about an 8x12px tap target. Pad it out to a real one on touch
 * without disturbing the baseline (negative margin absorbs the padding). */
.calc-fn {
  display: inline-block; color: var(--accent); text-decoration: none; font-weight: 600;
  min-width: 24px; padding: 4px 6px; margin: -4px -2px; text-align: center;
}
.calc-fn sup { font-size: 0.7em; }
@media (pointer: coarse) { .calc-fn { min-width: 44px; min-height: 44px; padding: 12px; margin: -12px -4px; } }
#comps:target { background: rgba(106,83,206,0.1); border-radius: 4px; }

/* ---- live result strip (mobile only, audience calculator) ----
 * Sliders sit above the result so the page reads causally (move the levers, then
 * see the outcome). That leaves the number off-screen exactly while you're
 * dragging, so this mirrors the headline figure at the bottom of the viewport
 * until the real result panel scrolls into view, then retires. Appears only once
 * a slider has actually been touched — it's feedback, not furniture. */
.calc-sticky { display: none; }
@media (max-width: 860px) {
  .calc-sticky {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 11px max(16px, env(safe-area-inset-left)) calc(11px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right));
    background: rgba(255,255,255,0.93); backdrop-filter: blur(14px);
    border-top: 1px solid var(--rule);
    transform: translateY(110%); transition: transform 240ms var(--ease);
  }
  .calc-sticky.is-on { transform: translateY(0); }
  .calc-sticky.is-on.is-hidden { transform: translateY(110%); }
  .calc-sticky-k {
    flex: 0 1 auto; min-width: 0;
    font-family: var(--font-display); font-weight: 500; font-size: 0.76rem;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .calc-sticky-v {
    flex: 0 0 auto;
    font-family: var(--font-body); font-weight: 500; font-size: 1.5rem;
    letter-spacing: -0.02em; color: var(--ink); font-feature-settings: 'pnum';
  }
  .calc-sticky-v .per { font-family: var(--font-display); font-weight: 400; font-size: 0.8rem; color: var(--mute); margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) { .calc-sticky { transition: none; } }

/* ------------------------------------------------------ CODE-AUDIT TOOL */
.audit-modes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.audit-mode-panel { display: none; }
.audit-mode-panel.is-on { display: block; }

/* file dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 40px 24px; text-align: center; cursor: pointer;
  border: 1.5px dashed #CFC9DE; border-radius: 16px; background: #FBFAF8;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: rgba(106,83,206,0.04); }
.dropzone-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #FFFFFF; background: var(--accent-grad); }
.dropzone-ico svg { width: 22px; height: 22px; }
.dropzone-title { font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--ink); }
/* "drop it here" is meaningless on touch — tapping already opens the picker, the
 * words were just describing an interaction the device doesn't have. */
@media (hover: none), (pointer: coarse) { .dz-desktop { display: none; } }
.dropzone-sub { font-family: var(--font-display); font-size: 0.82rem; color: var(--mute); }
.dropzone-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.dropzone-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 0.8rem; color: #3B3D42; padding: 8px 12px; background: #FFFFFF; border: 1px solid var(--rule); border-radius: 8px; margin: 0; }
/* A long mono filename (SubscriptionEntitlementManager.swift) has no break
 * opportunity and a flex item won't shrink below its content by default — so it
 * used to push "remove" past the panel edge, where .tool-panel's clip ate it and
 * the file could no longer be removed at all. Truncate the name instead. */
.dropzone-list li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-list li .rm {
  flex: 0 0 auto; cursor: pointer; color: var(--mute); font-family: var(--font-display);
  text-decoration: underline; /* no hover on touch to signal it's interactive */
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; margin: -14px 0;
}

/* the gate row: email + run button, always required before running */
.audit-gate { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--rule); }
.audit-run-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.audit-run-row .rfield { flex: 1; min-width: 220px; margin: 0; }
/* baseline-aligns the button with the input below its label (was an inline style
 * on the button in code-audit/index.html) */
.audit-run-row .btn { flex-shrink: 0; align-self: stretch; margin-top: 30px; }
/* The row always wrapped on a phone (220px field + ~186px button), leaving the
 * button on its own line with an orphaned 30px gap and still only ~186px wide —
 * align-self:stretch is cross-axis only, so it never went full width. */
@media (max-width: 560px) {
  .audit-run-row { flex-direction: column; }
  .audit-run-row .rfield { min-width: 0; width: 100%; }
  .audit-run-row .btn { margin-top: 12px; width: 100%; }
}
.audit-consent { font-family: var(--font-display); font-size: 0.74rem; line-height: 1.5; color: var(--mute); margin: 12px 0 0; }

/* run state: spinner + status log */
.audit-running { display: none; text-align: center; padding: 44px 24px; }
.audit-running.is-on { display: block; }
.spinner { width: 40px; height: 40px; margin: 0 auto 20px; border-radius: 50%; border: 3px solid #E4E0F2; border-top-color: var(--accent); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
/* min-height assumed one line, but several of the cycling status strings wrap to
 * two in a phone-width column — so the spinner block jumped ~19px every 2.6s for
 * the whole wait. Reserve two lines. */
.audit-status { font-family: var(--font-mono); font-size: 0.86rem; color: var(--mute); min-height: 2.8em; }

/* ---- the report ---- */
.report { display: none; }
.report.is-on { display: block; }
.report-summary {
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
  padding: clamp(22px, 3.5vw, 32px); border-radius: 18px;
  background: linear-gradient(160deg, rgba(126,150,232,0.08), rgba(158,107,216,0.06));
  border: 1px solid rgba(126,150,232,0.24); margin-bottom: 28px;
}
@media (max-width: 560px) { .report-summary { grid-template-columns: 1fr; text-align: center; } }
/* the grade dial */
.report-grade { position: relative; width: 108px; height: 108px; justify-self: center; }
.report-grade svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.report-grade-label { position: absolute; inset: 0; display: grid; place-items: center; }
.report-grade-letter { font-family: var(--font-body); font-weight: 500; font-size: 2.4rem; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.report-summary-body h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.4rem, 2.4vw, 1.8rem); letter-spacing: -0.015em; line-height: 1.18; margin: 0 0 8px; }
.report-summary-body p { font-family: var(--font-body); font-size: 1rem; line-height: 1.5; color: #3B3D42; margin: 0; }
.report-counts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.count-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 500; font-size: 0.78rem; padding: 5px 12px; border-radius: 999px; }
.count-pill i { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; }
/* darker text on the red/amber tints so the pill labels clear AA (dots keep the
 * brighter --crit/--warn). */
.count-pill.is-crit { color: #B23A35; background: rgba(217,83,79,0.1); } .count-pill.is-crit i { background: var(--crit); }
.count-pill.is-warn { color: #8A5A1E; background: rgba(217,138,61,0.12); } .count-pill.is-warn i { background: var(--warn); }
.count-pill.is-good { color: var(--good); background: rgba(46,158,107,0.1); } .count-pill.is-good i { background: var(--good); }

/* finding cards, grouped by category */
.finding-group { margin-bottom: 26px; }
.finding-group-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.finding-group-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; letter-spacing: -0.005em; color: var(--ink); margin: 0; }
.finding-group-head .n { font-family: var(--font-display); font-size: 0.78rem; color: var(--mute); background: var(--panel); padding: 2px 9px; border-radius: 999px; }

.finding {
  display: grid; grid-template-columns: auto 1fr; gap: 14px;
  padding: 16px 18px; border-radius: 14px; border: 1px solid var(--rule); background: #FFFFFF;
  margin-bottom: 10px;
}
.finding-sev { flex: 0 0 auto; width: 54px; text-align: center; }
/* the fixed 54px severity column left ~173px (~26ch) for the densest text on the
 * page. Stack the badge above the body and the measure roughly doubles. */
@media (max-width: 560px) {
  .finding { grid-template-columns: 1fr; gap: 8px; padding: 14px 15px; }
  .finding-sev { width: auto; text-align: left; }
}
.sev-badge { font-family: var(--font-display); font-weight: 600; font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 7px; display: inline-block; }
/* darker fills so white badge text clears WCAG AA 4.5:1 (the lighter --crit/--warn
 * stay for dots + icons, where color-only is fine). */
.sev-badge.p0 { color: #FFFFFF; background: #C2352F; }
.sev-badge.p1 { color: #FFFFFF; background: #A9611C; }
.sev-badge.p2 { color: var(--ink); background: var(--panel); border: 1px solid var(--rule); }
.finding-title { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; letter-spacing: -0.005em; color: var(--ink); margin: 0 0 6px; }
.finding-body { font-family: var(--font-body); font-size: 0.95rem; line-height: 1.55; color: #3B3D42; margin: 0; }
.finding-body code, .finding-where {
  font-family: var(--font-mono); font-size: 0.82rem; background: var(--panel);
  padding: 1px 6px; border-radius: 5px; color: #4A3F94;
}
/* File paths (src/app/api/webhooks/stripe/route.ts:42) have no break opportunity,
 * so at a phone's ~173px body measure they ran past the card and got clipped by
 * .tool-panel — losing the back half of the most actionable field in the report. */
.finding-where { display: block; max-width: 100%; margin-top: 8px; overflow-wrap: anywhere; word-break: break-word; }
.finding-body code { overflow-wrap: anywhere; }
.finding-fix { margin-top: 8px; font-family: var(--font-body); font-size: 0.92rem; line-height: 1.5; color: #3B3D42; }
.finding-fix b { color: var(--ink); font-weight: 500; }

/* the "locked" deeper-dive CTA that caps the report */
.report-cta {
  margin-top: 30px; padding: clamp(24px, 4vw, 34px); border-radius: 20px;
  background: var(--dark); color: var(--dark-fg); text-align: center;
}
.report-cta h3 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.015em; color: var(--dark-fg); margin: 0 0 10px; }
.report-cta p { font-family: var(--font-body); font-size: 1.02rem; line-height: 1.55; color: var(--dark-mute); margin: 0 auto 22px; max-width: 52ch; }
.report-cta .btn { background: #FFFFFF; color: var(--ink); }
.report-cta .btn:hover { background: #E9E7E2; }

.audit-error { display: none; margin-top: 20px; padding: 16px 18px; border-radius: 12px; background: rgba(217,83,79,0.08); border: 1px solid rgba(217,83,79,0.24); font-family: var(--font-body); font-size: 0.95rem; color: #8B2F2C; }
.audit-error.is-on { display: block; }

/* what-we-check chips under the tool */
.check-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.check-chip { font-family: var(--font-display); font-size: 0.78rem; color: #3B3D42; padding: 7px 14px; border-radius: 999px; background: #FFFFFF; border: 1px solid var(--rule); display: inline-flex; align-items: center; gap: 7px; }
.check-chip svg { width: 14px; height: 14px; color: var(--accent); }

/* ------------------------------------------------------ GUIDE (article) */
.guide-wrap { max-width: 760px; margin: 0 auto; }
.guide-hero { max-width: 760px; margin: 0 auto; }
.guide-hero h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.3rem, 4.6vw, 3.4rem); letter-spacing: -0.02em; line-height: 1.1; margin: 0;
}
.guide-hero h1 .it { font-style: italic; }
.guide-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 22px 0 0; font-family: var(--font-display); font-size: 0.82rem; color: var(--mute); }
.guide-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #C9C4B8; }
.guide-lede { font-family: var(--font-serif); font-size: clamp(1.14rem, 1.9vw, 1.34rem); line-height: 1.55; color: var(--ink); margin: 26px 0 0; }
.guide-lede em { font-style: italic; }

/* table of contents card */
.guide-toc {
  margin: 40px 0; padding: 22px 26px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--rule);
}
.guide-toc-title { font-family: var(--font-display); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin: 0 0 14px; }
.guide-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 9px; }
.guide-toc li { counter-increment: toc; margin: 0; }
.guide-toc a { font-family: var(--font-body); font-size: 1rem; color: var(--ink); text-decoration: none; display: flex; gap: 12px; align-items: baseline; transition: color 140ms var(--ease); }
.guide-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-display); font-weight: 500; font-size: 0.82rem; color: var(--accent); flex: 0 0 auto; }
.guide-toc a:hover { color: var(--accent); }

/* guide body typography */
.guide-body { }
.guide-body h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem); letter-spacing: -0.018em; line-height: 1.18;
  /* no scroll-margin-top here: it would add to html's scroll-padding-top (they
   * stack per CSSOM View), which is what left a 74px dead gap under the nav on
   * every TOC jump. The scrollport's padding is the one source of truth. */
  margin: 56px 0 18px;
}
.guide-body h2 .it { font-style: italic; }
.guide-body h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.24rem; letter-spacing: -0.01em; color: var(--ink); margin: 34px 0 12px; }
.guide-body p { font-family: var(--font-body); font-size: 1.14rem; line-height: 1.68; color: #2E3035; margin: 0 0 1.15em; }
.guide-body p .it, .guide-body em { font-style: italic; }
.guide-body strong { font-weight: 600; color: var(--ink); }
.guide-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(106,83,206,0.3); transition: border-color 140ms var(--ease); }
.guide-body a:hover { border-bottom-color: var(--accent); }
.guide-body ul, .guide-body ol { margin: 0 0 1.3em; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.guide-body ul li, .guide-body ol li { font-family: var(--font-body); font-size: 1.12rem; line-height: 1.6; color: #2E3035; margin: 0; padding-left: 30px; position: relative; }
.guide-body ul li::before { content: ""; position: absolute; left: 4px; top: 0.72em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0.7; }
.guide-body ol { counter-reset: gl; }
.guide-body ol li { counter-increment: gl; }
.guide-body ol li::before { content: counter(gl); position: absolute; left: 0; top: 0.05em; font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--accent); width: 20px; text-align: center; }
.guide-body li b, .guide-body li strong { color: var(--ink); font-weight: 600; }

/* pull-quote / key callout */
.guide-callout {
  margin: 34px 0; padding: 24px 28px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(126,150,232,0.08), rgba(158,107,216,0.06));
  border: 1px solid rgba(126,150,232,0.26); border-left: 3px solid var(--accent);
}
.guide-callout p { font-family: var(--font-serif); font-size: 1.16rem; line-height: 1.55; color: var(--ink); margin: 0; }
.guide-callout p:last-child { margin-bottom: 0; }
.guide-callout .k { font-family: var(--font-display); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }

/* interactive checklist (for the launch checklist guide) */
.checklist { margin: 22px 0; display: flex; flex-direction: column; gap: 0; }
.checklist-item {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  padding: 16px 0; border-bottom: 1px solid var(--rule); cursor: pointer;
  /* these rows are large and text-dense, so on iOS a tap with any drag starts a
   * text selection instead of firing click, and a long-press raises the
   * Copy/Look Up callout on something declared as a control. */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.checklist-item:first-child { border-top: 1px solid var(--rule); }
.checklist-box {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; margin-top: 1px;
  border: 1.5px solid #CFC9DE; background: #FFFFFF; display: grid; place-items: center;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.checklist-box svg { width: 14px; height: 14px; color: #FFFFFF; opacity: 0; transition: opacity 120ms var(--ease); }
.checklist-item.is-done .checklist-box { background: var(--accent); border-color: var(--accent); }
.checklist-item.is-done .checklist-box svg { opacity: 1; }
.checklist-body { }
.checklist-item.is-done .checklist-title { color: var(--mute); text-decoration: line-through; text-decoration-color: rgba(110,114,122,0.5); }
.checklist-title { font-family: var(--font-body); font-weight: 500; font-size: 1.08rem; letter-spacing: -0.005em; color: var(--ink); margin: 0; }
.checklist-tag { font-family: var(--font-display); font-weight: 600; font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin-left: 8px; vertical-align: middle; }
/* 9.6px uppercase was the smallest type on the page by a wide margin, and it
 * carries the page's whole triage idea (Blocker / Do before wide / Post-launch). */
@media (max-width: 600px) { .checklist-tag { font-size: 0.68rem; padding: 3px 8px; } }
.checklist-tag.blocker { color: #B23A35; background: rgba(217,83,79,0.1); }
.checklist-tag.soft { color: #8A5A1E; background: rgba(217,138,61,0.12); }
.checklist-tag.post { color: var(--mute); background: var(--panel); }
.checklist-note { font-family: var(--font-body); font-size: 0.98rem; line-height: 1.5; color: #5A5D63; margin: 6px 0 0; }
.checklist-note code { font-family: var(--font-mono); font-size: 0.82rem; background: var(--panel); padding: 1px 6px; border-radius: 5px; color: #4A3F94; }
/* top must clear the real nav (92px + notch inset), not the old hardcoded 76px —
 * that hid the bar's top third behind the frosted nav in mobile Safari, and hid
 * the bar entirely in standalone mode where the inset adds ~47-59px. */
.checklist-progress { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 5; margin: 0 0 8px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 12px; background: rgba(255,255,255,0.86); backdrop-filter: blur(10px); border: 1px solid var(--rule); box-shadow: 0 10px 30px -20px rgba(40,36,70,0.3); }
.checklist-progress-bar { flex: 1; height: 8px; border-radius: 4px; background: #E4E0F2; overflow: hidden; }
.checklist-progress-bar span { display: block; height: 100%; width: 0%; border-radius: 4px; background: var(--accent-grad); transition: width 260ms var(--ease); }
.checklist-progress-txt { font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--ink); white-space: nowrap; }

/* the email-to-save band inside guides + the shared bottom capture */
.save-band {
  margin: 48px 0 0; padding: clamp(28px, 4.5vw, 44px); border-radius: 24px;
  background: var(--dark); color: var(--dark-fg);
}
.save-band h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.018em; color: var(--dark-fg); margin: 0 0 10px; }
.save-band p { font-family: var(--font-body); font-size: 1.04rem; line-height: 1.55; color: var(--dark-mute); margin: 0 0 22px; max-width: 54ch; }
.save-band p em { font-family: var(--font-serif); font-style: italic; color: var(--dark-fg); }
.save-form { display: flex; gap: 12px; flex-wrap: wrap; max-width: 520px; }
.save-form input {
  flex: 1; min-width: 220px; font-family: var(--font-body); font-size: 1rem; color: var(--dark-fg);
  background: #1E1F22; border: 1px solid var(--dark-rule); border-radius: 12px; padding: 15px 16px;
  transition: border-color 140ms var(--ease);
}
.save-form input::placeholder { color: #6A6D74; }
.save-form input:focus { outline: none; border-color: #7E8188; }
.save-form .btn { flex-shrink: 0; }
/* once the form wraps (it does on every phone), a natural-width button reads as
 * an orphan floating left of the field above it. */
@media (max-width: 560px) { .save-form .btn { width: 100%; } }
.save-note { font-family: var(--font-display); font-size: 0.74rem; color: var(--dark-mute); margin: 14px 0 0; }
.save-success { display: none; }
.save-success.show { display: block; }
.save-success .big { font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; color: var(--dark-fg); margin: 0 0 8px; }
.save-form.hide { display: none; }

/* generic success state for tool forms (light) */
.tool-success { display: none; text-align: center; padding: clamp(28px, 5vw, 48px); }
.tool-success.show { display: block; }
.tool-success .ok-ico { width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; background: var(--accent-grad); }
.tool-success .ok-ico svg { width: 30px; height: 30px; }
.tool-success .big { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -0.015em; color: var(--ink); margin: 0 0 12px; }
.tool-success p { font-family: var(--font-body); font-size: 1.06rem; line-height: 1.6; color: #3B3D42; margin: 0 auto; max-width: 46ch; }
.tool-form.hide { display: none; }

/* ============================================ PROTOTYPE REQUEST FLOW ===== */
/* a numbered multi-step form: 1 about you · 2 upload · 3 pick a design ·
 * 4 features · then the 24h confirmation. Steps stack; the whole thing lives in
 * one tool-panel so it reads as a single guided flow. */
.proto-steps { counter-reset: step; }
.proto-step { padding: clamp(24px, 4vw, 40px); border-top: 1px solid var(--rule); }
.proto-step:first-child { border-top: 0; }
.proto-step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.proto-step-n {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  color: #FFFFFF; background: var(--accent-grad); box-shadow: 0 8px 18px -10px rgba(106,83,206,0.7);
}
.proto-step-titles h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
.proto-step-titles p { font-family: var(--font-body); font-size: 0.98rem; line-height: 1.5; color: var(--mute); margin: 6px 0 0; }
.proto-step-body { padding-left: 48px; }
@media (max-width: 560px) { .proto-step-body { padding-left: 0; } }

/* upload dropzone (reuses .dropzone from the audit tool; add PDF affordance) */
.proto-upload-hint { font-family: var(--font-display); font-size: 0.8rem; color: var(--mute); margin: 10px 0 0; }

/* The template gallery + preview modal live entirely in prototype-templates.css,
 * which loads after this file. A full superseded copy used to sit here — including
 * the old centred-with-no-overflow modal and the invisible opacity:0 check badge —
 * which was dead weight and an easy trap to edit by mistake. Removed 2026-07-21. */

/* ---- feature menu (step 4) ---- */
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .feat-grid { grid-template-columns: 1fr; } }
.feat {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 14px 16px; border-radius: 13px; background: #FBFAF8; border: 1px solid var(--rule);
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.feat:hover { border-color: #CFC9DE; }
.feat.is-on { border-color: var(--accent); background: rgba(106,83,206,0.05); }
.feat-box { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px; border: 1.5px solid #CFC9DE; background: #FFFFFF; display: grid; place-items: center; transition: border-color 140ms var(--ease), background 140ms var(--ease); }
.feat-box svg { width: 13px; height: 13px; color: #fff; opacity: 0; transition: opacity 120ms var(--ease); }
.feat.is-on .feat-box { background: var(--accent); border-color: var(--accent); }
.feat.is-on .feat-box svg { opacity: 1; }
.feat-t { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.feat-d { font-family: var(--font-body); font-size: 0.82rem; line-height: 1.4; color: var(--mute); margin: 2px 0 0; }
/* 10 feature rows at ~68px each made step 4 alone ~770px of scrolling. The titles
 * ("Push notifications", "Progress tracking") carry the meaning on their own, so
 * the subtitle is the thing to spend on a phone. Roughly halves the step. */
@media (max-width: 560px) {
  .feat-d { display: none; }
  .feat { align-items: center; padding: 13px 14px; }
}

/* the final submit bar (sticky-ish at the bottom of the panel) */
.proto-submit { padding: clamp(24px, 4vw, 36px); border-top: 1px solid var(--rule); background: #FBFAF8; }
.proto-summary { font-family: var(--font-body); font-size: 0.95rem; color: #3B3D42; margin: 0 0 18px; line-height: 1.5; }
.proto-summary b { color: var(--ink); font-weight: 600; }

/* ---- compact sticky action bar (mobile only, prototype form) ----
 * The form is a single ~3000px scroll on a phone. This keeps "where am I / how do
 * I finish" permanently answered for ~68px of screen (~8%), rather than the full
 * .proto-submit block which would cost three times that. Desktop never sees it —
 * there the submit block is already in view. */
.proto-sticky { display: none; }
@media (max-width: 720px) {
  .proto-sticky {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px max(16px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right));
    background: rgba(255,255,255,0.92); backdrop-filter: blur(14px);
    border-top: 1px solid var(--rule);
    transform: translateY(110%); transition: transform 260ms var(--ease);
  }
  .proto-sticky.is-on { transform: translateY(0); }
  .proto-sticky.is-on.is-hidden { transform: translateY(110%); }
  .proto-sticky .btn { flex: 0 0 auto; padding: 12px 20px; }
  .proto-sticky-state {
    flex: 1 1 auto; min-width: 0;
    font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* keep the last of the form clear of the bar */
  .proto-submit { padding-bottom: calc(36px + 68px); }
}
@media (prefers-reduced-motion: reduce) { .proto-sticky { transition: none; } }

/* ---- soft-keyboard behaviour ----
 * site-chrome.js sets .kb-open on <html> (and --kb-h) whenever the visual viewport
 * shrinks by more than the URL bar's worth. When the keyboard is up, a fixed
 * bottom bar is pinned to a bottom edge the user can no longer see: on iOS it
 * hides behind the keyboard, on some Android builds it floats mid-screen over the
 * field being typed into. Either way it's in the way, so both bars stand down —
 * neither is needed mid-keystroke, and both come back on blur. */
html.kb-open .proto-sticky,
html.kb-open .calc-sticky { transform: translateY(110%); }

/* The lead-capture sheet is the exception: it CONTAINS the field being typed into,
 * so it has to rise above the keyboard rather than get out of the way. */
@media (max-width: 620px) {
  html.kb-open .res-pop-card {
    bottom: var(--kb-h, 0px);
    max-height: calc(100dvh - var(--kb-h, 0px) - 16px);
  }
}

/* a compact "related resources" strip at the bottom of tool/guide pages */
.res-related { margin-top: clamp(56px, 8vw, 96px); }
.res-related h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.018em; margin: 0 0 24px; }
.res-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .res-related-grid { grid-template-columns: 1fr; } }

/* =============================================== smart lead-capture popup ==== */
.res-pop { position: fixed; inset: 0; z-index: 120; opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease); }
.res-pop.is-open { opacity: 1; pointer-events: auto; }
.res-pop-back { position: absolute; inset: 0; background: rgba(20,18,30,0.55); backdrop-filter: blur(5px); }
.res-pop-card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translateY(12px);
  width: min(440px, calc(100vw - 32px));
  /* the card autofocuses its email input; if a soft keyboard opens on a short
   * screen the submit button must still be reachable rather than clipped. */
  max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--dark); color: var(--dark-fg);
  border-radius: 24px; padding: clamp(28px, 5vw, 40px);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.6);
  transition: transform 260ms var(--ease);
}
.res-pop.is-open .res-pop-card { transform: translate(-50%, -50%); }
/* 44px: primary dismiss on a scroll-locking modal, sitting in the screen corner
 * where thumb accuracy is worst. */
.res-pop-x { position: absolute; top: 11px; right: 13px; appearance: none; background: rgba(255,255,255,0.1); border: 0; color: var(--dark-mute); width: 44px; height: 44px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; transition: background 140ms var(--ease), color 140ms var(--ease); }
.res-pop-x:hover { background: rgba(255,255,255,0.16); color: var(--dark-fg); }
.res-pop-eyebrow { font-family: var(--font-display); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 12px; }
.res-pop-title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 1.85rem); letter-spacing: -0.015em; line-height: 1.15; color: var(--dark-fg); margin: 0 0 12px; }
.res-pop-title .grad, .res-pop-title em { font-style: italic; background: linear-gradient(96deg, #7E96E8, #9E6BD8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.res-pop-body { font-family: var(--font-body); font-size: 1.02rem; line-height: 1.5; color: var(--dark-mute); margin: 0 0 22px; }
.res-pop-form { display: flex; flex-direction: column; gap: 10px; }
.res-pop-email {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--dark-fg);
  background: #1E1F22; border: 1px solid var(--dark-rule); border-radius: 12px; padding: 15px 16px;
  transition: border-color 140ms var(--ease);
}
.res-pop-email::placeholder { color: #6A6D74; }
.res-pop-email:focus { outline: none; border-color: #7E8188; }
.res-pop-submit { width: 100%; }
.res-pop-alt { font-family: var(--font-display); font-size: 0.86rem; color: var(--dark-mute); text-align: center; margin: 16px 0 0; }
.res-pop-alt a { color: var(--dark-fg); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.25); transition: border-color 140ms var(--ease); }
.res-pop-alt a:hover { border-bottom-color: var(--dark-fg); }
.res-pop-form.hide { display: none; }
.res-pop-form.hide ~ .res-pop-alt { display: none; }
.res-pop-done { display: none; text-align: center; }
.res-pop-done.show { display: block; }
.res-pop-done .big { font-family: var(--font-serif); font-weight: 500; font-size: 1.4rem; color: var(--dark-fg); margin: 0 0 8px; }
.res-pop-done p { font-family: var(--font-body); font-size: 0.98rem; color: var(--dark-mute); margin: 0; }
@media (prefers-reduced-motion: reduce) { .res-pop, .res-pop-card { transition: opacity 240ms var(--ease); } .res-pop-card { transform: translate(-50%, -50%); } }

/* ---- mobile: bottom sheet, not a takeover ----
 * On a phone a centered scroll-locking modal lands as an interruption in the
 * middle of reading. Same ask, same copy, but it rises from the bottom, leaves
 * the page visible and scrollable behind it, and sits in the thumb zone so
 * dismissing is a flick rather than a search for a small X. */
@media (max-width: 620px) {
  .res-pop { pointer-events: none; }
  .res-pop.is-open { pointer-events: auto; }
  /* no scrim: the page stays readable, which is the point */
  .res-pop-back { background: transparent; backdrop-filter: none; pointer-events: none; }
  .res-pop.is-open .res-pop-back { pointer-events: auto; background: rgba(20,18,30,0.18); }
  .res-pop-card {
    left: 0; right: 0; top: auto; bottom: 0;
    width: auto; max-width: none; max-height: 82dvh;
    transform: translateY(100%);
    border-radius: 22px 22px 0 0;
    padding: 26px 22px calc(26px + env(safe-area-inset-bottom, 0px));
  }
  .res-pop.is-open .res-pop-card { transform: translateY(0); }
  /* grab handle — reads as "flick me away" without needing a label */
  .res-pop-card::before {
    content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.28);
  }
  .res-pop-x { top: 14px; right: 8px; background: transparent; }
  .res-pop-eyebrow { margin-top: 6px; }
  @media (prefers-reduced-motion: reduce) {
    .res-pop-card, .res-pop.is-open .res-pop-card { transform: none; }
  }
}
