/* ==========================================================================
   home.css — homepage-specific layout (Phase 5).
   Extends the Phase 4 library (tokens.css + components.css). Nothing here
   redefines a component; page-only composition lives below.
   Section rhythm (§8.1): alternate paper / ink down the page.
   ========================================================================== */

/* ---------- Page frame ---------- */
.home-wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.home-sec { padding-block: var(--section-y); }
.home-sec--dark { background: var(--ink); color: #fff; }
.home-sec--dark .section-head p { color: rgba(255, 255, 255, .72); }
.home-sec--tint { background: var(--accent-soft); }
.home-sec--tint .section-head p { color: rgba(255, 255, 255, .72); }

.section-head { max-width: 760px; margin-bottom: var(--s6); }
.section-head .eyebrow { margin-bottom: var(--s2); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: .01em;
  margin: 0 0 var(--s2);
  text-transform: uppercase;
}
.section-head p { font-size: var(--fs-lede); line-height: var(--lh-lede); color: var(--ink-60); margin: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
}
.hero-slide--active { opacity: 1; }
picture.hero-slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(11, 11, 12, .38) 0%,
    rgba(11, 11, 12, .08) 38%,
    rgba(11, 11, 12, .78) 100%);
  pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 1;
  width: 100%;
  padding-bottom: clamp(96px, 12vh, 140px);
}
.hero__kicker {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s2);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  margin: 0 0 var(--s3);
  text-transform: uppercase;
  text-wrap: balance;
  max-width: 12ch;
}
.hero__sub {
  font-size: var(--fs-lede); line-height: var(--lh-lede);
  color: rgba(255, 255, 255, .85);
  max-width: 46ch;
  margin: 0 0 var(--s4);
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero__book { color: #fff; font-weight: 700; padding: 14px 8px; }
.hero__controls {
  position: absolute; z-index: 2;
  right: var(--pad-x); bottom: clamp(28px, 5vh, 48px);
  display: flex; align-items: center; gap: 10px;
}
.hero-arrow, .hero-dot {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
  font-size: 1.1rem;
}
.hero-arrow:hover { background: rgba(255, 255, 255, .22); }
.hero-dot { width: 48px; height: 48px; border-radius: 50%; padding: 0; }
.hero-dot::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, .45);
}
.hero-dot--active::after { background: var(--accent); }

/* ---------- Intent router ---------- */
.router-grid {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(3, 1fr);
}
.router-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s2);
}
.router-card__icon { font-size: 2rem; }
.router-card h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  line-height: var(--lh-h3); margin: 0; text-transform: uppercase;
}
.router-card p { color: var(--ink-60); margin: 0; flex: 1; }
.router-card .btn { align-self: flex-start; }

/* ---------- Featured work ---------- */
.work-grid {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(3, 1fr);
}
.work-card { margin: 0; }
.work-card__media {
  display: block; width: 100%;
  padding: 0; border: 0; border-radius: var(--r-lg);
  overflow: hidden; background: var(--ink-3);
  cursor: zoom-in;
}
.work-card__media img {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform var(--d-card) var(--ease);
}
.work-card__media:hover img { transform: scale(1.03); }
.work-card__cap { padding: var(--s2) 4px 0; }
.work-card__title { display: block; font-weight: 600; margin-bottom: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tool launch panels (estimator / builder sections) ---------- */
.tool-panel {
  background: var(--ink); color: #fff;
  border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 56px);
  display: grid; gap: var(--s4);
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.tool-panel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 85% 10%, rgba(242, 106, 36, .22), transparent 60%);
  pointer-events: none;
}
.tool-panel > * { position: relative; }
.tool-panel h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  line-height: var(--lh-h3); margin: 0 0 var(--s2); text-transform: uppercase;
}
.tool-panel p { color: rgba(255, 255, 255, .75); margin: 0 0 var(--s3); }
.tool-panel__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tool-panel__steps li {
  display: flex; gap: 12px; align-items: baseline;
  color: rgba(255, 255, 255, .8); font-size: var(--fs-small);
}
.tool-panel__steps .n {
  font-family: var(--font-display); color: var(--accent);
  font-size: 1.1rem; min-width: 2ch;
}
.tool-panel__cta { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.tool-panel__fine { font-size: var(--fs-small); color: rgba(255, 255, 255, .6); margin: 0; }

/* ---------- Sheet tool chrome (estimator + builder sheets) ---------- */
.sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px var(--pad-x) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border-top: 1px solid var(--line);
}
.sheet-foot__progress {
  flex: 1; text-align: center;
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-deep);
}
.step__sub { color: var(--ink-60); margin: -8px 0 4px; }

