/* ===== Hero: one screen tall; copy left, animated orbit right, video filling the section =====
   Same design in both themes; .dark-block flips the text. Each theme has its own pre-rendered video
   (slowed and colour-treated in the file, so the browser only plays it); the poster sits behind it. */
.hero-home {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100vh; height: 100svh;
  min-height: 34rem;
  padding: calc(var(--header-h) + clamp(1rem, 3vh, 2.5rem)) 0 clamp(3.5rem, 7vh, 5rem);
  overflow: hidden;
  isolation: isolate;
}
:root .hero-home.dark-block { background: #a98fdc url("../../images/video/hero-streaks-light.jpg") center / cover; }
:root[data-theme="dark"] .hero-home { background: #04051a url("../../images/video/hero-streaks.jpg") center / cover; }

.hero-home__video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }

.hero-home::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(226, 222, 247, .86), rgba(226, 222, 247, .45) 40%, transparent 65%);
}
[data-theme="dark"] .hero-home::after {
  background: linear-gradient(90deg, rgba(8, 9, 34, .84), rgba(8, 9, 34, .45) 50%, transparent);
}

.hero-home__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vh, 2rem) clamp(1.5rem, 4vw, 3rem);
}
.hero-home__copy { display: grid; justify-items: start; gap: clamp(1rem, 3vh, 2.2rem); }
.hero-home__title { font-size: clamp(3rem, min(8.4vw, 13vh), 8.4rem); color: var(--cream-on-dark); }
.hero-home__title .accent { display: block; color: var(--blush-fixed); }
.hero-home__lead { font-size: clamp(1.1rem, min(1.9vw, 3vh), 1.7rem); max-width: 30ch; }

/* The stage keeps the right column (and hosts the video) */
.hero-home__stage {
  align-self: stretch;
  container-type: size;
  display: grid; place-items: center end;
}

.hero-home__scroll {
  position: absolute; left: 50%; bottom: 1.5rem;
  width: 30px; height: 48px;
  border: 2.5px solid var(--cream-on-dark); border-radius: 999px;
  translate: -50% 0;
}
.hero-home__scroll-dot {
  position: absolute; left: 50%; top: 8px;
  width: 6px; height: 10px; border-radius: 6px;
  background: var(--blush-fixed); translate: -50% 0;
  animation: scroll-dot 1.8s var(--ease-out) infinite;
}
@keyframes scroll-dot { 0% { opacity: 0; top: 6px; } 40% { opacity: 1; } 100% { opacity: 0; top: 26px; } }

@media (max-width: 900px) {
  .hero-home { padding-top: calc(var(--header-h) + clamp(3.5rem, 8vh, 4.5rem)); padding-bottom: 1.5rem; }
  .hero-home::after { background: rgba(220, 218, 245, .62); }
  [data-theme="dark"] .hero-home::after { background: rgba(8, 9, 34, .8); }
  .hero-home__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .hero-home__stage { place-items: center; }
  .hero-home__scroll { display: none; }
}

