/* =============================================================================
   MY SEO AGENTS - Design system v2 ("Coming into view")
   Shared by every page whose <body> carries data-system="v2" (the homepage and
   /spanish-ads). Loaded after style.css, which stays the shared base.
   Tokens are scoped to body[data-system="v2"], so pages still on the original
   system are unaffected. The hp- prefix ("house pattern") marks v2 components.

   Rhythm: dark sections for problems and plans, warm paper sheets for proof,
   facts and FAQs, a dark closer. Emphasis is colour only, never italic.
   Page-specific layouts live in each page's own stylesheet (home.css, ads.css).
   ============================================================================= */

/* ------------------------------ Self-hosted ------------------------------
   Satoshi 400/500 (Fontshare, ITF Free Font License), alongside the 700 face
   declared in style.css. Same family name, so weights resolve normally. */
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ------------------------------- Tokens ---------------------------------- */
body[data-system="v2"] {
  /* Dark neutrals, warmed a few degrees so the azure reads cooler against them */
  --ink:        #0c0b0a;   /* page */
  --ink-1:      #14120f;   /* raised: the "win" half of Stakes */
  --ink-2:      #1c1915;   /* inputs, modal, small surfaces */
  --ink-3:      #25211c;
  --line:       rgba(244, 241, 236, 0.10);
  --line-2:     rgba(244, 241, 236, 0.18);
  --bone:       #f4f1ec;   /* 17.46:1 on --ink */
  --smoke:      #aea89e;   /*  8.33:1 on --ink */
  --smoke-2:    #8a847a;   /*  5.30:1 on --ink (was 4.12:1) */

  /* Paper */
  --paper:      #f3efe8;
  --paper-hi:   #fbf9f5;   /* the prompt card */
  --type:       #15130f;   /* 16.19:1 on --paper */
  --type-soft:  #59534a;   /*  6.64:1 on --paper */
  --type-faint: #6f6a61;   /*  4.69:1 on --paper, small decorative figures */
  --rule:       rgba(21, 19, 15, 0.14);
  --rule-2:     rgba(21, 19, 15, 0.28);

  /* Accent: unchanged azure from the logo. --azure-deep is the paper-side
     accent for text and focus (6.83:1 on --paper). */
  --azure-deep: #0f5589;
  /* Highlighted words in headings. #0f5589 on paper (6.83:1). On the dark
     page #0f5589 is only 2.51:1, under the 3:1 floor for large text, so the
     dark sections use --azure-hi (6.81:1) instead. */
  --hp-hl: var(--azure-hi);

  /* Type: one family. Satoshi carries everything; emphasis is colour, never
     italic. Mono falls back to the system face, so it costs no download. */
  --font-display: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans:    "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  /* Scale (mobile 375 -> desktop 1440) */
  --t-display: clamp(2.75rem, 1.2rem + 6.6vw, 7rem);      /*  44 -> 106/112 */
  --t-h2:      clamp(2.25rem, 1.35rem + 3.9vw, 4.5rem);   /*  36 -> 69/72  */
  --t-h3:      clamp(1.5rem, 1.2rem + 1.2vw, 2rem);       /*  24 -> 32     */
  --t-h4:      clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);/* 19 -> 22     */
  --t-index:   clamp(1.5rem, 0.95rem + 2.2vw, 2.5rem);    /*  24 -> 40     */
  --t-lead:    clamp(1.125rem, 1rem + 0.5vw, 1.375rem);   /*  18 -> 22     */
  --t-body:    clamp(1rem, 0.95rem + 0.2vw, 1.125rem);    /*  16 -> 18     */
  --t-label:   0.8125rem;                                 /*  13           */

  /* Space: 4-based scale; sections get one generous, consistent rhythm */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem;    --s-7: 3rem;   --s-8: 4rem;    --s-9: 6rem; --s-10: 8rem;
  --hp-section: clamp(5rem, min(10vw, 16vh), 10rem);      /*  80 -> 144    */
  --hp-gap-head: clamp(2.5rem, 5vw, 5rem);                /* heading -> body */

  /* Grid */
  --hp-max: 1360px;
  --hp-col-gap: clamp(1rem, 2vw, 2rem);

  /* Shape: three values only */
  --r-sm: 18px;                                /* cards, media              */
  --r-lg: clamp(22px, 2.6vw, 34px);            /* paper sheets              */
  /* --radius-pill (999px) from style.css stays for buttons                */
  --sheet-inset: clamp(0.5rem, 1.1vw, 1.125rem);

  --shadow-card: 0 1px 2px rgba(21, 19, 15, 0.06), 0 22px 44px -26px rgba(21, 19, 15, 0.28);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-system="v2"] ::selection { background: var(--azure); color: #fff; }

/* Reveal: shorter travel than the shared default, so arrivals feel placed
   rather than floated in. Same .reveal / .in hooks as main.js. */
body[data-system="v2"] .reveal { transform: translateY(14px); transition-duration: 0.9s; transition-timing-function: var(--ease-out); }
body[data-system="v2"] .reveal.in { transform: none; }

/* ------------------------------ Primitives -------------------------------- */
.hp-wrap { width: 100%; max-width: calc(var(--hp-max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.hp-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--hp-col-gap); }
.hp-sec { position: relative; padding-block: var(--hp-section); }

.hp-label {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-sans); font-weight: 500; font-size: var(--t-label);
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.2;
  color: var(--smoke);
}
.hp-label::before { content: ""; width: 1.5rem; height: 1px; background: currentColor; opacity: 0.6; }

.hp-display, .hp-h2, .hp-h3 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
.hp-display { font-size: var(--t-display); line-height: 0.96; letter-spacing: -0.045em; }
.hp-h2      { font-size: var(--t-h2);      line-height: 1.0;  letter-spacing: -0.035em; }
.hp-h3      { font-size: var(--t-h3);      line-height: 1.12; letter-spacing: -0.022em; }
.hp-h4      { font-family: var(--font-sans); font-weight: 700; font-size: var(--t-h4); line-height: 1.3; letter-spacing: -0.012em; text-wrap: balance; }
.hp-label + .hp-display, .hp-label + .hp-h2 { margin-top: var(--s-5); }

.hp-lead { font-size: var(--t-lead); line-height: 1.5; color: var(--smoke); max-width: 36ch; text-wrap: pretty; }
.hp-body { font-size: var(--t-body); line-height: 1.65; color: var(--smoke); max-width: 60ch; text-wrap: pretty; }

/* Highlight: one phrase per heading, picked out by colour alone. */
.hp-hl { color: var(--hp-hl); }

/* -------------------------------- Paper ----------------------------------
   Paper sections are inset sheets laid on the dark page. Consecutive paper
   sections join into one sheet: the first rounds its top, the last its foot. */
.hp-paper {
  --smoke: var(--type-soft); --smoke-2: var(--type-faint);
  --line: var(--rule); --line-2: var(--rule-2);
  --hp-hl: var(--azure-deep);
  background: var(--paper); color: var(--type);
  margin-inline: var(--sheet-inset);
}
.hp-paper--top { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.hp-paper--foot { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.hp-paper--whole { border-radius: var(--r-lg); }
.hp-paper ::selection { background: var(--azure-deep); color: #fff; }
.hp-paper :focus-visible { outline-color: var(--azure-deep); }
.hp-paper .hp-label { color: var(--type-soft); }
.hp-paper .btn--ghost { color: var(--type); border-color: var(--rule-2); }
.hp-paper .btn--ghost:hover { background: rgba(21, 19, 15, 0.05); border-color: var(--type); }
.hp-paper .link { color: var(--type); background-image: linear-gradient(var(--azure-deep), var(--azure-deep)); }
.hp-paper .link:hover { color: var(--type); }

/* ------------------------------- Problem ---------------------------------
   One statement, then three consequences at two sizes: the internal problem
   ("you paid and nothing happened") is the heart, so it gets the weight. */
.hp-problem__items { display: grid; gap: var(--s-7); margin-top: var(--hp-gap-head); }
.hp-problem__item { border-top: 1px solid var(--line-2); padding-top: var(--s-5); }
.hp-problem__item .hp-h4 { margin-bottom: var(--s-3); }
.hp-problem__item--key { border-top: 2px solid var(--azure-hi); }
.hp-problem__item--key .hp-h3 { margin-bottom: var(--s-4); max-width: 18ch; }
.hp-problem__item--key .hp-body { font-size: var(--t-lead); line-height: 1.55; max-width: 40ch; }

/* ----------------------------- Step by step -------------------------------
   The intro holds still (CSS sticky, no scroll handler) while the three steps
   pass it. steps.js marks the step level with the viewport middle; without JS,
   or with reduced motion, every step simply stays at full strength. */
.hp-how__intro .hp-lead { margin-top: var(--s-5); }
.hp-steps { margin-top: var(--hp-gap-head); }
.hp-step { border-top: 1px solid var(--line); padding-block: clamp(2rem, 4vw, 3.5rem); }
.hp-step__n {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(3rem, 2rem + 4vw, 6rem); line-height: 0.9; letter-spacing: -0.05em;
  color: var(--smoke-2); font-variant-numeric: tabular-nums; margin-bottom: var(--s-5);
  transition: color 0.5s var(--ease-out);
}
.hp-step .hp-h3 { margin-bottom: var(--s-3); max-width: 20ch; }
.hp-step .step__cta { margin-top: var(--s-4); }
/* The resting steps step back by colour, not opacity, so their text keeps AA
   contrast: titles drop to --smoke (8.33:1), body copy is unchanged. */
.hp-step .hp-h3 { transition: color 0.5s var(--ease-out); }
.hp-steps.is-live .hp-step:not(.is-current) .hp-h3 { color: var(--smoke); }
.hp-steps.is-live .hp-step.is-current .hp-step__n { color: var(--azure-hi); }
.hp-plan__end {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-5) var(--s-7); margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--line);
}
.hp-plan__outcome {
  flex: 1 1 22rem; max-width: 30ch;
  font-family: var(--font-display); font-weight: 500; font-size: var(--t-h4);
  line-height: 1.35; letter-spacing: -0.015em; color: var(--bone);
}

/* ------------------------------ Agreement ---------------------------------
   Read as clauses: a ruled 2 x 2, numbered like a contract. */
.hp-agree { padding-top: clamp(2rem, 4vw, 4rem); }
.hp-agree__inner { border-top: 1px solid var(--line); padding-top: clamp(3rem, 6vw, 6rem); }
.hp-clauses { display: grid; margin-top: var(--hp-gap-head); border-top: 1px solid var(--line); }
.hp-clause { padding-block: var(--s-6); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: var(--s-4); }
.hp-clause__n {
  grid-row: 1 / span 2; font-family: var(--font-sans); font-weight: 500; font-size: 1.125rem; letter-spacing: 0.02em;
  line-height: 1.1; color: var(--azure-hi);
}
.hp-clause .hp-h4 { margin-bottom: var(--s-2); }

/* -------------------------- Stakes and success ---------------------------
   Two futures as two halves of the screen. The muted half sits on the page;
   the success half is a raised field that runs to the right edge. */
.hp-stakes { padding-bottom: 0; }
.hp-fork { display: grid; margin-top: var(--hp-gap-head); }
.hp-fork__side { padding: clamp(2.5rem, 5vw, 5rem) var(--gutter) clamp(3rem, 6vw, 6rem); }
.hp-fork__side--win { background: var(--ink-1); }
.hp-fork__t { margin-bottom: var(--s-6); }
.hp-fork__side:not(.hp-fork__side--win) .hp-fork__t { color: var(--smoke); }
.hp-fork__list { display: grid; gap: var(--s-4); }
.hp-fork__list li {
  position: relative; padding-left: 1.75rem;
  font-size: var(--t-lead); line-height: 1.45; color: var(--smoke); max-width: 34ch;
}
.hp-fork__list li::before {
  content: ""; position: absolute; left: 0; top: 0.72em; width: 0.85rem; height: 1px; background: var(--smoke-2);
}
.hp-fork__side--win .hp-fork__list li { color: var(--bone); }
.hp-fork__side--win .hp-fork__list li::before { top: 0.5em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--azure-hi); }
.hp-fork__identity {
  margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line-2); max-width: 22ch;
  font-family: var(--font-display); font-weight: 700; font-size: var(--t-h3); line-height: 1.12; letter-spacing: -0.025em; color: var(--bone);
}

