/* ============================================================
   ExamPede — Editorial "Review Journal" landing (Design D/E)
   Scoped to the landing only (#homeSection.ep-landing +
   body[data-view="homeSection"]). Dashboard/modals keep their
   existing dark theme. Vanilla CSS, no build step.
   ============================================================ */

:root {
  --ep-paper:      #F7F0E3;
  --ep-paper-2:    #F1E7D3;
  --ep-card:       #FBF6EA;
  --ep-tan:        #E8D9BE;
  --ep-tan-2:      #D8C3A0;
  --ep-tan-3:      #A58A61;
  --ep-navy:       #0B2948;
  --ep-navy-soft:  #34496A;
  --ep-red:        #C6242B;
  --ep-red-2:      #A81D23;
  --ep-gold:       #B98228;
  --ep-gold-deep:  #8A6118;   /* AA-contrast gold for MEANINGFUL small text on paper
                                 (~4.9:1 vs #F7F0E3; base gold measures only ~2.95:1 —
                                 keep base gold for rules/borders/large accents) */
  --ep-line:       #E4D6BC;   /* warm tan divider */
  --ep-ink-soft:   #4C566B;
  --ep-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --ep-sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ep-pad: 22px;   /* mobile; scales up at breakpoints */
}

/* ---- turn the whole page editorial ONLY on the landing ---- */
body[data-view="homeSection"] {
  background: var(--ep-paper) !important;
  color: var(--ep-navy) !important;
  overflow-x: hidden;
  /* nearly-invisible paper grain */
  background-image:
    radial-gradient(circle at 20% 15%, rgba(165,138,97,.05) 1px, transparent 1.6px),
    radial-gradient(circle at 68% 62%, rgba(11,41,72,.035) 1px, transparent 1.6px);
  background-size: 13px 13px, 17px 17px;
}
body[data-view="homeSection"] .app-header,        /* original app header */
body[data-view="homeSection"] .particles,
body[data-view="homeSection"] > .fixed.inset-0    /* decorative blur blobs */ {
  display: none !important;
}
/* let the landing go full-bleed inside main's constrained wrapper */
body[data-view="homeSection"] main { padding: 0 !important; }
body[data-view="homeSection"] main > .max-w-7xl { max-width: none !important; margin: 0 !important; }

/* the legacy (old) home section is kept in the DOM only to preserve JS hooks */
#homeSectionLegacy { display: none !important; }

/* ============================================================
   Landing scope
   ============================================================ */
#homeSection.ep-landing { color: var(--ep-navy); font-family: var(--ep-sans); }
.ep-landing *, .ep-landing *::before, .ep-landing *::after { box-sizing: border-box; }
.ep-wrap { max-width: 1400px; margin: 0 auto; padding-left: var(--ep-pad); padding-right: var(--ep-pad); }
.ep-landing h1, .ep-landing h2, .ep-landing h3, .ep-landing .ep-brand-name {
  font-family: var(--ep-serif); color: var(--ep-navy); margin: 0; font-weight: 600; letter-spacing: -0.01em;
}
.ep-landing p { margin: 0; }
.ep-eyebrow { font-family: var(--ep-sans); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ep-gold); font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.ep-rule { display: block; width: 77px; height: 3px; background: var(--ep-red); border-radius: 2px; border: 0; }
.ep-landing :focus-visible { outline: 2px solid var(--ep-red); outline-offset: 3px; border-radius: 3px; }

/* ---- buttons ---- */
.ep-btn { font-family: var(--ep-sans); font-weight: 600; font-size: 16px; border-radius: 4px; border: 1.5px solid transparent;
  padding: 12px 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  transition: background .18s, color .18s, border-color .18s, transform .1s; text-decoration: none; }
