/* Varholdt Labs · the home page
 * What only the home page has: the hero with the painted town over
 * halftone dots and the tools band, the four offer cards, the projects over
 * painted landscapes, Sound familiar, the step cards that stack, the founder
 * in a stone niche, and the arch that closes the page. The header, menu,
 * buttons, FAQ, dialog, footer and logo glide come from site.css.
 * home.js splits the headings into words, drives the reveals, the dots, the
 * step stack, the phone carousel dots and the keystone.
 */

/* The page sets its own spacing with grid gaps */
:where(.home) :where(p, h1, h2, h3) { margin: 0; }
:where(.home) :where(h1, h2, h3) { font-weight: 400; }
:where(.home) :where(ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(.home) :where(figure) { margin: 0; }
:where(.home) :where(img) { height: auto; }
.home .section-title { margin: 0; }
.home .section-lede { max-width: 34em; }

/* ---------- Type ---------- */
.h1 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6.3vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
/* The hero headline breaks into two lines, or three on a phone, so no
   line is left to wrap on its own. */
.h1 .br-phone { display: none; }
@media (max-width: 560px) {
  .h1 .br-phone { display: inline; }
  .h1 .br-wide { display: none; }
}
.h2-xl { font-size: clamp(2.6rem, 5.4vw, 5.2rem); }
.card-k { font: 500 0.64rem/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }

/* ---------- Hero ----------
   The headline is the hero. The stage holds the copy, one canvas of dots
   and the town. The tools band is the floor. The hero rides up under the
   clear header, so it starts at the top of the screen. */
.hero {
  position: relative;
  min-height: max(600px, calc(100svh / var(--zoom, 1)));
  margin-top: -68px;
  display: flex; flex-direction: column;
  isolation: isolate;
  overflow: hidden;
}
.hero-stage {
  position: relative;
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 68px;
}
.hero-dots {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.is-ready .hero-dots { opacity: 1; }
.hero-copy {
  position: relative; z-index: 2;
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 20px;
  padding: 20px var(--pad) 28px;
}
/* The page zoom on large screens would take the headline to 176px on a
   24" iMac. Past the first step it grows about a third as fast as the rest:
   140px at 1.15 and 1.3, 141px on the iMac, 181px at 2.4. */
.hero .h1 { font-size: clamp(3.2rem, 7.6vw, min(7.6rem, max(8.74rem / var(--zoom, 1), 2.66rem + 4.94rem / var(--zoom, 1)))); line-height: 0.92; letter-spacing: -0.028em; }
.hero-sub { max-width: 34em; color: var(--color-ink-2); font-size: clamp(1rem, 1.15vw, 1.1rem); line-height: 1.6; text-wrap: balance; }
.hero-cta { margin-top: 6px; }
/* The town: one painted strip standing on the band, centered, cut off
   by the screen on both sides. */
.hero-art { position: relative; z-index: 1; flex: none; width: 100%; height: clamp(132px, calc(22vh / var(--zoom, 1)), 214px); pointer-events: none; }
.town { position: absolute; left: 50%; bottom: 0; display: block; height: 100%; transform: translateX(-50%); }
.town img { display: block; width: auto; height: 100%; max-width: none; filter: drop-shadow(0 0 7px var(--color-paper)) drop-shadow(0 0 16px var(--color-paper)); }

/* The dark band is the ground the town stands on. */
.tools {
  position: relative; z-index: 2; width: 100%;
  display: grid; gap: 12px; justify-items: center;
  padding: 18px 0 20px;
  background: var(--color-navy);
  box-shadow: 0 -3px 0 var(--color-gold);
}
.tools-k { font-size: 0.62rem; color: var(--color-gold-lt); padding-inline: var(--pad); text-align: center; }
.tools-marquee {
  width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
/* Three copies of the row, so the loop never shows its end on a wide screen. */
.tools-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.tools-row { display: flex; gap: 44px; padding-right: 44px; }
.tools-row li {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.95rem; color: #efe9dc; white-space: nowrap;
}
.tools-row img { width: 18px; height: 18px; filter: brightness(0) invert(0.93) sepia(0.18); }
@keyframes marquee { to { transform: translateX(calc(-100% / 3)); } }
@media (hover: hover) and (pointer: fine) {
  .tools-marquee:hover .tools-track { animation-play-state: paused; }
}

/* ---------- Load-in and reveals ---------- */
.js .hero-art { opacity: 0; transform: translateY(12px); transition: opacity 0.8s var(--ease-out) 0.3s, transform 0.9s var(--ease-out) 0.3s; }
.js .is-ready .hero-art { opacity: 1; transform: none; }

.js [data-words] .w {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(0.12em);
  transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-words].in .w { opacity: 1; filter: blur(0); transform: none; }

.js [data-rise] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-rise].in { opacity: 1; transform: none; }
.js .hero-copy .hero-sub, .js .hero-copy .btn {
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.7s var(--ease), transform 0.8s var(--ease), scale 160ms var(--ease-out);
}
.js .is-ready .hero-copy .hero-sub { opacity: 1; transform: none; transition-delay: 0.45s; }
.js .is-ready .hero-copy .btn { opacity: 1; transform: none; transition-delay: 0.6s, 0.6s, 0s; }

/* ---------- Sections ---------- */
.sec { position: relative; padding-block: clamp(64px, 8vw, 120px); }

/* Services */
.svc { padding-top: clamp(24px, 3vw, 48px); }
.svc-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 24px;
}
.svc-head { display: grid; gap: 18px; justify-items: start; align-self: center; }
.scribe { width: min(100%, 460px); justify-self: end; position: relative; }
.scribe img {
  width: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: -34px;
  position: relative; z-index: 2;
}
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: clamp(22px, 2.6vw, 38px);
  box-shadow: var(--shadow-card);
}
.card h3 { font-family: var(--font-serif); font-size: clamp(1.8rem, 2.3vw, 2.3rem); line-height: 1; letter-spacing: -0.01em; margin-bottom: 4px; }
.card p:not(.card-k) { font-size: 1rem; color: var(--color-ink-2); line-height: 1.58; max-width: 36em; }
.card .offer-link { margin-top: auto; padding-top: 8px; font-size: 0.9rem; transition: color 0.3s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .card .offer-link:hover { color: var(--color-accent); }
}