/* ===== Z-story ===== */
.zstory { overflow: hidden; }
.zstory__path {
  position: absolute; inset: 6% 0 0; width: 100%; height: 88%;
  fill: none; stroke: var(--magenta); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 0;
  vector-effect: non-scaling-stroke; opacity: .45; pointer-events: none;
}
@supports (animation-timeline: view()) {
  .zstory__path { animation: draw linear both; animation-timeline: view(); animation-range: entry 10% exit 30%; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.zstory__row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.zstory__row + .zstory__row { margin-top: clamp(4rem, 10vw, 9rem); }
.zstory__row--flip { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.zstory__text { --stack: 1.6rem; }
.zstory__media { aspect-ratio: 4 / 5; }
.zstory__media--round { border-radius: 999px 999px var(--radius) var(--radius); }

@media (max-width: 900px) {
  .zstory__path { display: none; }
  .zstory__row, .zstory__row--flip { grid-template-columns: 1fr; }
  .zstory__row--flip .zstory__media { order: 2; }
  .zstory__media { aspect-ratio: 4 / 3.4; }
}

/* ===== Bento ===== */
.bento-sec__title { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "pm pm fs fs"
    "pm pm pc pc"
    "mc mc mc mc";
  gap: clamp(.9rem, 1.8vw, 1.4rem);
}

.bento__tile {
  position: relative;
  display: flex; flex-direction: column; gap: 1rem;
  padding: clamp(1.4rem, 2.6vw, 2.2rem);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 250px;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
  box-shadow: var(--shadow-hard);
}
.bento__tile:hover { box-shadow: var(--shadow-hard-lg); }
.bento__tile p { max-width: 46ch; position: relative; z-index: 1; }
/* The title stays unpositioned so the link's ::after covers the whole tile */
.bento__tile { isolation: isolate; }
.bento__icon { position: relative; z-index: 1; }

.bento__tile--pm { grid-area: pm; background: var(--magenta); color: var(--egg); justify-content: flex-end; min-height: 460px; }
.bento__tile--pm .t-h3 { font-size: clamp(1.9rem, 3.4vw, 3.2rem); }
.bento__tile--fs { grid-area: fs; background: var(--blush); }
.bento__tile--pc { grid-area: pc; }
.bento__tile--mc { grid-area: mc; background: var(--indigo); color: var(--cream-on-dark); min-height: 0; }
/* Wide banner: icon + title on the left, text on the right */
@media (min-width: 1001px) {
  .bento__tile--mc { display: grid; grid-template-columns: auto minmax(0, 18rem) minmax(0, 1fr); align-items: center; gap: 1.2rem 2.2rem; padding-right: calc(52px + 3rem); }
  .bento__tile--mc .bento__go { top: 50%; translate: 0 -50%; }
  .bento__tile--mc p { max-width: 60ch; }
}

.bento__shape {
  position: absolute; right: -18%; top: -14%;
  width: 70%; aspect-ratio: 1;
  z-index: -1;
  background: var(--indigo); opacity: .55;
  transition: scale .8s var(--ease-out);
}
.bento__tile--pm:hover .bento__shape { scale: 1.15; }

.bento__icon { width: 48px; height: 48px; position: relative; }
.bento__tile--pm .bento__icon { width: 64px; height: 64px; }

/* Whole tile clickable */
.bento__link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.bento__link:focus-visible { outline: none; }
.bento__tile:has(.bento__link:focus-visible) { outline: 3px solid var(--ink); outline-offset: 4px; }

.bento__go {
  position: absolute; right: 1.2rem; top: 1.2rem;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: var(--border); border-radius: 50%;
  background: var(--egg); color: var(--ink);
  pointer-events: none; /* clicks fall through to the card link underneath */
  transition: rotate .45s var(--ease-spring), background .3s;
}
.bento__go svg { width: 22px; }
.bento__tile:hover .bento__go { rotate: 45deg; background: var(--blush); }

@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "pm pm" "fs fs" "pc mc"; }
  .bento__tile--pm { min-height: 400px; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; grid-template-areas: "pm" "fs" "pc" "mc"; }
  .bento__tile { min-height: 0; }
  .bento__tile--pm { min-height: 380px; }
}

/* ===== House: pillars rise on scroll, roof lands, each pillar is a tab ===== */
.house { --p: 0; overflow: hidden; }
.house__grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-areas: "head build" "panels build";
  gap: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.house__head { grid-area: head; align-self: end; }
.house__panels { grid-area: panels; align-self: start; display: grid; }
.house__build { grid-area: build; justify-self: center; width: min(100%, 600px); display: grid; }

/* Roof drops in once the pillars are up (--r: 0 → 1) */
.house__roof {
  --r: clamp(0, calc((var(--p) - .72) / .24), 1);
  position: relative; z-index: 2;
  width: 100%; height: auto;
  margin-bottom: -4px;
  overflow: visible;
  filter: drop-shadow(6px 6px 0 var(--ink));
  translate: 0 calc((1 - var(--r)) * -110px);
  rotate: calc((1 - var(--r)) * -7deg);
  opacity: clamp(0, calc(var(--r) * 3), 1);
  transform-origin: 50% 100%;
  transition: translate .35s var(--ease-out), rotate .35s var(--ease-out), opacity .35s;
}
.house.is-built .house__roof { animation: roof-land .55s var(--ease-spring); }
@keyframes roof-land { 0% { scale: 1 1; } 35% { scale: 1.03 .9; } 100% { scale: 1 1; } }
.house__roof-shape { fill: url(#roof-grad); stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
.house__eave { fill: var(--ink); }
.house__window { fill: var(--egg); stroke: var(--ink); stroke-width: 4; transition: fill .5s; }
.house__window-cross { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.house.is-built .house__window { fill: url(#roof-glow); filter: drop-shadow(0 0 10px rgba(255, 214, 77, .9)) drop-shadow(0 0 24px rgba(255, 184, 77, .5)); }

/* Pillars rise out of the ground, one after another (--t: 0 → 1) */
.house__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5%;
  height: clamp(230px, 30vw, 350px);
  padding-inline: 8%;
  clip-path: inset(-80px -60px 0 -60px);
}
.pillar {
  --t: clamp(0, calc((var(--p) - var(--i) * .14) / .4), 1);
  display: grid; grid-template-rows: auto 1fr auto;
  min-width: 0;
  translate: 0 calc((1 - var(--t)) * 108%);
  transition: translate .35s var(--ease-out), transform .45s var(--ease-spring), opacity .35s, filter .35s;
  opacity: .78;
  cursor: pointer;
}
.pillar--magenta { --c: var(--magenta); --fg: var(--cream-on-dark); }
.pillar--indigo { --c: var(--indigo-2); --fg: var(--cream-on-dark); }
.pillar--orchid { --c: var(--orchid); --fg: var(--ink); }
.pillar--haze { --c: var(--haze); --fg: var(--ink); }
.pillar__cap, .pillar__base { height: 16px; margin-inline: -14%; border: var(--border); border-radius: 6px; background: var(--c); }
.pillar__cap { margin-bottom: -2px; }
.pillar__base { margin-top: -2px; }
.pillar__shaft {
  display: grid; place-items: center;
  border-inline: var(--border);
  background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(18, 19, 43, .14) 7px 9px), var(--c);
  overflow: hidden;
}
.pillar__name {
  writing-mode: vertical-rl; rotate: 180deg;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(.95rem, 1.6vw, 1.3rem); letter-spacing: -.01em;
  color: var(--fg);
  white-space: nowrap;
}
.pillar:hover { opacity: 1; transform: translateY(-6px); }
.pillar[aria-selected="true"] { opacity: 1; transform: translateY(-16px); filter: drop-shadow(0 14px 16px rgba(237, 23, 111, .35)); }
.pillar:focus-visible { outline: none; }
.pillar:focus-visible .pillar__shaft { outline: 3px solid var(--magenta); outline-offset: 4px; }

/* Stepped plinth */
.house__ground {
  position: relative; z-index: 1;
  height: 20px; margin-inline: 3%;
  border: var(--border); border-radius: 6px;
  background: var(--stripes), var(--sand);
  box-shadow: 0 10px 0 -2px var(--paper), 0 10px 0 0 var(--ink);
}

/* Active pillar text */
.house__panel {
  grid-area: 1 / 1;
  position: relative;
  display: grid; gap: .7rem;
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2rem) clamp(1.8rem, 3.4vw, 2.4rem);
  border-radius: var(--radius);
  animation: panel-in .55s var(--ease-out);
}
.house__panel::before {
  content: ""; position: absolute; left: .9rem; top: 1.3rem; bottom: 1.3rem;
  width: 5px; border-radius: 5px; background: var(--c);
}
.house__panel p { color: var(--ink-2); }
@keyframes panel-in { from { opacity: 0; translate: 0 14px; } }

@media (max-width: 900px) {
  .house__grid { grid-template-columns: 1fr; grid-template-areas: "head" "build" "panels"; }
  .house__build { width: min(100%, 420px); }
}

/* ===== Support: pinned word reveal ===== */
.support { position: relative; }
.support__pin {
  position: relative;
  padding-block: calc(var(--section-y) * 1.4);
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--indigo-deep);
  color: var(--cream-on-dark);
}
.support__inner { position: relative; z-index: 2; display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.support__title { color: var(--cream-on-dark); }
.support__title .accent { color: var(--blush-fixed); }

.support__text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.7vw, 2.55rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 40ch;
  font-variation-settings: "wdth" 92, "opsz" 48;
}

.support__shape { position: absolute; z-index: 1; pointer-events: none; }
.support__shape--a { width: 40vw; aspect-ratio: 1; right: -10vw; top: -10vh; background: var(--magenta); opacity: .35; filter: blur(30px); }
.support__shape--b { width: 26vw; aspect-ratio: 1; left: -8vw; bottom: -8vh; background: var(--haze); opacity: .25; filter: blur(16px); animation-delay: -6s; }
.support__shape--c {
  width: 220px; height: 220px; right: 12%; bottom: 12%;
  border: 2px solid rgba(var(--on-rgb), .25); border-radius: 50%;
}