.ep-btn:focus-visible { outline: 2px solid var(--ep-red, #C6242B); outline-offset: 3px; border-radius: 4px; }
.ep-btn:active { transform: translateY(1px); }
.ep-btn svg { width: 18px; height: 18px; flex: none; }
.ep-btn-red { background: var(--ep-red); color: #FBF3E6; }
.ep-btn-red:hover { background: var(--ep-red-2); }
.ep-btn-outline { background: transparent; color: var(--ep-navy); border-color: var(--ep-navy); }
.ep-btn-outline:hover { background: var(--ep-navy); color: var(--ep-paper); }
.ep-btn-lg { padding: 17px 26px; font-size: 17px; }

/* ============================================================
   Landing header (marketing)
   ============================================================ */
.ep-nav { position: relative; border-bottom: 1px solid var(--ep-gold); background: var(--ep-paper); }
.ep-navlinks.ep-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; left: 0; right: 0; top: 68px; margin: 0; background: var(--ep-paper); border-bottom: 1px solid var(--ep-line); padding: 6px var(--ep-pad) 14px; z-index: 60; box-shadow: 0 16px 24px -18px rgba(11,41,72,.4); }
.ep-navlinks.ep-open a { padding: 12px 0; border-bottom: 1px solid var(--ep-line); }
.ep-nav-in { display: flex; align-items: center; gap: 12px; height: 68px; }
.ep-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.ep-crest-wrap { position: relative; display: flex; flex-direction: column; align-items: center; flex: none; }
.ep-crest-wrap .ep-sun-orn { position: absolute; top: -10px; }
.ep-crest { width: 32px; height: 47px; display: block; }
.ep-brand-name { font-size: 27px; line-height: 1; color: var(--ep-navy); font-weight: 600; white-space: nowrap; }
.ep-navlinks { display: none; align-items: center; gap: 30px; margin: 0 auto; }
.ep-navlinks a { font-family: var(--ep-sans); font-size: 15.5px; font-weight: 500; color: var(--ep-navy); display: inline-flex; align-items: center; gap: 5px; padding: 6px 0; border-bottom: 2px solid transparent; }
.ep-navlinks a:hover { color: var(--ep-red); }
.ep-navlinks svg { width: 11px; height: 11px; opacity: .55; }
.ep-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ep-nav-actions .ep-btn-red { padding: 9px 14px; font-size: 14px; white-space: nowrap; }
.ep-login { display: none; font-family: var(--ep-sans); font-size: 15.5px; font-weight: 600; color: var(--ep-navy); background: none; border: 0; cursor: pointer; padding: 6px 2px; white-space: nowrap; }
.ep-login:hover { color: var(--ep-red); }
/* Log-in link that appears only inside the mobile dropdown (out-specify .ep-navlinks a) */
.ep-navlinks a.ep-nav-login-m { display: none; }
.ep-navlinks.ep-open a.ep-nav-login-m { display: inline-flex; }
.ep-nav-toggle { display: inline-flex; background: none; border: 0; color: var(--ep-navy); cursor: pointer; padding: 6px; }
.ep-nav-toggle svg { width: 26px; height: 26px; }

/* ============================================================
   Hero
   ============================================================ */
.ep-hero { position: relative; }
.ep-hero-grid { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: start; }
.ep-hero-copy { padding-top: 40px; padding-bottom: 24px; max-width: 620px; }
.ep-hero-copy .ep-eyebrow { margin-bottom: 22px; }
.ep-hero h1 { font-size: clamp(64px, 11vw, 112px); line-height: .94; font-weight: 600; }
.ep-hero h1 .ep-dot { color: var(--ep-red); }
.ep-hero .ep-rule { margin: 26px 0 30px; }
.ep-hero-sub { font-size: clamp(19px, 2.2vw, 25px); line-height: 1.35; color: var(--ep-navy-soft); font-family: var(--ep-sans); max-width: 22ch; margin-bottom: 34px; }
.ep-hero-cta { display: flex; flex-wrap: nowrap; gap: 12px; }
.ep-hero-cta .ep-btn-lg { flex: 1 1 0; min-width: 0; padding: 15px 14px; font-size: 15.5px; white-space: nowrap; gap: 8px; }
/* Narrow phones (≤374px, e.g. 360px Galaxy A-series): a NOWRAP flex row's
   min-content is the SUM of both buttons' nowrap text minimums (~351px) — even
   with min-width:0 — and the hero grid track inherits it, h-scrolling the whole
   page 13px at 360. Wrapping caps the row's minimum at one button; with
   flex:1 1 0 each button simply takes a full row. 375px+ unchanged. */
@media (max-width: 374px) {
  .ep-hero-cta { flex-wrap: wrap; }
}

/* hero artwork — baked-text raster; the whole composition lives in the image */
.ep-hero-art { position: relative; aspect-ratio: 941 / 1109; }
.ep-hero-art picture, .ep-hero-art picture img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ep-hero-art picture img { object-fit: fill; }

/* ============================================================
   Category strip
   ============================================================ */
.ep-cats { position: relative; z-index: 3; border-top: 1px solid var(--ep-line); border-bottom: 1px solid var(--ep-line); background: var(--ep-paper); }
.ep-cats-in { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.ep-cat { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 16px; background: none; border: 0; border-bottom: 1px solid var(--ep-line); text-align: left; cursor: pointer; font-family: var(--ep-sans); width: 100%; }
.ep-cat:nth-child(odd) { border-right: 1px solid var(--ep-line); }
.ep-cat .ep-cat-ic { flex: none; width: 38px; height: 38px; color: var(--ep-navy); }
.ep-cat.ep-ic-red .ep-cat-ic { color: var(--ep-red); }
.ep-cat.ep-ic-gold .ep-cat-ic { color: var(--ep-gold); }
.ep-cat-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ep-cat .ep-cat-lb { font-size: 16.5px; font-weight: 600; color: var(--ep-navy); line-height: 1.16; }
.ep-cat .ep-cat-ac { font-size: 11.5px; font-weight: 500; color: var(--ep-ink-soft); line-height: 1.3; letter-spacing: .01em; }
.ep-cat::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; background: var(--ep-red); transform: scaleX(0); transform-origin: left; transition: transform .18s; }
.ep-cat:hover::after { transform: scaleX(1); }
.ep-cat.ep-active::after { transform: scaleX(1); left: 0; width: 174px; right: auto; }

/* ============================================================
   Why ExamPede
   ============================================================ */
.ep-why { position: relative; z-index: 2; background: var(--ep-paper); padding: 44px 0 60px; overflow: hidden; }
.ep-why-building { position: absolute; left: -30px; bottom: 0; width: 300px; color: var(--ep-tan-3); opacity: .16; z-index: 0; pointer-events: none; }
.ep-why-in { position: relative; z-index: 1; }
.ep-why-head { margin-bottom: 36px; }
.ep-why-head h2 { font-size: clamp(30px, 4vw, 40px); font-weight: 600; margin-bottom: 12px; }
.ep-why-head .ep-rule { width: 64px; }
.ep-feats { display: grid; grid-template-columns: 1fr; gap: 26px; }
.ep-feat { text-align: center; padding: 0 6px; }
.ep-feat .ep-feat-ic { width: 38px; height: 38px; margin: 0 auto 14px; }
.ep-feat.ep-ic-red .ep-feat-ic { color: var(--ep-red); }
.ep-feat.ep-ic-navy .ep-feat-ic { color: var(--ep-navy); }
.ep-feat.ep-ic-gold .ep-feat-ic { color: var(--ep-gold); }
.ep-feat h3 { font-family: var(--ep-sans); font-size: 17px; font-weight: 600; color: var(--ep-navy); margin-bottom: 8px; }
.ep-feat p { font-size: 14.5px; color: var(--ep-ink-soft); line-height: 1.45; max-width: 26ch; margin: 0 auto; }

/* visually-hidden holder that keeps legacy JS hooks reachable if ever needed */
.ep-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================
   Tablet ≥ 768px
   ============================================================ */
@media (min-width: 768px) {
  :root { --ep-pad: 40px; }
  .ep-cats-in { grid-template-columns: repeat(2, 1fr); }  /* tablet: 2 × 2, roomy cells for acronyms */
  .ep-cat { padding: 22px 24px; }
  .ep-cat.ep-active::after { bottom: 0; }
  .ep-feats { grid-template-columns: repeat(2, 1fr); }
  .ep-hero h1 { font-size: clamp(72px, 8vw, 96px); }
  .ep-hero-cta { flex-wrap: wrap; gap: 20px; }
  .ep-hero-cta .ep-btn-lg { flex: 0 0 auto; padding: 17px 26px; font-size: 17px; }
}

/* ============================================================
   Desktop ≥ 1024px — reference composition
   ============================================================ */
@media (min-width: 1024px) {
  :root { --ep-pad: 68px; }
  .ep-navlinks { display: flex; }
  .ep-nav-toggle { display: none; }
  .ep-nav-in { height: 98px; gap: 20px; }
  .ep-brand { gap: 14px; }
  .ep-brand-name { font-size: 40px; }
  .ep-crest { width: 42px; height: 62px; }
  .ep-crest-wrap .ep-sun-orn { top: -12px; }
  .ep-nav-actions { gap: 22px; }
  .ep-login { display: inline-block; }
  .ep-nav-actions .ep-btn-red { padding: 12px 22px; font-size: 16px; }
  .ep-hero-grid { grid-template-columns: 1.02fr 1fr; gap: 0; }
  .ep-hero-copy { padding-top: 60px; padding-bottom: 70px; position: relative; z-index: 2; }
  .ep-hero h1 { font-size: clamp(84px, 6.4vw, 112px); }
  .ep-feats { grid-template-columns: repeat(4, 1fr); gap: 0; }
  .ep-feat { text-align: left; padding: 0 30px; border-left: 1px solid var(--ep-line); }
  .ep-feat:first-child { border-left: 0; padding-left: 0; }
  .ep-feat .ep-feat-ic { margin: 0 0 14px; }
  .ep-feat p { margin: 0; }
  .ep-why { padding: 54px 0 70px; }
  /* hero-art desktop position/size is defined once in the fidelity block below */
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ep-cat::after, .ep-btn { transition: none !important; }
}

/* ============================================================
   Design D fidelity pass — 1536×1024 reference composition
   ============================================================ */
@media (min-width: 1024px) {
  /* Full-width reference composition */
  .ep-wrap { max-width: none; }

  /* Header has a narrower horizontal inset than main content */
  .ep-nav .ep-wrap { padding-left: 42px; padding-right: 38px; }

  /* Main landing content aligns to Design D */
  .ep-hero-grid, .ep-cats-in, .ep-why-in { padding-left: 68px; padding-right: 68px; }

  /* Exact Design D vertical rhythm; hero clips the artwork so the category
     strip is the intentional crop line (art no longer bleeds into Why). */
  .ep-hero { min-height: 612px; overflow: hidden; }
  /* ── Hero artwork: single source of truth (matches cropped desktop asset) ── */
  .ep-hero-art { position: absolute; right: 0; top: 0; width: 62vw; aspect-ratio: 1106 / 1024; height: auto; z-index: 1; overflow: hidden; display: block; }
  .ep-hero-art picture img {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.55) 8%, #000 17%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.55) 8%, #000 17%, #000 100%); }
  .ep-hero-copy { padding-top: 60px; padding-bottom: 60px; }

  /* Continuous category strip: four exam categories in one row */
  .ep-cats-in { grid-template-columns: repeat(4, 1fr); min-height: 104px; }
  .ep-cat { min-height: 104px; padding: 0 20px; gap: 14px; border-right: 0; border-bottom: 0; }
  .ep-cat:nth-child(odd) { border-right: 0; }
  .ep-cat .ep-cat-ic { width: 40px; height: 40px; }
  .ep-cat .ep-cat-lb { font-size: 17px; }
  .ep-cat .ep-cat-ac { font-size: 12px; }
  .ep-cat:not(:last-child)::before {
    content: ""; position: absolute; top: 50%; transform: translateY(-50%); right: 0; width: 1px; height: 48px; background: var(--ep-line);
  }
  .ep-cat.ep-active::after { left: 0; right: auto; width: 100%; bottom: 0; }

  /* Why ExamPede: title as a left column beside the four features */
  .ep-why { padding-top: 44px; padding-bottom: 66px; }
  .ep-why-in { display: grid; grid-template-columns: 318px minmax(0, 1fr); align-items: start; }
  .ep-why-head { margin: 0; padding-top: 0; }
  .ep-feats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--ep-line); }
  .ep-feat, .ep-feat:first-child { min-height: 136px; padding: 0 28px; border-left: 1px solid var(--ep-line); text-align: center; }
  .ep-feat:first-child { border-left: 0; }
  .ep-feat .ep-feat-ic { margin: 0 auto 14px; }
  .ep-feat p { margin: 0 auto; }
  .ep-why-building { left: -18px; width: 320px; opacity: 0.15; }
}

/* ensure desktop hero image fills its container (overrides mobile max-width) */
@media (min-width:1024px){#homeSection .ep-hero-art img{max-width:none !important;}}

/* Site footer on the paper landing (review triage A18): the Tailwind slate
   classes it carries were tuned for the old dark theme — slate-400 links on
   paper measure ~2.26:1. Landing ink takes over here (class+element beats a
   single Tailwind utility class in specificity). */
.ep-landing footer { border-color: var(--ep-line); }
.ep-landing footer a { color: var(--ep-ink-soft); }
.ep-landing footer a:hover { color: var(--ep-navy); }
.ep-landing footer p { color: var(--ep-ink-soft); }
