/* Cinematic homepage hero: a WebGL film of spreadsheet cells with kinetic type.
   The copy is real HTML and stays readable without WebGL, JavaScript or motion. */
header:has(+ .cosmic-main) { background: #060a15; border-color: #ffffff12; }

.film-hero {
  --film-void: #060a15;
  --film-mint: #8ce9d6;
  --film-violet: #b9adf7;
  --film-amber: #f8bf83;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: clamp(660px, calc(100svh - 92px), 960px);
  background: var(--film-void);
  color: #fff;
}
.film-hero::before { display: none; }
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }

/* Static art for browsers without WebGL2 (and before the film starts). */
.film-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 74% 42%, #6953ef33 0%, transparent 42%),
    radial-gradient(ellipse at 30% 92%, #31cdb922 0%, transparent 40%),
    linear-gradient(180deg, #0a1122, #05080f);
}
.film-backdrop::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -120px;
  height: 420px;
  transform: perspective(560px) rotateX(64deg);
  background-image: linear-gradient(#8ce9d61f 1px, transparent 1px), linear-gradient(90deg, #8ce9d61f 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(transparent, #000 40%, transparent 96%);
  -webkit-mask-image: linear-gradient(transparent, #000 40%, transparent 96%);
}
.film-live .film-backdrop { opacity: 0; transition: opacity 600ms ease; }
.film-static .film-canvas { display: none; }

/* Copy column */
.film-hero .wrap.film-wrap {
  position: relative;
  z-index: 2;
  display: block;
  width: min(1180px, calc(100% - 48px));
  min-height: 0;
  margin: 0 auto;
  padding: 64px 0 132px;
}
.film-copy { position: relative; max-width: 600px; }
.film-hero .eyebrow {
  font-size: 10px;
  letter-spacing: .2em;
  color: #d7e3f0;
  border: 1px solid #95a1cc40;
  border-radius: 99px;
  background: #0d1426b3;
  padding: 11px 14px;
}
.film-hero h1 {
  font-size: clamp(60px, 6.6vw, 104px);
  line-height: .99;
  letter-spacing: -.075em;
  margin: 26px 0 26px;
  text-shadow: 0 2px 30px #060a15;
}
.film-hero h1 span {
  color: #88e7d7;
  background: linear-gradient(112deg, #b6fff0 5%, #62e0cb 42%, #afa3ff 94%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.film-hero .lead { font-size: 18px; line-height: 1.7; color: #c2ccde; max-width: 500px; margin: 0 0 12px; text-shadow: 0 1px 18px #060a15; }
.film-hero .heroactions { margin-top: 28px; gap: 13px; }
.film-hero .primary {
  background: linear-gradient(105deg, #90efdd, #63d9cc);
  color: #071823;
  border: 1px solid #c1fff280;
  box-shadow: 0 0 28px #58d5c133, inset 0 1px #ffffff70;
  padding: 17px 24px;
  font-size: 14px;
}
.film-hero .secondary { background: #0d1526d9; border-color: #63729180; padding: 17px 21px; }
.film-hero .smallnote { font-size: 12px; color: #a3b0c6; margin: 20px 0 0; }
.film-hero .hero-proof { display: flex; align-items: center; gap: 25px; margin-top: 30px; }
.film-hero .hero-proof > div { display: flex; flex-direction: column; gap: 5px; }
.film-hero .hero-proof > div + div { border-left: 1px solid #6f7a9c55; padding-left: 25px; }
.film-hero .hero-proof strong { font: 800 25px 'Manrope', sans-serif; letter-spacing: -.04em; }
.film-hero .hero-proof span { color: #b9c5d6; font-size: 11px; }

/* The film plays its own entrance; the site-wide load animation would fight it. */
.motion-enabled .film-hero :is(.eyebrow, h1, .lead, .heroactions) { animation: none; }
.film-pending .film-hero .film-copy > *, .film-pending .film-hero .film-scroll {
  opacity: 0;
  animation: film-failsafe 1ms linear 3.5s forwards;
}
@keyframes film-failsafe { to { opacity: 1; } }

/* Letterbox bars frame the opening sequence, then retract. */
.film-bars span {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  height: clamp(22px, 6.2vh, 62px);
  background: #000;
  pointer-events: none;
  transform: translateY(-101%);
}
.film-bars span:first-child { top: 0; }
.film-bars span:last-child { bottom: 0; transform: translateY(101%); }
.film-static .film-bars, html:not(.motion-enabled) .film-bars { display: none; }

/* Kinetic type layer */
.film-type { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.film-static .film-type { display: none; }
.ft {
  position: absolute;
  visibility: hidden;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  color: #eef4fb;
  white-space: nowrap;
  will-change: transform;
}
.ft-l { display: inline-block; will-change: transform, opacity; }
.ft-scatter {
  font-size: clamp(28px, 4.4vw, 70px);
  letter-spacing: -.05em;
  perspective: 900px;
  text-shadow: 0 0 26px #8ce9d655, 0 2px 14px #060a15;
}

.ft-cells { left: 50%; top: 50%; translate: -50% -50%; line-height: 1; letter-spacing: 0; }
.ft-colhead, .ft-row { display: flex; align-items: stretch; }
.ft-colhead { padding-left: 1.6em; margin-bottom: .22em; }
.ft-colref {
  width: .74em;
  font: 600 max(10px, .2em) 'DM Sans', sans-serif;
  color: #9fb4cf;
  text-align: center;
  letter-spacing: .04em;
}
.ft-row + .ft-row { margin-top: .08em; }
.ft-rowref {
  width: 1.6em;
  display: grid;
  place-items: center;
  font: 600 max(10px, .2em) 'DM Sans', sans-serif;
  color: #9fb4cf;
}
.ft-cell { position: relative; width: .74em; height: 1.2em; display: grid; place-items: center; --flash: 0; }
.ft-box {
  position: absolute;
  inset: 0;
  border: 1px solid #8ce9d655;
  margin-left: -1px;
  background: rgba(10, 20, 40, calc(.72 - var(--flash) * .2));
  box-shadow: inset 0 0 calc(var(--flash) * 22px) rgba(140, 233, 214, calc(var(--flash) * .9));
  transform-origin: center;
}
.ft-glyph { position: relative; display: block; text-shadow: 0 0 18px #8ce9d666; }
.ft-cursor {
  position: absolute;
  left: 0;
  top: 0;
  border: 2px solid var(--film-mint);
  box-shadow: 0 0 18px #8ce9d6aa;
  transition: transform 90ms cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}

.ft-rise {
  left: 50%;
  top: 21%;
  translate: -50% 0;
  font-size: clamp(30px, 5vw, 76px);
  letter-spacing: -.05em;
  text-shadow: 0 0 26px #b9adf74d, 0 2px 14px #060a15;
}
.ft-rise .ft-l { transform-origin: 50% 100%; }
.ft-axis {
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: .02em;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--film-mint) 15%, var(--film-violet) 85%, transparent);
  box-shadow: 0 0 14px #8ce9d6;
  transform-origin: left center;
}

.ft-head { transform-origin: 0 0; white-space: normal; color: #f4f8fd; text-shadow: 0 6px 40px #060a15cc; }
.ft-scrim {
  inset: 0;
  background: radial-gradient(ellipse 58% 46% at 50% 48%, #060a15d9 0%, #060a1599 45%, #060a1500 100%);
  will-change: opacity;
}
.ft-head .ft-word { display: inline-block; white-space: nowrap; }
.ft-head .ft-l { will-change: transform, opacity; }

/* Skip / replay control */
.film-control {
  position: absolute;
  left: max(24px, calc((100% - 1180px) / 2));
  bottom: 30px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 11px;
  border: 1px solid #ffffff2e;
  border-radius: 99px;
  background: #0b1224cc;
  color: #dfe8f5;
  font: 700 12px 'DM Sans', sans-serif;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.film-control::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--film-mint);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}
.film-control[data-mode="replay"]::after { display: none; }
.film-control[data-mode="replay"]::before { content: '\21BB'; font-size: 14px; line-height: 1; color: var(--film-mint); }
.film-control:hover { border-color: #8ce9d680; color: #fff; }
.film-control:focus-visible { outline: 3px solid var(--film-mint); outline-offset: 3px; }
.film-control[hidden] { display: none; }

.film-scroll {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #a9b9ce;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  z-index: 4;
  white-space: nowrap;
}
.film-scroll span { width: 18px; height: 28px; border: 1px solid #8fa6be55; border-radius: 99px; display: grid; place-items: center; color: #8ce6d4; font-size: 13px; }

/* Shared homepage pieces that sat under the old hero */
.cosmic-strip .stripinner { background: #111b2b; color: #d8e4f4; border: 1px solid #8a9eb63b; box-shadow: 0 20px 50px #03061124; }
.cosmic-strip .stripitem:not(:last-child) { border-color: #637b983b; }
.cosmic-strip .stripicon { background: #23423f; color: #8eeada; }
.launch-film { background: #eff3f1; padding: 76px 0; }
.launch-film .filmgrid { grid-template-columns: 1fr 1fr; gap: 65px; }
.launch-film h2 { max-width: 470px; }
.launch-film .filmframe { padding: 8px; }
.launch-film .filmhint { color: #526078; text-align: left; }
.launch-film .filmcopy p { max-width: 500px; }

@media (min-width: 761px) and (max-height: 860px) and (orientation: landscape) {
  .film-hero h1 { font-size: clamp(56px, 10vh, 96px); margin: 20px 0 20px; }
  .film-hero .wrap.film-wrap { padding: 44px 0 112px; }
  .film-hero .heroactions { margin-top: 22px; }
  .film-hero .hero-proof { margin-top: 22px; }
}
@media (max-width: 1150px) {
  .film-hero h1 { font-size: 78px; }
  .film-copy { max-width: 540px; }
}
@media (max-width: 760px), (max-width: 1150px) and (orientation: portrait) {
  .film-hero { align-items: flex-end; min-height: max(700px, calc(100svh - 66px)); }
  .film-hero .wrap.film-wrap { text-align: center; padding: min(64vw, 260px) 0 92px; }
  .film-copy { margin: 0 auto; max-width: 520px; }
  .film-copy::before {
    content: '';
    position: absolute;
    inset: -40px -40px -60px;
    z-index: -1;
    background: radial-gradient(ellipse at 50% 55%, #060a15e6 30%, #060a1500 72%);
    pointer-events: none;
  }
  .film-hero .lead { margin-left: auto; margin-right: auto; }
  .film-hero .heroactions, .film-hero .hero-proof { justify-content: center; }
  .film-scroll { display: none; }
  .launch-film .filmgrid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 600px) {
  .film-hero .wrap.film-wrap { width: calc(100% - 32px); padding-bottom: 104px; }
  .film-hero .eyebrow { font-size: 9px; letter-spacing: .12em; padding: 10px 12px; }
  .film-hero h1 { font-size: clamp(52px, 14.6vw, 76px); margin: 22px 0 20px; }
  .film-hero .lead { font-size: 16px; max-width: 380px; }
  .film-hero .heroactions { gap: 10px; margin-top: 22px; }
  .film-hero .primary, .film-hero .secondary { font-size: 12px; padding: 15px 18px; }
  .film-hero .hero-proof { margin-top: 24px; gap: 18px; }
  .film-hero .hero-proof > div + div { padding-left: 18px; }
  .film-hero .hero-proof strong { font-size: 22px; }
  .film-hero .hero-proof span { font-size: 10px; }
  .ft-scatter { font-size: 7.4vw; }
  .film-control { left: 16px; bottom: 22px; padding: 9px 14px 10px; font-size: 11px; }
  .cosmic-strip .stripinner { padding: 20px; }
  .launch-film { padding: 70px 0; }
}
@media (max-width: 360px) {
  .film-hero h1 { font-size: 48px; }
}
@media (forced-colors: active) {
  .film-hero h1 span { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
  .film-canvas, .film-type, .film-bars { display: none; }
}

/* Light homepage sections: storefront.css gives <body> the dark store theme's near-white text colour, so headings here inherited it and vanished on white/pastel backgrounds. */
.cosmic-main :is(.salessection.white, .salessection.mint, .salessection.sand, .salessection.lavender, .productstory:nth-of-type(even), .launch-film) { color: var(--ink); }

/* Same cause, remaining spots: white cards/tables on the dark store background, and the odd "story" sections that have dark ink text but no light background. */
.cosmic-main :is(.benefit, .choosetable) { color: var(--ink); }
.cosmic-main .productstory:nth-of-type(odd) { background: var(--cream); color: var(--ink); }
