/* KIRUPA home page proposal: rules for the preview (index_preview.htm) only.
   Loaded after home.css and variants.css. The comparison pages (index_preview_blend.htm and the rest)
   don't load this file, so they stay as they were. */

/* ---------- The header flows into the page, as on every other page ---------- */

/* The opening ends with the same space as every section, now that no caption row sits under the
   questions. */
#mainContent #hp-main[data-hp-field="icons"] .hp-hero {
  padding-bottom: clamp(64px, 14cqi, 96px);
}

/* The opening paints no sky, band, or seam of its own. The site's page background (and the header
   gradient in Pixel and Smooooth) runs straight through, and the header art stays whole. home.js
   doesn't pull the opening up to meet the art either, so the words start where every page's content
   starts. */
#mainContent #hp-main[data-hp-field="icons"] .hp-hero::after {
  content: none;
}
/* Narrower windows keep the band above the words for the icons and the tour's label. Since the opening
   now starts where every page's content does (lower than the header art in some styles), the band is
   a little shorter, so the headline stays on the first screen. */
@media (max-width: 1200px) {
  #mainContent #hp-main[data-hp-field="icons"] {
    --hp-hero-pad: clamp(200px, 22vw, 260px);
  }
  html.style_minimal #mainContent #hp-main[data-hp-field="icons"] {
    --hp-hero-pad: clamp(110px, 18vw, 180px);
  }
}
@media (max-width: 680px) {
  #mainContent #hp-main[data-hp-field="icons"] {
    --hp-hero-pad: clamp(200px, 54vw, 250px);
  }
  html.style_minimal #mainContent #hp-main[data-hp-field="icons"] {
    --hp-hero-pad: 88px;
  }
}

/* ---------- The site's Background icons setting ---------- */

/* home.js copies Customize Theme > Background icons > Motion onto #hp-main as data-hp-icon-motion. Off hides
   the icons with the tour's label and the icons' titles (and the band that held them above the words
   on narrower windows). Still holds the icons where they rest, as reduced motion does. */
#mainContent #hp-main[data-hp-icon-motion="off"] :is(.hp-icons, .hp-probe, .hp-tip) {
  display: none;
}
@media (max-width: 1200px) {
  #mainContent #hp-main[data-hp-field="icons"][data-hp-icon-motion="off"] {
    --hp-hero-pad: 72px;
  }
}
#mainContent #hp-main[data-hp-icon-motion="still"] .hp-icons :is(.hp-icon, .hp-icon img) {
  animation: none;
}

/* ---------- The site's Content reveals setting ---------- */

/* home.js copies Customize Theme > Content reveals onto #hp-main as data-hp-reveal-mode. Off shows every
   section at once. Figures shows text and cards at once (with their hover lifts as usual), and only the
   images (the icons) rise in, with the site's gentler figure timing, while the track meters, the page's
   diagram, still fill in. Strikes and the stats' neon flicker are part of the text, so they show at once
   in both. All keeps home.css's whole-section reveal, and reduced motion shows everything at once. */
@media (prefers-reduced-motion: no-preference) {
  .hp-js #mainContent #hp-main:is([data-hp-reveal-mode="off"], [data-hp-reveal-mode="figures"]) [data-hp-reveal],
  .hp-js #mainContent #hp-main:is([data-hp-reveal-mode="off"], [data-hp-reveal-mode="figures"]) [data-hp-reveal]:not(.is-in) {
    opacity: 1;
    transform: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  }
  .hp-js #mainContent #hp-main[data-hp-field="icons"]:is([data-hp-reveal-mode="off"], [data-hp-reveal-mode="figures"]) [data-hp-reveal] .hp-strike::after,
  .hp-js #mainContent #hp-main[data-hp-field="icons"]:is([data-hp-reveal-mode="off"], [data-hp-reveal-mode="figures"]) [data-hp-reveal]:not(.is-in) .hp-strike::after {
    transform: none;
    transition: none;
  }
  html.theme_dark.hp-js #mainContent #hp-main:is([data-hp-reveal-mode="off"], [data-hp-reveal-mode="figures"]) .hp-stat.is-in .hp-stat__num {
    animation: none;
  }
  .hp-js #mainContent #hp-main[data-hp-reveal-mode="off"] [data-hp-reveal] .hp-tracks__bar {
    transition: none;
  }
  .hp-js #mainContent #hp-main[data-hp-reveal-mode="figures"] [data-hp-reveal].is-in .hp-ico {
    transition: opacity .4s ease, transform .4s cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--hp-i, 0) * 70ms);
  }
  .hp-js #mainContent #hp-main[data-hp-reveal-mode="figures"] [data-hp-reveal]:not(.is-in) .hp-ico {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Paragraphs ---------- */

/* Consecutive paragraphs sit 1em apart, as in tutorials. */
#mainContent #hp-main[data-hp-field="icons"] .hp-purpose__body > p + p {
  margin-top: calc(1em - 28px);
}
#mainContent #hp-main[data-hp-field="icons"] .hp-proof__intro > h2 ~ p {
  max-width: 44ch;
}
#mainContent #hp-main[data-hp-field="icons"] .hp-proof__intro > h2 + p {
  margin-top: 20px;
}
#mainContent #hp-main[data-hp-field="icons"] .hp-proof__intro > p + p {
  margin-top: 1em;
}