/* --------------------------------- FAQ ------------------------------------
   An indexed two-column layout on paper. Numbers are generated (alt text "")
   so they are not read out. The accordion markup and main.js are unchanged. */
.hp-faq { margin-block: var(--hp-section) 0; }
.hp-faq .acc { margin-top: var(--hp-gap-head); border-top: 1px solid var(--rule-2); counter-reset: faq; }
.hp-faq .acc__item { border-bottom: 1px solid var(--rule); counter-increment: faq; }
.hp-faq .acc__q {
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: baseline; gap: var(--s-4);
  padding-block: clamp(1.1rem, 1.8vw, 1.5rem);
  font-family: var(--font-sans); font-weight: 500; font-size: var(--t-h4); line-height: 1.35; letter-spacing: -0.012em;
  color: var(--type);
}
.hp-faq .acc__q::before {
  content: counter(faq, decimal-leading-zero);
  content: counter(faq, decimal-leading-zero) / "";
  font-size: var(--t-label); font-weight: 500; letter-spacing: 0.04em; color: var(--type-faint);
  font-variant-numeric: tabular-nums;
}
.hp-faq .acc__q:hover { color: var(--azure-deep); }
.hp-faq .acc__i { align-self: center; }
.hp-faq .acc__i::before, .hp-faq .acc__i::after { background: var(--type); }
.hp-faq .acc__a > p { color: var(--type-soft); font-size: var(--t-body); line-height: 1.65; max-width: 60ch; margin-left: calc(2.75rem + var(--s-4)); }

