/* Home page: full-bleed night hero, then sections on the sand ground. Needs base.css. */

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; height: min(92vh, 780px); min-height: 560px; background: var(--sky0); color: var(--cream); }
.hero-sky { position: absolute; left: 0; top: 0; height: 100%; }
.hero-copy { position: relative; z-index: 2; padding-top: clamp(128px, 17vh, 170px); text-align: center; }
.hero .label { color: var(--cloud0); text-shadow: 2px 2px 0 var(--ink); font-size: 16px; }
.hero h1 { font-size: clamp(28px, 7.4vw, 92px); white-space: nowrap; font-weight: 700; line-height: 0.95; margin: 10px 0 18px; color: var(--cream);
  text-shadow: 0.05em 0.05em 0 var(--ink); letter-spacing: 0.02em; }
.tagline { font-size: 20px; line-height: 1.55; font-weight: 600; max-width: 34em; margin: 0 auto 26px; color: var(--cream);
  background: var(--sky0); padding: 12px 20px; box-shadow: 0 -4px 0 var(--sky0), 0 4px 0 var(--sky0), -4px 0 0 var(--sky0), 4px 0 0 var(--sky0); }
.actions { display: flex; gap: 12px 16px; justify-content: center; flex-wrap: wrap; }

/* the cast on the foreground hill: one villager per class, placed by home.js in scene pixels */
.hero-cast { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.villager { position: absolute; pointer-events: auto; background: none; border: 0; padding: 0; cursor: default; }
.villager svg { width: 100%; height: 100%; }
.villager .bob { width: 100%; height: 100%; animation: bob 2.4s steps(1) infinite; animation-delay: var(--d, 0s); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(-1 * var(--s, 4px))); } }
@media (prefers-reduced-motion: reduce) { .villager .bob { animation: none; } }
.villager .say { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--cream); color: var(--ink); font: 600 15px/1.2 var(--f-pixel); padding: 7px 10px 6px; opacity: 0; transition: opacity 0.12s;
  box-shadow: 0 -3px 0 var(--cream), 0 3px 0 var(--cream), -3px 0 0 var(--cream), 3px 0 0 var(--cream); pointer-events: none; }
.villager .say::after { content: ""; position: absolute; top: calc(100% + 3px); left: calc(50% - 4px); width: 8px; height: 6px; background: var(--cream); }
.villager .say b { color: var(--roof); font-weight: 700; }
.villager:hover .say, .villager:focus-visible .say { opacity: 1; }
.villager.edge-l .say { left: 0; transform: none; } .villager.edge-l .say::after { left: 12px; }
.villager.edge-r .say { left: auto; right: 0; transform: none; } .villager.edge-r .say::after { left: auto; right: 12px; }

@media (max-width: 720px) {
  .hero { height: auto; min-height: 640px; }
  .hero-copy { padding-top: 232px; padding-bottom: 210px; }
  .hero .label { font-size: 14px; }
  .tagline { font-size: 16px; padding: 10px 14px; }
  .villager .say { font-size: 13px; }
}

/* ------------------------------------------------------------------ the experiment */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.pillar { display: flex; flex-direction: column; }
.pillar .icon { height: 48px; margin-bottom: 14px; display: flex; gap: 2px; align-items: flex-end; }
.pillar .icon svg { height: 48px; width: auto; }
.pillar h3 { margin-top: 6px; }
.pillar p { font-size: 16px; margin: 0; }
@media (max-width: 1040px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pillars { grid-template-columns: 1fr; gap: 24px; } }