/* Projects */
.proof { padding-top: clamp(40px, 6vw, 90px); }
.proof-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 64px); }
.panels { display: grid; gap: 18px; }
.panel { position: relative; }
.panel-art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: #d8cdb5;
}
.panel-land { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(20deg, rgb(18 16 13 / 0.86) 0, rgb(18 16 13 / 0.62) 26%, rgb(18 16 13 / 0) 52%);
}
.window {
  position: absolute; z-index: 3;
  right: 3.5%; top: 7.5%; width: 63%;
  background: #121110;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.08) inset, 0 50px 90px -40px rgb(10 8 5 / 0.75), 0 12px 30px -16px rgb(10 8 5 / 0.5);
  outline: 1px solid rgb(255 255 255 / 0.06);
}
.window-bar { display: flex; gap: 6px; padding: 9px 12px; }
.window-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgb(255 255 255 / 0.18); }
.window img { width: 100%; }
.panel-copy {
  position: absolute; z-index: 3; left: 0; bottom: 0;
  width: min(35%, 400px);
  padding: clamp(22px, 2.6vw, 38px);
  color: var(--color-paper);
  display: grid; gap: 10px; justify-items: start;
}
.panel-copy .kicker { color: rgb(243 240 233 / 0.72); }
.panel-copy h3 { font-family: var(--font-serif); font-size: clamp(2rem, 3vw, 2.9rem); line-height: 1; letter-spacing: -0.015em; }
.panel-line { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.2; color: #fff; }
.panel-desc { font-size: 0.9rem; line-height: 1.55; color: rgb(243 240 233 / 0.82); }
.panel-dots { display: none; }

/* Sound familiar: the title with a small Sisyphus beside it, then the
   four lines side by side under a hairline each. */
.pains-sec { padding-bottom: clamp(60px, 8vw, 110px); }
.pains-top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 24px;
}
.pains-head { display: grid; gap: 18px; justify-items: start; }
.sisyphus { width: min(100%, 360px); justify-self: end; }
.sisyphus img { width: 100%; }
.pain-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px clamp(20px, 2.6vw, 40px);
  margin-top: clamp(16px, 2.4vw, 32px);
}
.pain-list li { border-top: 1px solid var(--color-rule-2); padding-top: 18px; color: var(--color-ink-2); font-size: 1rem; }
.pain-list strong { display: block; margin-bottom: 8px; color: var(--color-ink); font-weight: 600; font-size: 1.06rem; line-height: 1.35; }
@media (max-width: 1100px) {
  .pain-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Here's how it starts. Each step is a card. They pin under the header
   and the next one slides over the last, so the three end up as one deck.
   A card reads in two rows: the number and what it costs you, then the
   name and what happens. */
.steps-sec { position: relative; padding-block: clamp(56px, 7vw, 104px); }
.steps-head { display: grid; gap: 16px; justify-items: center; text-align: center; }
.stack { display: grid; gap: 20px; max-width: 60rem; margin: clamp(36px, 5vw, 64px) auto 0; }
.scard {
  --i: 0;
  top: calc(88px + var(--i) * 18px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-rows: 1fr auto auto;
  column-gap: clamp(24px, 4vw, 64px);
  min-height: min(56vh / var(--zoom, 1), 400px);
  padding: clamp(26px, 3.4vw, 46px);
  border-radius: 8px;
  background: var(--color-card);
  box-shadow: inset 0 0 0 1px var(--color-rule), 0 -14px 34px -26px rgb(27 26 23 / 0.45);
  transform-origin: 50% 0;
}
.js .scard { position: sticky; }
.scard:nth-child(2) {
  --i: 1;
  background-color: #e9dfca;
  background-image: var(--plaster);
  background-size: 512px 512px;
  background-blend-mode: multiply;
}
.scard:nth-child(3) { --i: 2; background: var(--color-navy); color: var(--color-paper); box-shadow: 0 -14px 34px -26px rgb(27 26 23 / 0.6); }
.step-body { display: contents; }
.scard .num {
  grid-area: 1 / 1; align-self: start;
  font-family: var(--font-serif); font-size: clamp(6.4rem, 11vw, 9.5rem); line-height: 0.8; letter-spacing: -0.03em;
  color: var(--color-gold-ink);
}
.scard .kicker {
  grid-area: 1 / 2; justify-self: end; align-self: start;
  padding: 8px 12px;
  border: 1px solid var(--color-rule-2); border-radius: 999px;
  color: var(--color-ink-2);
}
.scard h3 {
  grid-area: 2 / 1; align-self: start;
  font-family: var(--font-serif); font-size: clamp(2.3rem, 3.8vw, 3.5rem); line-height: 1; letter-spacing: -0.015em;
}
.scard .step-body > p:not(.kicker) { grid-area: 2 / 2; align-self: start; color: var(--color-ink-2); font-size: 1.06rem; max-width: 30em; padding-top: 0.35em; }
.scard .btn { grid-area: 3 / 2; justify-self: start; margin-top: 20px; }
.scard:nth-child(3) .num { color: var(--color-gold-lt); }
.scard:nth-child(3) .kicker { color: #d5cdbd; border-color: rgb(243 240 233 / 0.28); }
.scard:nth-child(3) .step-body > p:not(.kicker) { color: #ddd6c8; }

/* Founder */
.founder { padding-top: clamp(40px, 6vw, 90px); }
.fd-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 100px);
  align-items: center;
}
.niche { position: relative; aspect-ratio: 2 / 3; width: min(100%, 420px); justify-self: center; }
.niche-photo {
  position: absolute; inset: 17.5% 20.5% 10.5% 20%;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  background: #222;
}
.niche-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.niche-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 30px 30px rgb(60 40 15 / 0.18)); }
.fd-body { display: grid; gap: 16px; justify-items: start; max-width: 36em; }
.fd-body > p:not(.kicker) { color: var(--color-ink-2); font-size: 1.04rem; }
.fd-body strong { color: var(--color-ink); font-weight: 600; }
.cert { color: var(--color-accent); }

