/* Home and the site pages on pagidot.com/. Bar, buttons, covers: shared tokens. */

.h-main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px var(--pd-pad-x) 72px;
}
.h-main:focus { outline: none; }

.h-page { display: grid; gap: 0; }

/* Hero: paper field + cutout as an object (hero.webp is transparent, never a CSS background). */
.h-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 1fr);
  align-items: center;
  gap: 24px 48px;
  min-height: min(calc(100dvh - 108px), 640px);
  padding-bottom: 8px;
}
.h-hero-copy h1 {
  margin: 0;
  font-family: var(--pd-display);
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -1.8px;
  max-width: 12ch;
  color: var(--pd-ink);
}
.h-lead {
  margin: 18px 0 0;
  max-width: 36ch;
  font-size: 18px;
  line-height: 1.5;
  color: var(--pd-ink-muted);
}
.h-hero-copy .actions { margin-top: 28px; }
.h-hero-art {
  width: 100%;
  max-width: 640px;
  height: auto;
  justify-self: end;
  filter: drop-shadow(0 22px 36px color-mix(in srgb, var(--pd-shadow) 16%, transparent));
}

/* Content pages keep the typeset opening (no cutout). */
.h-open h1 {
  margin: 0;
  font-family: var(--pd-display);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  max-width: 16ch;
  color: var(--pd-ink);
}
.h-open .h-lead { margin-top: 16px; }
.h-open .actions { margin-top: 24px; }

.h-body {
  display: grid;
  gap: 48px;
  padding-top: 40px;
}

.h-block { display: grid; gap: 16px; overflow: visible; }
.h-block > h2 {
  margin: 0;
  font-family: var(--pd-display);
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.5px;
}
.h-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.h-head h2 {
  margin: 0;
  font-family: var(--pd-display);
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.5px;
}
.h-quiet {
  color: var(--pd-ink-muted);
  font-weight: 600;
  font-size: 15px;
}
.h-quiet:hover { color: var(--pd-ink); text-decoration: none; }

.h-shows {
  display: grid;
  gap: 48px;
}
.h-vitrine {
  position: relative;
  padding: 28px 12px 18px;
}
.h-glass-well {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.h-vitrine > .h-show-stage,
.h-vitrine > .h-show-cap,
.h-vitrine > .h-show-dots {
  position: relative;
  z-index: 1;
}
.h-show-stage {
  position: relative;
  height: clamp(300px, 52vw, 420px);
  overflow: visible;
}
.h-show-slide {
  position: absolute;
  left: 50%;
  top: 36px;
  width: clamp(128px, 17vw, 176px);
  margin: 0;
  color: inherit;
  transform-origin: 50% 100%;
  transform: translate(-50%, 20px) scale(0.55);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  transition: transform 780ms var(--pd-ease), opacity 560ms var(--pd-ease);
}
.h-show-slide:hover { text-decoration: none; }
.h-show-slide.is-focus {
  width: clamp(170px, 24vw, 236px);
  top: 8px;
  transform: translate(-50%, 0);
  opacity: 1;
  z-index: 4;
  pointer-events: auto;
}
.h-show-slide.is-prev {
  left: 18%;
  transform: translate(-50%, 28px);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}
.h-show-slide.is-next {
  left: 82%;
  transform: translate(-50%, 28px);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}
.h-show-slide.is-far {
  transform: translate(-50%, 28px) scale(0.5);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.h-show-slide .pd-tome { padding: 4px 10px 14px; }
.h-show-slide.is-focus .pd-book { transform: rotateY(-26deg) rotateX(7deg); }
.h-show-slide.is-prev .pd-book { transform: rotateY(26deg) rotateX(7deg); }
.h-show-slide.is-next .pd-book { transform: rotateY(-26deg) rotateX(7deg); }
.h-show-cap {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 5.4em;
  padding: 10px 24px 6px;
  text-align: center;
}
.h-book-title {
  font-family: var(--pd-display);
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.25;
  color: var(--pd-ink);
  text-decoration: none;
}
.h-book-title:hover { color: var(--pd-accent); text-decoration: none; }
.h-book-author { margin: 0; color: var(--pd-ink-muted); font-size: 14px; }
.h-book-blurb {
  margin: 6px 0 0;
  max-width: 42ch;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pd-ink-muted);
}
.h-book-price { margin: 0; color: var(--pd-accent); font-weight: 700; font-size: 14px; }
.h-show-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.h-show-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 10px;
}
.h-show-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--pd-line);
  cursor: pointer;
}
.h-show-dots button[aria-current="true"] {
  width: 18px;
  background: var(--pd-accent);
}

