/* ==========================================================================
   v2-flagship.css — Tabiji v2 FLAGSHIP layer (AGENT-FLAGSHIP) · 2026-06-09
   Enqueued site-wide after pages.css (handle: tabiji-v2-flagship, by MAIN).
   Scope strictly namespaced: .v2-home (front-page.php) and
   .v2-curriculum (page-curriculum.php).

   Hard rules honoured:
   - Brand palette tokens only. Gold TEXT on light surfaces uses
     var(--gold-text, #8A6320) — AA >= 4.5 on cream; fallback holds until
     MAIN lands the token in variables.css.
   - First viewport never starts at opacity:0. Hero entrances are
     transform-only (opacity stays 1). No-JS = fully settled state.
   - Animation: transform / opacity / SVG stroke only. Zero CLS.
   - All motion gated behind prefers-reduced-motion: no-preference.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared — settled-by-default entrances (transform only; LCP-safe)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .v2-home .rise,
  .v2-curriculum .rise {
    animation: v2-rise 0.7s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
  }
  .v2-home .rise--settle {
    animation: v2-settle 1s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
  }
}
@keyframes v2-rise { from { transform: translateY(14px); } }
@keyframes v2-settle { from { transform: scale(1.012); } }

/* ==========================================================================
   HOME — editorial founder hero (magazine lockup with the real rectangular
   portrait: the headline crosses the portrait's edge; the portrait anchors
   the section's bottom edge and rises up behind the typography)
   ========================================================================== */
.v2-home .hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--hairline); }
.v2-home .hero-stroke { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5; width: 100%; height: 100%; }
.v2-home .hero-stroke path { fill: none; stroke: var(--slate); stroke-width: 1.4; opacity: 0.4; }

.v2-home .hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  grid-template-areas:
    "head head"
    "copy portrait";
  column-gap: clamp(2rem, 3.5vw, 3.6rem);
  align-items: start;
  padding-top: clamp(3.2rem, 7vh, 5.5rem);
  padding-bottom: 0; /* the portrait owns the section's bottom edge */
}

.v2-home .hero-head { grid-area: head; position: relative; z-index: 3; }
.v2-home .hero-head h1 {
  font-size: clamp(2.9rem, 7vw, 6rem);
  line-height: 1.02;
  margin: 0 0 1.4rem;
  /* cream halo keeps the letters legible where they cross the photograph */
  text-shadow: 0 1px 2px rgba(244, 241, 232, 0.65), 0 0 24px rgba(244, 241, 232, 0.85);
}
.v2-home .hero-head h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold-text, #8A6320);
}

.v2-home .hero-copy { grid-area: copy; position: relative; z-index: 2; padding-bottom: clamp(3rem, 7vh, 5rem); }
.v2-home .hero-copy .dek {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--ink-60);
  max-width: 46ch;
  margin: 0 0 2.3rem;
}
.v2-home .hero-cta { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.v2-home .guarantee-line {
  margin-top: 1.6rem;
  font-size: 0.92rem;
  color: var(--ink-60);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 44ch;
}
.v2-home .guarantee-line .seal { flex-shrink: 0; width: 30px; height: auto; opacity: 0.9; }
.v2-home .level-line { margin: 1.1rem 0 0; font-size: 0.85rem; color: var(--ink-60); }
.v2-home .level-line .btn-text { font-size: 0.85rem; }

/* The founder portrait — bottom-anchored, asymmetric, behind the headline */
.v2-home .hero-portrait {
  grid-area: portrait;
  position: relative;
  z-index: 1;
  align-self: end;
  margin-top: clamp(-110px, -7.5vw, -48px); /* rises into the headline zone */
  margin-right: clamp(-28px, -2vw, 0px);    /* gentle bleed toward the gutter */
}
.v2-home .portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 14px 14px 0 0; /* bottom edge is flush with the section */
  border: 1px solid var(--hairline);
  border-bottom: 0;
  box-shadow: 0 40px 70px -42px rgba(44, 42, 41, 0.55);
}
.v2-home .portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(0.92) contrast(1.02);
  display: block;
}
.v2-home .portrait-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(31, 46, 65, 0.72));
}
.v2-home .portrait-cap { position: absolute; left: 20px; bottom: 18px; z-index: 2; color: var(--cream); }
.v2-home .portrait-cap span {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold); /* on the dark navy gradient — AA-safe */
  font-weight: 700;
}
.v2-home .portrait-cap b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin-top: 0.1rem; }

