/* ==========================================================================
   Home — welcome stage + chapters bento (Figma Frame 203 + Slide 16:9 - 7)
   ========================================================================== */

/* bar sits inside the glass card on the welcome screen (Figma: logo at 149,152) */
body[data-chapter="home"] .bar:not(.is-docked) { transform: translateY(calc(185 * var(--fx) - var(--bar-h) / 2)); padding-inline: calc(149 * var(--fx)); }
body[data-chapter="home"] .bar { transition: transform .7s var(--ease), padding .7s var(--ease), color .4s; }

/* ---------- welcome stage ---------- */
.hh { position: relative; height: 100svh; min-height: 620px; overflow: hidden; background: #05061A; color: #fff; }
.hh__stage { position: absolute; inset: -4%; will-change: transform; }
.hh__room { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hh__room--dark { filter: brightness(.5) saturate(.85); }
.hh__room--lit {
  filter: brightness(1.35) contrast(1.06) saturate(1.05);
  -webkit-mask-image: radial-gradient(circle var(--lr, 26vw) at var(--lx, 46%) var(--ly, 46%), #000 0%, rgba(0,0,0,.55) 38%, transparent 72%);
          mask-image: radial-gradient(circle var(--lr, 26vw) at var(--lx, 46%) var(--ly, 46%), #000 0%, rgba(0,0,0,.55) 38%, transparent 72%);
}
.hh__tint { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(101,47,234,.95) 0%, rgba(101,47,234,.55) 18%, rgba(101,47,234,0) 46%); }

.hh__card {
  position: absolute; z-index: 2;
  top: calc(99 * var(--fx)); bottom: calc(100 * var(--fx)); left: calc(105 * var(--fx)); right: calc(105 * var(--fx));
  min-height: 0; display: grid; place-items: center; text-align: center; transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(101,47,234,.94) 0%, rgba(101,47,234,.7) 50%, rgba(101,47,234,.38) 100%);
}
.hh__content { width: min(100%, 1260px); padding: calc(var(--bar-h) + var(--s-3)) var(--s-5) var(--s-5); display: grid; justify-items: center; gap: clamp(20px, calc(56 * var(--fx)), 56px); }
.hh__title { font: 700 clamp(38px, calc(64 * var(--fx) * 1.12), 92px)/1.32 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.hh__title span { display: block; }
.hh__chips { max-width: 1320px; row-gap: clamp(10px, calc(29 * var(--fx)), 29px); }
.hh__chips .chip { font-size: clamp(14px, calc(20 * var(--fx)), 20px); }
.hh__lede { max-width: 994px; font-size: clamp(16px, calc(24 * var(--fx)), 24px); line-height: 1.5; color: rgba(255,255,255,.95); text-wrap: pretty; }
.hh__lede b { font-weight: 700; }

.hh__reveal { position: absolute; inset: auto 0 0 0; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5); padding: 0 var(--gutter) calc(70 * var(--fx) + 28px); pointer-events: none; opacity: 0; }
.hh__reveal::before { content: ""; position: absolute; inset: -40vh 0 0 0; z-index: -1; background: linear-gradient(0deg, rgba(14,19,60,.85) 0%, rgba(101,47,234,.55) 35%, transparent 100%); }
.hh__tag { font: 600 var(--t-h1)/1 var(--font-display); letter-spacing: -.035em; color: #fff; text-shadow: 0 8px 40px rgba(14,19,60,.45); }
.hh__tag span { display: block; overflow: hidden; }
.hh__tag-ar { font-size: var(--t-h3); font-weight: 600; line-height: 1.3; color: var(--m-lilac-2); text-align: right; }
.hh__cue { position: absolute; left: 50%; bottom: calc(36 * var(--fx)); z-index: 3; transform: translateX(-50%); font: 500 11px/1 var(--font-display); letter-spacing: .24em; text-transform: uppercase; opacity: .8; display: grid; justify-items: center; gap: 10px; }
.hh__cue::after { content: ""; width: 1px; height: 30px; background: linear-gradient(#fff, transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }

@media (max-width: 760px) {
  .hh__card { top: 12px; left: 12px; right: 12px; bottom: 56px; }
  body[data-chapter="home"] .bar:not(.is-docked) { transform: translateY(14px); padding-inline: 28px; }
  .hh__content { padding-inline: 18px; }
  .hh__chips { gap: 8px; }
}

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--m-navy); }
.tl { position: relative; display: block; aspect-ratio: 960 / 637; overflow: hidden; isolation: isolate; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.tl > * { transition: transform .9s var(--ease), filter .9s var(--ease), opacity .6s; }
.tl__chip { position: absolute; z-index: 4; left: calc(120 / 960 * 100%); top: calc(56 / 637 * 100%); }
.tl__go {
  position: absolute; z-index: 5; right: calc(48 / 960 * 100%); bottom: calc(44 / 637 * 100%);
  display: inline-flex; align-items: center; gap: .5em; padding: .7em 1.05em; border-radius: 999px;
  font: 600 var(--t-micro)/1 var(--font-display); letter-spacing: .04em; background: #fff; color: var(--m-navy);
  box-shadow: 0 12px 30px -14px rgba(14,19,60,.6); opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--ease);
}
.tl__go svg { width: 1.1em; height: 1.1em; }
.tl:hover .tl__go, .tl:focus-visible .tl__go { opacity: 1; transform: none; }
.tl__num { position: absolute; z-index: 4; right: calc(48 / 960 * 100%); top: calc(60 / 637 * 100%); font: 500 var(--t-micro)/1 var(--font-display); letter-spacing: .16em; opacity: .55; }
.tl__big { position: absolute; z-index: 2; left: calc(105 / 960 * 100%); top: calc(150 / 637 * 100%); font: 600 calc(96 / 960 * 50vw)/1.05 var(--font-display); letter-spacing: -.03em; color: var(--m-navy); }
.tl__big span { display: block; }
.tl__big--white { color: #fff; }
.tl__big--mid { top: calc(186 / 637 * 100%); }
.tl__fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }

/* strategy */
.tl--strategy .tl__big { top: calc(159 / 637 * 100%); }
.tl__shapes { position: absolute; right: calc(100 / 960 * 100%); top: 50%; transform: translateY(-30%); font-size: calc(31 / 960 * 50vw); z-index: 2; }
.tl__shapes .shapes { font-size: inherit; gap: .45em; }
.tl--strategy:hover .shapes .shape:nth-child(1) { transform: rotate(-90deg) translateX(-.2em); }
.tl--strategy:hover .shapes .shape:nth-child(2) { transform: rotate(90deg) scale(1.15); }
.tl--strategy:hover .shapes .shape:nth-child(3) { transform: rotate(45deg); }
.tl--strategy:hover .shapes .shape:nth-child(4) { transform: rotate(180deg) scale(1.15); }

/* architecture: glass cursor floats with the pointer */
.tl--arch .tl__big { left: calc(74 / 960 * 100%); top: calc(148 / 637 * 100%); }
.tl__cursor { position: absolute; z-index: 3; left: calc(292 / 960 * 100%); top: calc(41 / 637 * 100%); width: calc(637 / 960 * 100%); mix-blend-mode: screen; filter: drop-shadow(0 30px 40px rgba(14,19,60,.25)); animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -14px; rotate: -2deg; } }

/* overview: the four shapes take turns (stand-in for the Figma pattern video) */
.tl__dance { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: calc(40 / 960 * 50vw); font-size: calc(110 / 960 * 50vw); }
.tl__dance .shape { animation: turn 4.8s var(--ease) infinite; }
.tl__dance .shape:nth-child(2) { animation-delay: 1.2s; }
.tl__dance .shape:nth-child(3) { animation-delay: 2.4s; }
.tl__dance .shape:nth-child(4) { animation-delay: 3.6s; }
@keyframes turn { 0%, 30%, 100% { transform: none; } 10% { transform: translateY(-18%) rotate(90deg) scale(1.18); } 20% { transform: rotate(90deg); } }
.tl--overview:hover .tl__dance .shape { animation-duration: 2.4s; }
.tl--overview:hover .tl__dance .shape:nth-child(2) { animation-delay: .6s; }
.tl--overview:hover .tl__dance .shape:nth-child(3) { animation-delay: 1.2s; }
.tl--overview:hover .tl__dance .shape:nth-child(4) { animation-delay: 1.8s; }

/* logo: outline draws, then fills; inner sparkle spins (stand-in for the logo animation video) */
.tl__logo { position: absolute; inset: 0; display: grid; place-items: center; }
.tl__logo svg { width: calc(260 / 960 * 50vw); height: auto; overflow: visible; color: var(--m-navy); }
.tl__logo .lg-body { fill: currentColor; stroke: var(--m-purple); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tl__logo .lg-star { fill: var(--m-purple); transform-box: fill-box; transform-origin: 50% 50%; }
.tl--logo.is-in .lg-body { animation: draw 6s var(--ease) infinite; }
.tl--logo.is-in .lg-star { animation: spark 6s var(--ease) infinite; }
@keyframes draw { 0% { fill-opacity: 0; stroke-dashoffset: 1; } 35% { fill-opacity: 0; stroke-dashoffset: 0; } 48%, 100% { fill-opacity: 1; stroke-dashoffset: 0; } }
@keyframes spark { 0%, 40% { transform: scale(0) rotate(-90deg); } 55% { transform: scale(1.5) rotate(0); } 65%, 100% { transform: scale(1) rotate(0); } }

/* patterns */
.tl--patterns .tl__fill { inset: -3%; width: 106%; height: 106%; }
.tl--patterns:hover .tl__fill { filter: saturate(1.25) brightness(1.08); }

/* direction: editorial photo, motion-blur figures */
.tl__photo { filter: grayscale(1) contrast(1.02); }
.tl--direction:hover .tl__photo { transform: scale(1.06); filter: grayscale(1) contrast(1.15); }

/* elements: the knitted logo squishes */
.tl__knit { position: absolute; left: calc(158 / 960 * 100%); top: calc(46 / 637 * 100%); width: calc(633 / 960 * 100%); transform-origin: 50% 90%; }
.tl--elements:hover .tl__knit { animation: squish .9s var(--ease); }
@keyframes squish { 0% { transform: none; } 25% { transform: scale(1.08, .9); } 50% { transform: scale(.95, 1.07); } 75% { transform: scale(1.02, .98); } 100% { transform: none; } }

/* colors: swatches open on hover */
.tl__swatches { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; }
.tl__swatches i { position: relative; background: var(--c); transition: transform .5s var(--ease), z-index 0s; }
.tl__swatches b { position: absolute; left: 14%; bottom: 12%; font: 600 var(--t-micro)/1 var(--font-display); letter-spacing: .06em; color: var(--t, #fff); opacity: 0; transform: translateY(6px); transition: .35s var(--ease); }
.tl__swatches i:hover { transform: scale(1.06); z-index: 2; box-shadow: 0 20px 40px -20px rgba(14,19,60,.6); }
.tl--colors:hover .tl__swatches b { opacity: .55; transform: none; }
.tl__swatches i:hover b { opacity: 1; }
.tl--colors .tl__chip { left: calc(66 / 960 * 100%); top: calc(57 / 637 * 100%); }

/* mockups: flags sway */
.tl__flags { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 100%; }
.tl--mockups:hover .tl__flags { animation: sway 2.6s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: skewX(0) scale(1.02); } 50% { transform: skewX(-1.6deg) scale(1.03); } }

/* fonts: pointer drives the Sora weight axis */
.tl__font { position: absolute; left: calc(172 / 960 * 100%); top: calc(160 / 637 * 100%); color: #fff; display: block; }
.tl__font b { display: inline-block; font: 700 calc(248 / 960 * 50vw)/1 var(--font-display); letter-spacing: -.045em; font-weight: var(--w, 700); transition: font-weight .25s; }
.tl__font i { display: inline-block; width: calc(40 / 960 * 50vw); height: calc(40 / 960 * 50vw); background: var(--m-navy); margin-left: .4em; }
.tl__font em { position: absolute; right: -.4em; top: calc(-48 / 960 * 50vw); font: 600 calc(45 / 960 * 50vw)/1 var(--font-display); font-style: normal; white-space: nowrap; }
.tl--fonts .tl__chip { left: calc(66 / 960 * 100%); top: calc(88 / 637 * 100%); background: var(--m-lilac); }
.tl__axis { position: absolute; left: calc(172 / 960 * 100%); bottom: calc(60 / 637 * 100%); color: rgba(255,255,255,.75); font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; opacity: 0; transition: opacity .4s; }
.tl--fonts:hover .tl__axis { opacity: 1; }

/* every tile: lift on hover */
.tl:hover { z-index: 2; }
.tl::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 0 0 var(--m-purple); transition: box-shadow .5s var(--ease); }
.tl:focus-visible::after { box-shadow: inset 0 0 0 4px var(--m-violet); }
.tl:focus-visible { outline: none; }

@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr; }
  .tl__big { font-size: calc(96 / 960 * 100vw); }
  .tl__shapes { font-size: calc(31 / 960 * 100vw); }
  .tl__dance { font-size: calc(110 / 960 * 100vw); gap: calc(40 / 960 * 100vw); }
  .tl__logo svg { width: calc(260 / 960 * 100vw); }
  .tl__font b { font-size: calc(248 / 960 * 100vw); }
  .tl__font i { width: calc(40 / 960 * 100vw); height: calc(40 / 960 * 100vw); }
  .tl__font em { font-size: calc(45 / 960 * 100vw); top: calc(-48 / 960 * 100vw); }
  .tl__go { opacity: 1; transform: none; }
}