/* FAQ: the shared questions and answers, with the title and line beside */
.home .faq-intro { display: grid; gap: 16px; }

/* Finale. The arch closes the page, and the footer is the ground it
   stands on. */
.finale {
  position: relative;
  min-height: clamp(640px, calc(54vw / var(--zoom, 1)), 900px);
  padding-top: clamp(90px, 10vw, 150px);
  overflow-x: clip;
  isolation: isolate;
}
.finale-copy { position: relative; z-index: 3; display: grid; gap: 20px; justify-items: start; }
.finale-copy .section-title { max-width: 7em; }
.finale-copy .section-lede { max-width: 26em; }
.finale-copy .btn { margin-top: 6px; }
.finale .small { color: var(--color-muted); font-size: 0.86rem; }
.keystone {
  position: absolute; z-index: 2; right: calc(min(66vw / var(--zoom, 1), 66rem) * -0.223); bottom: 0;
  width: min(66vw / var(--zoom, 1), 66rem);
  aspect-ratio: 1200 / 716;
}
.ks-arch {
  position: absolute; left: 0; top: 0; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%);
  mask-image: linear-gradient(90deg, transparent 0, #000 16%);
}
/* The keystone is its own small picture, cut from the arch, so it needs
   no clipping to show. The hand lowers it into the gap and lets go. */