/* --- level-check band --- */
.v2-home .assess-band { background: var(--cream-2); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.v2-home .assess-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.v2-home .assess-wrap h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.1; margin-bottom: 1rem; }
.v2-home .assess-lede { font-family: var(--serif); font-size: 1.12rem; color: var(--ink-60); max-width: 52ch; }
.v2-home .assess-meta { display: flex; gap: 1.4rem; margin: 1.5rem 0 2rem; font-size: 0.82rem; font-weight: 700; color: var(--navy); flex-wrap: wrap; }
.v2-home .assess-meta span { display: flex; align-items: center; gap: 0.45rem; }
.v2-home .assess-meta span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-deep); }

/* --- founder band --- */
.v2-home .founder-section { background: var(--cream-2); border-top: 1px solid var(--hairline); }
.v2-home .founder-section .wrap { max-width: 64ch; }
.v2-home .founder-section h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.v2-home .founder-lede { font-family: var(--serif); font-size: 1.2rem; color: var(--ink-60); margin-top: 1rem; }
.v2-home .founder-section .btn-text { margin-top: 1.5rem; display: inline-block; }

/* --- proof strip (verdict delta 6): "What you leave lesson one with" ---
   Compact editorial bridge between the hero composition (hero + creds) and
   the Method section. Hairlines + ma only — no cards, no boxes. Copy is
   anchored verbatim to page-trial.php's "What's included in your $55". */
.v2-home .proof-strip {
  padding: clamp(2.8rem, 6vh, 4rem) 0;
  border-bottom: 1px solid var(--hairline);
}
.v2-home .ps-head {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  color: var(--navy);
  margin: 0 0 1.8rem;
}
.v2-home .ps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(2rem, 3.5vw, 3.4rem);
  row-gap: 1.4rem;
}
.v2-home .ps-item { border-top: 1px solid var(--slate); padding-top: 1.1rem; }
.v2-home .ps-item .ps-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text, #8A6320);
  margin-bottom: 0.5rem;
}
.v2-home .ps-item p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-60);
}
@media (max-width: 920px) {
  .v2-home .ps-grid { grid-template-columns: 1fr; }
}

/* --- milestone numerals: digits can't shift layout while counting up --- */
.v2-home .ach .lesson [data-countup] { font-variant-numeric: tabular-nums; }

@media (max-width: 920px) {
  .v2-home .hero .wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "copy"
      "portrait";
    padding-top: 3rem;
  }
  .v2-home .hero-head h1 { line-height: 1.07; text-shadow: none; }
  .v2-home .hero-copy { padding-bottom: 2.6rem; }
  .v2-home .hero-portrait { margin-top: 0; margin-right: 0; }
  .v2-home .assess-wrap { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CURRICULUM — THE flagship: vertical ink-path scroll-draw + hairline syllabus
   ========================================================================== */

/* --- the journey rail ------------------------------------------------------
   One abstract winding brushstroke echoing the brand's winding-road motif
   (drawn for this build — NOT a copy of the logo asset). Without JS the path
   renders fully drawn (no dasharray in CSS); v2-curriculum.js scrubs
   stroke-dashoffset with rAF-throttled scroll progress, motion-gated. */
.v2-curriculum .journey { position: relative; isolation: isolate; }
/* Blind-test verdict delta 3 (2026-06-10): the site's ONE decorative kanji —
   旅 (journey) watermarking the ink-rail/stages region, curriculum only.
   Pseudo-element: zero markup, zero CLS (absolute), alt-text-empty content
   syntax so AT ignores it, 5% opacity. isolation:isolate on .journey lets
   z-index:-1 sit behind every stage block while staying above the page bg. */
.v2-curriculum .journey::before {
  content: '旅';        /* fallback for engines without the alt-text syntax */
  content: '旅' / '';   /* modern: empty alternative text = ignored by AT */
  position: absolute;
  top: clamp(1rem, 4vh, 3rem);
  right: -1%;
  font-family: var(--jp);
  font-weight: 600;
  font-size: clamp(11rem, 26vw, 22rem);
  line-height: 1;
  color: var(--navy);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
.v2-curriculum .ink-rail { display: none; }
@media (min-width: 921px) {
  .v2-curriculum .journey { padding-left: 96px; }
  .v2-curriculum .ink-rail {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 56px;
    pointer-events: none;
  }
}
.v2-curriculum .ink-rail svg { width: 100%; height: 100%; display: block; overflow: visible; }
.v2-curriculum .rail-track { fill: none; stroke: var(--slate); stroke-width: 1.2; opacity: 0.38; vector-effect: non-scaling-stroke; }
.v2-curriculum .rail-ink { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: butt; vector-effect: non-scaling-stroke; }
.v2-curriculum .rail-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cream);
  border: 1.5px solid var(--navy);
  transform: translate(-50%, -50%);
}
.v2-curriculum .rail-dot.lit { background: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .v2-curriculum .rail-dot { transition: background-color 0.35s var(--ease-out), transform 0.35s var(--ease-out); }
  .v2-curriculum .rail-dot.lit { transform: translate(-50%, -50%) scale(1.22); }
}