/* Words for screen readers only (the struck-through "the product" reads as "not the product"). */
#mainContent #hp-main .hp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}
/* The struck phrase is short, so it stays on one line and the strike crosses all of it. */
#mainContent #hp-main[data-hp-field="icons"] .hp-purpose__statement .hp-strike {
  white-space: nowrap;
}

/* ---------- Strikes cross the middle of the lowercase letters ---------- */

/* home.css puts a strike at a percentage of its words' box, but that box's height comes from the font's
   ascent and descent, which vary a lot between faces: Yuji Syuku's tall ascent lifted Ukiyo-e's line
   about half an x-height above the letters. Here the line shares its words' baseline instead (as a grid
   item, an empty box's baseline is its bottom edge), then rises half an x-height, or half a cap height
   in Sci-Fi, which sets headings in capitals. */
#mainContent #hp-main[data-hp-field="icons"] :is(.hp-strike, .hp-quiz__what) {
  --hp-strike-t: max(4px, .1em);
  --hp-strike-out: 6px;
  --hp-strike-mid: .5ex;
  display: inline-grid;
}
#mainContent #hp-main[data-hp-field="icons"] .hp-quiz__what {
  --hp-strike-t: max(3px, .08em);
  --hp-strike-out: 4px;
}
html.style_scifi #mainContent #hp-main[data-hp-field="icons"] :is(.hp-strike, .hp-quiz__what) {
  --hp-strike-mid: .5cap;
}
#mainContent #hp-main[data-hp-field="icons"] :is(.hp-strike, .hp-quiz__what) > .hp-strike__w,
#mainContent #hp-main[data-hp-field="icons"] :is(.hp-strike, .hp-quiz__what)::after {
  grid-area: 1 / 1;
  align-self: baseline;
}
#mainContent #hp-main[data-hp-field="icons"] :is(.hp-strike, .hp-quiz__what)::after {
  position: relative;
  top: calc(var(--hp-strike-t) / 2 - var(--hp-strike-mid));
  right: auto;
  left: auto;
  height: var(--hp-strike-t);
  margin: 0 calc(var(--hp-strike-out) * -1);
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hp-js #mainContent #hp-main[data-hp-field="icons"] [data-hp-reveal]:not(.is-in) .hp-strike::after {
    transform: scaleX(0);
  }
}
/* The struck recall question wraps, so its strike stays a text decoration. A line-through sits where
   each font's strikeout metric says (often well above the lowercase letters), but an underline's
   offset is measured from the baseline, so this one is an underline raised half an x-height (plus half
   its 2px thickness). */
#mainContent #hp-main[data-hp-field="icons"] .hp-qcard--what .hp-qcard__prompt {
  text-decoration-line: underline;
  text-decoration-skip-ink: none;
  text-underline-offset: calc(-.5ex - 1px);
}

/* ---------- Count-free copy ---------- */

/* Proof of work: the publishers stand where a number used to. Sized like a card title, so the wide
   display faces (Sci-Fi, Platformer) still fit, and free to wrap. */
#mainContent #hp-main .hp-stat .hp-stat__num--words {
  font-size: calc(clamp(24px, 6cqi, 38px) * var(--hp-h3, 1));
  line-height: 1.15;
  overflow-wrap: break-word;
}
#mainContent #hp-main .hp-stat dt a {
  color: var(--hp-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* The map's tracks keep their meters (one block per explainer) without a number beside them. */
#mainContent #hp-main[data-hp-field="icons"] .hp-tracks a {
  grid-template-columns: minmax(0, 1fr) 132px;
}
/* Quizzes: what to expect, then the subjects. */
#mainContent #hp-main .hp-quiz__intro {
  color: var(--hp-text);
  font-size: 16px;
  line-height: 1.5;
}
#mainContent #hp-main .hp-quiz__facts + .hp-quiz__intro {
  margin-top: 26px;
}
#mainContent #hp-main .hp-quiz__facts {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
#mainContent #hp-main .hp-quiz__facts li {
  position: relative;
  padding-left: 24px;
  color: var(--hp-ink);
  font-size: 16px;
  line-height: 1.5;
}
#mainContent #hp-main .hp-quiz__facts li::before {
  content: "";
  position: absolute;
  top: .5em;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: var(--hp-dot);
  background: var(--hp-accent-fill);
}
#mainContent #hp-main .hp-quiz__intro + .hp-quiz__subjects {
  margin-top: 12px;
}
/* The note sits over the quiz section's glow in dark mode, where the muted color falls just short of
   4.5:1; it uses the body text color instead. */
#mainContent #hp-main[data-hp-field="icons"] .hp-quiz__note {
  color: var(--hp-text);
}
/* "Copied the MCP server address." is small green text; in light mode the green deepens to 4.5:1. */
html:not(.theme_dark) #mainContent #hp-main[data-hp-field="icons"] .hp-copy__status {
  color: color-mix(in oklab, var(--hp-yes) 72%, var(--hp-ink));
}