.h-journeys {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}
.h-pathband {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  grid-template-areas:
    "title visual"
    "rail visual"
    "cta visual";
  gap: 8px 48px;
  align-items: start;
  padding: 12px 0 8px;
}
.h-pathband h2 {
  grid-area: title;
  margin: 0 0 12px;
  font-family: var(--pd-display);
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.7px;
}
.h-rail { grid-area: rail; }
.h-path-visual { grid-area: visual; }
.h-pathband .btn {
  grid-area: cta;
  justify-self: start;
  margin-top: 8px;
}
.h-path-publisher {
  margin-top: 28px;
  padding-top: 44px;
  border-top: 1px solid color-mix(in srgb, var(--pd-line) 75%, transparent);
}
.h-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
}
.h-rail::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: color-mix(in srgb, var(--pd-line) 80%, transparent);
}
.h-step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 6px 0 22px;
}
.h-step-mark {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--pd-paper);
}
.h-step-mark img,
.h-step-mark svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 8px 12px color-mix(in srgb, var(--pd-shadow) 16%, transparent));
}
.h-step-mark svg { fill: var(--pd-ink); }
.h-step-copy h3 {
  margin: 10px 0 0;
  font-family: var(--pd-display);
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.4px;
}
.h-step-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 640ms var(--pd-ease);
}
.h-step.is-open .h-step-body { grid-template-rows: 1fr; }
.h-step-body > p {
  overflow: hidden;
  margin: 8px 0 0;
  max-width: 42ch;
  color: var(--pd-ink-muted);
}
.h-path-visual {
  align-self: center;
  min-height: 140px;
}
.h-path-marks {
  display: grid;
  place-items: center;
}
.h-path-marks img,
.h-path-marks svg {
  width: 96px;
  height: 96px;
  fill: var(--pd-ink);
  filter: drop-shadow(0 14px 20px color-mix(in srgb, var(--pd-shadow) 18%, transparent));
}

.h-path-visual .pd-shelf .pd-tome { width: 110px; }

.h-store { display: grid; gap: 12px; }
.h-store-lead {
  margin: 0;
  max-width: 42ch;
  color: var(--pd-ink-muted);
}
.h-store-sub {
  margin: 16px 0 0;
  font-family: var(--pd-display);
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.4px;
}
.h-shelves {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 18px;
}
.h-shelf {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px 16px 16px;
  overflow: visible;
  color: inherit;
  text-decoration: none;
}
.h-shelf-glass {
  --face: color-mix(in srgb, var(--pd-paper-raised) 78%, transparent);
  position: absolute;
  inset: 0;
  padding: 0;
  pointer-events: none;
  z-index: 0;
}
.h-shelf > :not(.h-shelf-glass) { position: relative; z-index: 1; }
.h-shelf .pd-shelf .pd-tome { width: 132px; }
.h-shelf:hover { text-decoration: none; }
.h-shelf h3 {
  margin: 8px 0 0;
  font-family: var(--pd-display);
  font-size: 22px;
  letter-spacing: -0.4px;
}
.h-shelf p {
  margin: 0;
  color: var(--pd-ink-muted);
  font-size: 14px;
}

.h-line {
  margin: 0;
  max-width: 36ch;
  font-family: var(--pd-display);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.35;
  letter-spacing: -0.3px;
  color: var(--pd-ink);
}

/* Content pages: same opening, no corner art. */
.s-page > .h-open { margin-bottom: 8px; }
.h-seq {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 20px;
  counter-reset: step;
}
.h-seq > li { counter-increment: step; }
.h-seq h3 {
  margin: 0;
  font-family: var(--pd-display);
  font-size: 20px;
}
.h-seq h3::before {
  content: counter(step) ". ";
  color: var(--pd-ink-muted);
  font-weight: 600;
}
.h-seq p {
  margin: 6px 0 0;
  max-width: 58ch;
  color: var(--pd-ink-muted);
}

.h-facts {
  display: grid;
  gap: 28px;
  margin-top: 8px;
}
.h-facts h2 {
  margin: 0 0 8px;
  font-family: var(--pd-display);
  font-size: 22px;
}
.h-facts p { margin: 0 0 8px; max-width: 58ch; }

@media (max-width: 760px) {
  .h-main { padding-top: 16px; }
  .h-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 20px;
  }
  .h-hero-copy h1 { font-size: clamp(34px, 11vw, 48px); }
  .h-hero-art {
    max-width: min(70vw, 320px);
    justify-self: start;
  }
  .h-body { gap: 36px; padding-top: 32px; }
  .h-show-stage { height: clamp(280px, 78vw, 360px); }
  .h-show-slide { width: clamp(108px, 26vw, 140px); }
  .h-show-slide.is-focus { width: clamp(148px, 42vw, 200px); }
  .h-show-slide.is-prev { left: 14%; }
  .h-show-slide.is-next { left: 86%; }
  .h-pathband {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "visual"
      "rail"
      "cta";
    gap: 16px;
  }
  .h-path-visual { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .h-show-slide,
  .h-step-body {
    transition: none;
    animation: none;
  }
  .h-step-body { grid-template-rows: 1fr; }
}