/* Estimator result */
.est-result { padding-bottom: var(--s4); }
.result-card {
  background: var(--ink); color: #fff;
  border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 44px);
  margin-top: var(--s3);
}
.result-card__kicker {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.result-card__spec {
  font-size: var(--fs-small); font-weight: 600;
  color: rgba(255, 255, 255, .7);
  text-transform: uppercase; letter-spacing: .08em;
}
.result-card__range {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 14vw, 5.5rem);
  line-height: 1; margin: 12px 0 var(--s2);
}
.result-card__note { color: rgba(255, 255, 255, .85); font-size: var(--fs-body-lg); }
.result-card__note strong { color: #fff; }
.result-card__fine {
  font-size: var(--fs-small); color: rgba(255, 255, 255, .6);
  border-top: 1px solid var(--line-light);
  padding-top: var(--s2); margin-top: var(--s3);
}
.result-card__actions { display: grid; gap: 12px; margin-top: var(--s3); }

/* Builder brief */
.brief-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s3);
  margin-top: var(--s3);
  display: grid; gap: 0;
}
.brief-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.brief-row:last-child { border-bottom: 0; }
.brief-row span { color: var(--ink-60); }
.brief-row strong { text-align: right; }
.brief-framing {
  font-size: var(--fs-small); color: var(--ink-60);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin: var(--s3) 0;
}

/* Builder references panel */
.bld-refs { padding-bottom: var(--s4); }
.bld-refs .field__hint { margin-top: 10px; }

/* ---------- Design Lab ---------- */
.lab-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(4, 1fr); }
.lab-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s3);
  display: flex; flex-direction: column; gap: 12px;
}
.lab-card__icon { font-size: 1.75rem; }
.lab-card h3 {
  font-family: var(--font-display); font-size: 1.5rem;
  line-height: var(--lh-h3); margin: 0; text-transform: uppercase;
}
.lab-card p { color: var(--ink-60); font-size: var(--fs-body); margin: 0; flex: 1; }
.lab-card__tag {
  align-self: flex-start;
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-deep);
}
.flash-strip { margin-top: var(--s8); }
.flash-strip__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: var(--s3);
}
.flash-strip__head h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  margin: 0; text-transform: uppercase;
}
.flash-rail {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 18vw, 200px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.flash-card {
  padding: 0; border: 0; border-radius: var(--r-sm);
  overflow: hidden; background: var(--ink-3);
  scroll-snap-align: start; cursor: zoom-in;
}
.flash-card img {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
}

/* ---------- About ---------- */
.about-grid {
  display: grid; gap: var(--s6);
  grid-template-columns: 1fr 1fr; align-items: center;
}
.about-photo {
  border-radius: var(--r-lg);
  border: 2px dashed var(--line);
  aspect-ratio: 4 / 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 12px;
  padding: var(--s4);
  color: var(--ink-60);
  background: var(--white);
}
.about-photo .about-photo__icon { font-size: 3rem; }
.about-photo strong { color: var(--ink); text-transform: uppercase; letter-spacing: .08em; }
.about-photo--real { margin: 0; border: none; padding: 0; background: none; overflow: hidden; display: block; }
.about-photo--real picture, .about-photo--real img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); margin-top: var(--s6); }
.about-strip picture { display: block; overflow: hidden; border-radius: var(--r-lg); }
.about-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.about-strip__cap { text-align: center; color: var(--muted); font-size: var(--fs-small); margin: var(--s3) 0 0; }
.about-copy p { color: var(--muted); font-size: var(--fs-body-lg); line-height: var(--lh-body); }
.about-copy p strong { color: var(--white); }

/* ---------- Honest placeholders (cover-up lab, reviews) ---------- */
.soon-panel {
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  padding: clamp(40px, 8vw, 80px) clamp(24px, 5vw, 56px);
  text-align: center;
  background: var(--white);
}

/* ---------- Before / after slider (cover-up lab) ---------- */
.ba-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; max-width: 1180px; margin-inline: auto; }
@media (min-width: 760px) { .ba-grid { grid-template-columns: repeat(2, 1fr); align-items: start; } }
.ba-slider { max-width: 560px; margin-inline: auto; width: 100%; }
.ba-slider__frame { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-lg); overflow: hidden; --ba-pos: 50%; touch-action: pan-y; cursor: ew-resize; }
.ba-slider__img, .ba-slider__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-slider__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--ba-pos)) 0 0); }
.ba-slider__tag { position: absolute; top: 12px; z-index: 2; font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; background: rgba(11, 11, 12, .65); color: #fff; padding: 6px 12px; border-radius: 999px; pointer-events: none; }
.ba-slider__tag--before { left: 12px; }
.ba-slider__tag--after { right: 12px; }
.ba-slider__handle { position: absolute; top: 0; bottom: 0; left: var(--ba-pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .55); z-index: 2; pointer-events: none; }
.ba-slider__handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.ba-slider__range { width: 100%; margin-top: 14px; accent-color: var(--accent); }
.ba-slider__cap { color: rgba(255, 255, 255, .72); text-align: center; margin: 10px 0 0; }
.coverup-cta { text-align: center; margin-top: var(--s6); }
.soon-panel__icon { font-size: 3rem; margin-bottom: var(--s2); }
.soon-panel h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  text-transform: uppercase; margin: 0 0 var(--s2);
}
.soon-panel p { color: var(--ink-60); max-width: 52ch; margin: 0 auto var(--s3); }