/* -------------------------------- Closer ---------------------------------- */
.hp-closer__inner { position: relative; padding-top: clamp(2.5rem, 5vw, 5rem); }
.hp-closer__inner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--azure-hi);
  transform-origin: left; transition: transform 1.4s var(--ease-out) 0.1s;
}
.hp-closer__inner:not(.in)::before { transform: scaleX(0); }
.hp-closer .hp-display { max-width: 14ch; }
.hp-closer__foot { display: grid; gap: var(--s-6); margin-top: var(--s-7); }
.hp-closer__foot .hp-lead { max-width: 38ch; }
.hp-closer__actions { display: flex; flex-wrap: wrap; gap: var(--s-4); }

/* ----------------------------- Desktop grid ------------------------------- */
@media (min-width: 900px) {
  .hp-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }

  .hp-problem .hp-display { grid-column: 1 / span 11; }
  .hp-problem__items { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--hp-col-gap); row-gap: var(--s-7); }
  .hp-problem__item:nth-child(1) { grid-column: 1 / span 4; grid-row: 1; }
  .hp-problem__item--key        { grid-column: 6 / -1;    grid-row: 1 / span 2; }
  .hp-problem__item:nth-child(3) { grid-column: 1 / span 4; grid-row: 2; }

  .hp-how__intro { grid-column: 1 / span 5; align-self: start; position: sticky; top: 7.5rem; }
  .hp-steps      { grid-column: 7 / -1; margin-top: 0; }
  .hp-step       { min-height: min(52vh, 30rem); }
  .hp-step:first-child { border-top: 0; padding-top: 0; }

  .hp-agree__head { grid-column: 1 / span 4; }
  .hp-clauses     { grid-column: 6 / -1; margin-top: 0; grid-template-columns: 1fr 1fr; border-top: 0; }
  .hp-clause      { padding: var(--s-6) var(--s-6) var(--s-6) 0; }
  .hp-clause:nth-child(even) { padding-left: var(--s-6); border-left: 1px solid var(--line); }
  .hp-clause:nth-child(-n+2) { padding-top: 0; }
  .hp-clause:nth-child(n+3) { border-bottom: 0; }

  .hp-stakes .hp-display { grid-column: 1 / span 10; }
  .hp-fork { grid-template-columns: 1fr 1fr; }
  /* Each half lines its content up with the page grid. Padding percentages
     in a grid item resolve against its column, so 200% is the full row. */
  .hp-fork__side { padding-left: max(var(--gutter), calc((200% - var(--hp-max)) / 2)); padding-right: clamp(2rem, 5vw, 5rem); }
  .hp-fork__side--win { padding-left: clamp(2rem, 5vw, 5rem); padding-right: max(var(--gutter), calc((200% - var(--hp-max)) / 2)); }

  .hp-faq__head { grid-column: 1 / span 4; align-self: start; position: sticky; top: 7.5rem; }
  .hp-faq .acc  { grid-column: 6 / -1; margin-top: 0; }

  .hp-closer .hp-display { grid-column: 1 / span 10; }
  .hp-closer__foot { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--hp-col-gap); align-items: end; }
  .hp-closer__foot .hp-lead { grid-column: 1 / span 6; }
  .hp-closer__actions { grid-column: 8 / -1; justify-content: flex-end; }
}

@media (max-width: 560px) {
  .hp-closer__actions .btn--ghost { width: 100%; justify-content: center; }
  .hp-faq .acc__q { grid-template-columns: 2rem minmax(0, 1fr) auto; gap: var(--s-3); }
  .hp-faq .acc__a > p { margin-left: calc(2rem + var(--s-3)); }
}

@media (prefers-reduced-motion: reduce) {
  .hp-closer__inner::before, .hp-step .hp-h3, .hp-step__n { transition: none; }
  .hp-closer__inner:not(.in)::before { transform: none; }
}