/* --- stage blocks (ported from the retired inline <style> block) --- */
.v2-curriculum .stage-block {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  align-items: start;
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--hairline);
}
.v2-curriculum .stage-block--first { padding-top: 0; }
.v2-curriculum .journey > .stage-block:last-child { border-bottom: 0; }
.v2-curriculum .stage-block.alt { grid-template-columns: 1.6fr 1fr; }

/* numerals ignite (class flip from v2-curriculum.js) as the ink passes */
.v2-curriculum .stage-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 4rem;
  line-height: 1;
  color: var(--navy-deep);
  opacity: 0.25;
  display: block;
  margin-bottom: -0.6rem;
}
.v2-curriculum .stage-num.lit { color: var(--gold-text, #8A6320); opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .v2-curriculum .stage-num { transition: color 0.5s var(--ease-out), opacity 0.5s var(--ease-out); }
}

.v2-curriculum .stage-title { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 0.4rem 0 0.6rem; }
.v2-curriculum .stage-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--navy);
  color: var(--cream);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.v2-curriculum .stage-body { font-family: var(--serif); font-size: 1.1rem; color: var(--ink-60); line-height: 1.7; margin-bottom: 1.5rem; }
.v2-curriculum .outcome-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.v2-curriculum .outcome-list li { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.95rem; color: var(--charcoal); }
.v2-curriculum .outcome-list li::before { content: '→'; color: var(--gold-deep); font-weight: 700; flex-shrink: 0; }

/* --- hairline syllabus (Gemini move 8): containment boxes stripped, slate
       hairlines, generous ma, typographic hierarchy only --- */
.v2-curriculum .lesson-sample {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  border-top: 2px solid var(--navy);
}
.v2-curriculum .ls-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 1rem;
  margin: 0;
  border-bottom: 1px solid var(--slate);
}
.v2-curriculum .ls-kicker {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text, #8A6320);
}
.v2-curriculum .ls-no { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.3rem; color: var(--navy); }
.v2-curriculum .ls-row {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--slate);
}
.v2-curriculum .ls-row:last-child { border-bottom: 0; padding-bottom: 0.4rem; }
.v2-curriculum .ls-time {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-60); /* slate fails AA for small text — slate is hairlines only */
  width: 64px;
  flex-shrink: 0;
  padding-top: 0.3em;
  font-variant-numeric: tabular-nums;
}
.v2-curriculum .ls-act { font-size: 0.95rem; color: var(--charcoal); font-weight: 600; }
.v2-curriculum .ls-act em {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--ink-60);
  margin-top: 0.3rem;
}

@media (max-width: 920px) {
  .v2-curriculum .stage-block,
  .v2-curriculum .stage-block.alt { grid-template-columns: 1fr; gap: 2.2rem; padding: 3rem 0; }
  .v2-curriculum .stage-block--first { padding-top: 0; }
  .v2-curriculum .stage-block.alt .stage-meta { order: 1; }
  .v2-curriculum .stage-block.alt .lesson-sample { order: 2; }
}