/* ---------- How it works ---------- */
.how-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(3, 1fr); }
.how-card { display: flex; flex-direction: column; gap: 12px; }
.how-card .n {
  font-family: var(--font-display); font-size: 3rem;
  color: var(--accent); line-height: 1;
}
.how-card h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  text-transform: uppercase; margin: 0;
}
.how-card p { color: var(--ink-60); margin: 0; }

/* ---------- Arcade teaser ---------- */
.game-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(3, 1fr); }
.game-card {
  background: var(--ink-2);
  border: 1px solid var(--line-light);
  border-radius: var(--r-lg);
  padding: var(--s4);
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.game-card__icon { font-size: 2.25rem; }
.game-card h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  text-transform: uppercase; margin: 0; color: #fff;
}
.game-card .meta {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--purple-glow);
}
.game-card p { color: rgba(255, 255, 255, .72); margin: 0; flex: 1; }
.game-card .btn { align-self: flex-start; }
.game-card--featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: var(--s4); align-items: center;
  background: linear-gradient(120deg, var(--purple-deep), var(--ink-2) 70%);
  border-color: rgba(192, 132, 252, .35);
}
.game-card--featured .game-card__icon { font-size: 3.5rem; }
.game-card--featured .btn { align-self: center; }

/* ---------- Player profile (demo / empty state) ---------- */
.profile-demo {
  margin-top: var(--s6);
  background: var(--ink-2);
  border: 1px solid var(--line-light);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
  display: grid; gap: var(--s4);
  grid-template-columns: auto 1fr;
  align-items: center;
}
.profile-demo__avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  box-shadow: inset 0 0 0 2px var(--line-light);
}
.profile-demo h3 {
  font-family: var(--font-display); font-size: var(--fs-h3);
  text-transform: uppercase; margin: 0 0 4px; color: #fff;
}
.profile-demo__stats {
  display: flex; flex-wrap: wrap; gap: 24px;
  margin: var(--s2) 0;
}
.profile-demo__stat { display: flex; flex-direction: column; }
.profile-demo__stat b { font-family: var(--font-display); font-size: 1.75rem; color: #fff; }
.profile-demo__stat span { font-size: var(--fs-small); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.profile-demo__note { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.profile-demo__ach {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s2);
}

/* ---------- Aftercare teaser ---------- */
.aftercare-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(4, 1fr); }

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center;
  max-width: 720px; margin-inline: auto;
}
.final-cta h2 {
  font-family: var(--font-display); font-size: var(--fs-h2);
  line-height: var(--lh-h2); text-transform: uppercase;
  margin: 0 0 var(--s2);
}
.final-cta p { color: rgba(255, 255, 255, .75); font-size: var(--fs-lede); margin: 0 0 var(--s4); }
.final-cta .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #fff;
  padding: var(--s8) 0 calc(var(--s4) + env(safe-area-inset-bottom, 0px));
}
.footer-grid {
  display: grid; gap: var(--s4);
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
}
.footer-brand img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; margin-bottom: var(--s2); }
.footer-brand .word {
  font-family: var(--font-display); font-size: 1.5rem;
  display: block; text-transform: uppercase;
}
.footer-brand .sub { color: var(--muted); font-size: var(--fs-small); display: block; margin-bottom: var(--s2); }
.footer-brand p { color: var(--muted); font-size: var(--fs-small); margin: 0; }
.site-footer h4 {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 var(--s2);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: rgba(255, 255, 255, .8); }
.footer-links a:hover { color: #fff; }
.footer-base {
  margin-top: var(--s6); padding-top: var(--s3);
  border-top: 1px solid var(--line-light);
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  justify-content: space-between;
  color: var(--muted); font-size: var(--fs-small);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .lab-grid, .aftercare-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 900px) {
  .home-wrap { padding-inline: 20px; }
  .router-grid, .work-grid, .how-grid, .game-grid { grid-template-columns: 1fr 1fr; }
  .tool-panel { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .game-card--featured { grid-template-columns: 1fr; }
  .profile-demo { grid-template-columns: 1fr; }
  .hero__controls { right: 20px; }
  /* Bottom nav clearance for fixed mobile nav */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 600px) {
  .router-grid, .work-grid, .how-grid, .game-grid,
  .lab-grid, .aftercare-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero__controls { display: none; }
  .hero__ctas .btn { flex: 1 1 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
  .work-card__media img { transition: none; }
}