/* ------------------------------------------------------------------ stories carousel (scroll-snap) */
.car-ctl { display: flex; gap: 8px; }
.btn.sq { width: 48px; padding: 10px 0 8px; font-size: 26px; text-align: center; }
.carousel { --per: 3; --gap: 28px; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 8px 4px 20px; margin: -8px -4px 0; overscroll-behavior-x: contain; }
.carousel::-webkit-scrollbar { display: none; }
@media (max-width: 1040px) { .carousel { --per: 2; } }
@media (max-width: 720px) { .carousel { --per: 1; --gap: 20px; grid-auto-columns: 88%; } }
.story { scroll-snap-align: start; display: flex; flex-direction: column; }
.story-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.portrait { flex: none; width: 84px; height: 84px; background: var(--sky2); position: relative; overflow: hidden; }
.portrait::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--meadow); box-shadow: 0 -4px 0 var(--meadow-light); }
.portrait .star { position: absolute; width: 4px; height: 4px; background: #c8d0f0; }
.portrait svg { position: absolute; left: 6px; bottom: 4px; width: 72px; height: 72px; z-index: 1; }
.story h3 { font-size: 21px; margin: 2px 0 6px; }
.story .sub { font-size: 15px; line-height: 1.55; margin: 0; color: #d8d0c0; }
.quote { position: relative; background: var(--cream); color: var(--ink); margin: 6px 4px 18px; padding: 14px 16px; font-size: 17px; line-height: 1.5;
  font-weight: 600; box-shadow: 0 -4px 0 var(--cream), 0 4px 0 var(--cream), -4px 0 0 var(--cream), 4px 0 0 var(--cream); }
.quote::before { content: ""; position: absolute; top: -12px; left: 34px; width: 8px; height: 8px; background: var(--cream);
  box-shadow: -4px 4px 0 var(--cream); }
.story-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; }
.story-foot cite { font-style: normal; color: #b8b6c8; }
.story-foot a { font: 600 15px/1.3 var(--f-pixel); text-decoration: none; }
.story-foot a:hover { text-decoration: underline; }
.car-dots { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.car-dots button { width: 12px; height: 12px; padding: 0; border: 0; background: var(--sand-shadow); cursor: pointer; }
.car-dots button.on { background: var(--ink); }

/* ------------------------------------------------------------------ featured runs */
.runs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
@media (max-width: 1040px) { .runs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .runs { grid-template-columns: 1fr; } }
.run { text-decoration: none; display: flex; flex-direction: column; padding: 0; overflow: visible; transition: transform 0.1s; }
.run:hover { transform: translateY(-4px); }
.run:hover h3 { color: var(--wheat); }
.run .thumb { width: 100%; aspect-ratio: 16 / 10; background: #4e94a8; }
.run .body { padding: 16px 20px 18px; display: flex; flex-direction: column; flex: 1; }
.run h3 { font-size: 21px; margin: 6px 0 8px; color: var(--cream); }
.run p { font-size: 15px; line-height: 1.55; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.run .facts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { font: 500 13px/1 var(--f-pixel); color: var(--cream); background: var(--sky2); padding: 6px 8px 5px; }
.chip.gold { background: var(--wheat); color: var(--ink); }

/* ------------------------------------------------------------------ notes + open data */
.split { display: block; }
.split > div + div { margin-top: 64px; }
.data { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.data .code { margin: 0; }
@media (max-width: 900px) { .data { grid-template-columns: 1fr; gap: 8px; } .data .code { margin-top: 8px; } }
.notes { padding: 8px 24px; }
.note > div:last-child { max-width: 72ch; }
.note { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 16px 0; text-decoration: none; color: var(--cream); }
.note + .note { border-top: 4px dotted var(--sky2); }
.note .date { font: 500 15px/1.35 var(--f-pixel); color: var(--wheat); }
.note .date span { display: block; color: #b8b6c8; font-size: 13px; }
.note h3 { font-size: 20px; margin: 0 0 6px; color: var(--cream); }
.note:hover h3 { color: var(--wheat); text-decoration: underline; text-underline-offset: 4px; }
.note p { font-size: 15px; margin: 0; }
.draft { font: 500 11px/1 var(--f-pixel); background: var(--rim); color: var(--cream); padding: 3px 5px 2px; vertical-align: 3px; margin-left: 6px; letter-spacing: 0.06em; }
@media (max-width: 480px) { .note { grid-template-columns: 1fr; gap: 4px; } .note .date span { display: inline; margin-left: 8px; } }
.data p { font-size: 16px; }
.code { margin: 16px 0 0; background: #121933; color: var(--cream); padding: 16px; font-size: 13.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.code .c { color: #9ccfe0; }
.loading { color: inherit; opacity: 0.7; font-family: var(--f-pixel); }

.hero h1.wordmark { font-weight: 400; letter-spacing: 0; }