.ks-move { position: absolute; inset: 0; transition: transform 1.6s var(--ease-io) 0.2s, opacity 0.6s var(--ease-out) 0.1s; }
.ks-stone { position: absolute; left: 43.667%; top: 0; width: 12.75%; height: auto; max-width: none; }
.ks-arm {
  position: absolute; left: 31.92%; top: -65.08%; width: 46%; height: auto; max-width: none;
  transition: transform 1.8s var(--ease), opacity 1.8s var(--ease);
}
.js .finale .ks-move { transform: translateY(-20%); opacity: 0; }
.js .finale.in .ks-move { transform: none; opacity: 1; }
.js .finale.is-set .ks-arm { transform: translate(5%, -16%) rotate(-3deg); }

/* ---------- Phones ---------- */
@media (max-width: 820px) {
  /* Hero: logo, headline, sub and button on the first screen, the town
     under the button, then the band. Spare height goes above the logo
     and under the button, a little more of it below. */
  .hero { min-height: max(560px, 100svh); margin-top: -60px; }
  .hero-stage { padding-top: 46px; }
  .hero-copy { gap: 14px; padding: 0 var(--pad) 20px; }
  .hero-copy::before, .hero-copy::after { content: ""; margin: -7px 0; }
  .hero-copy::before { flex: 4 1 0; }
  .hero-copy::after { flex: 5 1 0; }
  .hero .hf-lockup { margin-bottom: clamp(8px, 5svh, 46px); }
  .hero .h1 { font-size: clamp(2.9rem, 13.4vw, 3.9rem); }
  .hero-sub { font-size: 1rem; line-height: 1.55; }
  .hero-cta { margin-top: 4px; }
  .hero-art { height: clamp(112px, 18.5svh, 176px); }
  .tools { gap: 10px; padding: 14px 0 16px; }
  .tools-row { gap: 30px; padding-right: 30px; }

  .sec { padding-block: 72px; }
  .proof-head, .steps-head { text-align: center; }
  /* Services: the title on the left, the scribe small on the right, then
     the four offers as one joined list. */
  .svc { padding-top: 40px; }
  .svc-top { grid-template-columns: 1fr minmax(90px, 32%); gap: 0; align-items: end; }
  .svc-head { gap: 10px; padding-bottom: 20px; position: relative; z-index: 2; }
  .scribe { width: 145%; max-width: 220px; margin-right: -6px; }
  .cards { grid-template-columns: 1fr; gap: 0; margin-top: 0; }
  .card { padding: 22px 20px; gap: 8px; border-radius: 0; box-shadow: none; }
  .card + .card { border-top: 0; }
  .card:first-child { border-radius: 3px 3px 0 0; }
  .card:last-child { border-radius: 0 0 3px 3px; }
  .card h3 { font-size: 1.9rem; }
  .card .offer-link { min-height: 44px; padding-top: 0; }

  .proof-head { justify-items: center; }
  .panels {
    display: flex; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-inline: var(--pad);
    scroll-padding-inline: var(--pad);
  }
  .panels::-webkit-scrollbar { display: none; }
  .panel { flex: 0 0 86%; scroll-snap-align: center; background: var(--color-night); border-radius: 4px; overflow: hidden; }
  .panel-art { aspect-ratio: 4 / 3.6; border-radius: 0; }
  .panel-art::after { background: linear-gradient(180deg, rgb(22 21 18 / 0) 70%, var(--color-night) 100%); }
  /* The window fills most of the card. The painting shows above it. */
  .window { left: 5%; right: 5%; top: auto; bottom: 6%; width: auto; border-radius: 6px; }
  .window-bar { padding: 6px 9px; gap: 5px; }
  .window-bar i { width: 5px; height: 5px; }
  .panel-copy { position: relative; width: auto; padding: 6px 20px 24px; }
  .panel-copy h3 { font-size: 2.1rem; }
  .panel-line { font-size: 1.2rem; }
  .panel-desc { font-size: 1rem; }
  .panel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
  .panel-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--color-rule-2); transition: width 0.4s var(--ease), background 0.4s var(--ease); }
  .panel-dots i.on { width: 20px; background: var(--color-ink); }

  /* Sound familiar: the title on the left, Sisyphus small on the right,
     then the four lines as one list. */
  .pains-top { grid-template-columns: 1fr minmax(90px, 34%); gap: 0; align-items: end; }
  .pains-head { gap: 10px; padding-bottom: 14px; position: relative; z-index: 2; }
  .sisyphus { width: 130%; max-width: 200px; margin-right: -8px; }
  .pain-list { grid-template-columns: 1fr; gap: 0; margin-top: 6px; }
  .pain-list li { padding: 18px 0; }
  .pain-list li:last-child { border-bottom: 1px solid var(--color-rule-2); }
  .pains-sec { padding-bottom: 24px; }

  /* Steps on a phone: each card is as tall as its words. The title sits
     right under the number. home.js hides what a taller card would leave
     showing under a shorter one. */
  .steps-sec { padding-block: 56px 72px; }
  .stack { gap: 14px; }
  .scard {
    top: calc(72px + var(--i) * 14px);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto auto;
    column-gap: 12px;
    min-height: 0;
    padding: 22px 22px 26px;
  }
  .scard .num { font-size: 4.8rem; }
  .scard .kicker { padding: 7px 10px; }
  .scard h3 { grid-area: 2 / 1 / auto / span 2; font-size: 2.3rem; margin-top: 16px; }
  .scard .step-body > p:not(.kicker) { grid-area: 3 / 1 / auto / span 2; font-size: 1rem; padding-top: 10px; }
  .scard .btn { grid-area: 4 / 1 / auto / span 2; margin-top: 18px; }

  .fd-grid { grid-template-columns: 1fr; gap: 36px; }
  .niche { width: min(84%, 360px); }
  .fd-body { justify-items: stretch; }
  .fd-body .kicker, .fd-body .section-title { text-align: center; }
  .fd-body > p:not(.kicker) { font-size: 1.05rem; }

  .home .faq-layout { gap: 28px; }
  .home .faq-intro { justify-items: center; }

  .finale { min-height: 0; padding-top: 72px; padding-bottom: 0; display: flex; flex-direction: column; }
  .finale-copy { justify-items: center; text-align: center; }
  .finale-copy .section-title, .finale-copy .section-lede { margin-inline: auto; }
  .keystone { position: relative; width: 129%; margin-top: 224px; right: auto; }
  .ks-arch { -webkit-mask-image: none; mask-image: none; }
}

@media (max-width: 380px) {
  .hero .h1 { font-size: 2.75rem; }
}

/* ---------- Reduced motion: a still page, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .hero-art, .js [data-words] .w, .js [data-rise], .js .hero-copy .hero-sub, .js .hero-copy .btn,
  .js .finale .ks-move, .js .finale .ks-arm, .scard {
    opacity: 1 !important; filter: none !important; transition: none !important; transform: none !important;
  }
  .js .scard { position: static; }
  .tools-track { animation: none; }
}
