/* OLE — Coming soon. Concept "Dissolve": the looping film is slowly covered by a rising
   pane of frosted glass; the waitlist form surfaces once the glass fills the screen.
   Modes: default = static stacked layout (no JS / reduced motion);
          html.is-scrolly = pinned stage driven by --p / --lp (set by site.js). */

@font-face {
  font-family: "PT Sans";
  src: url("fonts/pt-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Sans";
  src: url("fonts/pt-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Serif";
  src: url("fonts/pt-serif-italic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand tokens — .vault/entities/design-tokens.md */
  --ole-orange: #D25519;
  --ole-blue: #2D73BE;
  --ole-nude: #E6BEA0;
  --ole-black: #2D2D2D;
  --ole-white: #FFFFFF;
  --ole-cream: #F6E8DE; /* nude 35% + white 65% */
  --ole-orange-deep: #B44614; /* orange 88% + black 12% — hover */

  --font-body: "PT Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "PT Serif", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --surface: clamp(56px, 8vw, 120px); /* glass edge band height */
  --glass-edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2880 100' preserveAspectRatio='none'%3E%3Cpath d='M0 60C300 60 420 36 720 36S1140 60 1440 60 1860 36 2160 36 2580 60 2880 60V100H0Z'/%3E%3C/svg%3E");
  --glass-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.18 0 0 0 0 0.18 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --p: 0;  /* raw scroll progress through the scene, 0..1 */
  --lp: 0; /* eased liquid level, 0..1 */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ole-black);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ole-black);
  background: var(--ole-black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
p { margin: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Film (background loop) ---------- */

.scene { position: relative; }
.stage { position: relative; }

.film {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--ole-black);
}

.film__video,
.film__still img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film__still { display: none; }

.film__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgb(45 45 45 / 0.55), rgb(45 45 45 / 0) 40%),
    rgb(45 45 45 / calc(var(--lp) * 0.5));
}

/* ---------- Cue ---------- */

.cue {
  position: absolute;
  z-index: 4; /* stays legible above the rising glass until it fades out */
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--surface) * 0.5 + 1.25rem);
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  color: var(--ole-white);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: clamp(0, calc(1 - var(--p) * 5), 1);
  border-radius: 999px;
}

.cue__arrow {
  width: 1.375rem;
  height: 1.375rem;
  animation: cue-bob 2.4s var(--ease-out) infinite;
}

.cue:focus-visible {
  outline: 2px solid var(--ole-white);
  outline-offset: 4px;
}

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.6; }
}

/* ---------- Liquid ---------- */

.liquid {
  position: relative;
  z-index: 3;
  color: var(--ole-black);
}

/* Frosted glass: one pane blurs the film behind it; its top edge is a slow, shallow swell
   (SVG mask) traced by a thin light rim. The pane continues under the form, so the form
   sits on the same glass. Static mode has no film behind the body → opaque cream. */
.liquid__glass {
  position: absolute;
  top: calc(var(--surface) * -1);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.glass__drift {
  position: absolute;
  inset: 0 auto 0 0;
  width: 200%; /* two periods side by side for a seamless loop */
  animation: drift 36s linear infinite;
}

.glass__pane {
  position: absolute;
  inset: 0;
  background: var(--ole-cream);
  -webkit-mask-image: var(--glass-edge), linear-gradient(#000 0 0);
  mask-image: var(--glass-edge), linear-gradient(#000 0 0);
  -webkit-mask-size: 100% var(--surface), 100% calc(100% - var(--surface) + 1px);
  mask-size: 100% var(--surface), 100% calc(100% - var(--surface) + 1px);
  -webkit-mask-position: 0 0, 0 calc(var(--surface) - 1px);
  mask-position: 0 0, 0 calc(var(--surface) - 1px);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.glass__rim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: var(--surface);
  overflow: visible;
}

@keyframes drift {
  to { transform: translate3d(-50%, 0, 0); }
}

.liquid__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(2.5rem, 9vh, 6rem) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  overflow: hidden;
  background: var(--ole-cream);
}

/* Powder dust: fine motes suspended in soft light (motes are added by site.js). */
.dust {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* Fade in from the top so the light never ends in a hard line at the glass edge. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%);
  mask-image: linear-gradient(to bottom, transparent, #000 35%);
}

.dust__glow {
  position: absolute;
  width: 70vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.34), rgb(255 255 255 / 0));
  animation: glow 52s ease-in-out infinite alternate;
}

.dust__glow:nth-child(1) { left: -24vmax; top: -12vmax; }
.dust__glow:nth-child(2) { left: 52%; top: 18%; width: 56vmax; animation-duration: 64s; animation-delay: -20s; }
.dust__glow:nth-child(3) { left: -6%; top: 62%; width: 48vmax; animation-duration: 46s; animation-delay: -34s; }

@keyframes glow {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate3d(7vw, -5vh, 0) scale(1.12); opacity: 1; }
}

.dust__mote {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgb(255 251 246 / var(--a));
  opacity: 0;
  animation: float var(--d) linear var(--delay) infinite;
}

.dust__mote.is-soft { filter: blur(1.5px); }

@keyframes float {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translate3d(var(--dx), var(--dy), 0); opacity: 0; }
}

/* ---------- Join block ---------- */

.join {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 40rem;
  margin-block: auto;
  text-align: center;
}

.join__logo {
  width: clamp(84px, 9vw, 116px);
  height: auto;
  margin-bottom: clamp(1.25rem, 3.5vh, 2.25rem);
}

.join__eyebrow {
  margin-bottom: 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.join__title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.5rem, 1.1rem + 5.4vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.join__title em {
  display: block;
  font-style: italic;
}

.join__lede {
  max-width: 33ch;
  margin: 1.25rem auto 0;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.join__form {
  width: 100%;
  max-width: 34rem;
  margin-top: clamp(1.75rem, 4.5vh, 2.75rem);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.field input {
  width: 100%;
  min-height: 3.375rem;
  padding: 0 1.375rem;
  font: inherit;
  font-size: 1rem; /* ≥16px: no iOS zoom on focus */
  color: var(--ole-black);
  background: var(--ole-white);
  border: 1px solid rgb(45 45 45 / 0.22);
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
}

.field input::placeholder { color: rgb(45 45 45 / 0.72); }

.field input:focus-visible {
  outline: 2px solid var(--ole-blue);
  outline-offset: 2px;
}

.field input[aria-invalid="true"] { border-color: var(--ole-orange); }

.btn {
  position: relative;
  flex: none;
  min-height: 3.375rem;
  padding: 0 1.875rem;
  overflow: hidden;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ole-white);
  background: var(--ole-orange);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

/* Soft sheen that sweeps across the button on hover */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgb(255 255 255 / 0) 35%, rgb(255 255 255 / 0.28) 50%, rgb(255 255 255 / 0) 65%);
  transform: translateX(-110%);
  transition: transform 0.9s var(--ease-out);
}

.btn:hover { background: var(--ole-orange-deep); }
.btn:hover::after { transform: translateX(110%); }
.btn:active { transform: scale(0.98); }

.btn:focus-visible {
  outline: 2px solid var(--ole-blue);
  outline-offset: 3px;
}

.btn[aria-disabled="true"] { cursor: progress; }

.btn[aria-busy="true"] .btn__label {
  animation: breathe 1.2s ease-in-out infinite;
}

@keyframes breathe {
  50% { opacity: 0.55; }
}

@media (min-width: 600px) {
  .field {
    flex-direction: row;
    gap: 0;
    padding: 0.375rem;
    background: var(--ole-white);
    border-radius: 999px;
    box-shadow:
      0 18px 44px -20px rgb(45 45 45 / 0.32),
      inset 0 0 0 1px rgb(45 45 45 / 0.12);
    transition: box-shadow 0.3s var(--ease-out);
  }

  .field:focus-within {
    box-shadow:
      0 18px 44px -20px rgb(45 45 45 / 0.32),
      0 0 0 2px var(--ole-blue);
  }

  .field input {
    min-height: 3rem;
    border: 0;
    background: transparent;
  }

  .field input:focus-visible { outline: none; }

  .field:has(input[aria-invalid="true"]) {
    box-shadow:
      0 18px 44px -20px rgb(45 45 45 / 0.32),
      0 0 0 2px var(--ole-orange);
  }

  .btn { min-height: 3rem; }
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.join__consent {
  max-width: 46ch;
  margin: 1rem auto 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgb(45 45 45 / 0.85);
}

.join__consent a {
  color: inherit;
  text-underline-offset: 2px;
}

.join__consent a:focus-visible {
  outline: 2px solid var(--ole-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.join__status {
  min-height: 1.5em;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.join__status:empty { visibility: hidden; }

/* Success */
.join__form { transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out), transform 0.6s var(--ease-out); }

.join.is-dissolving .join__form {
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.97);
  pointer-events: none;
}

.join__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.75rem, 4.5vh, 2.75rem);
}

.join__done[hidden] { display: none; }

.done__mark {
  width: 3.25rem;
  height: 3.25rem;
  color: var(--ole-orange);
}

.done__mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 0.9s var(--ease-out) forwards; }
.done__mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.5s var(--ease-out) 0.55s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }

.done__title {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  line-height: 1.1;
  outline: none;
}

.done__text {
  margin-top: 0.5rem;
  font-size: 1rem;
}

.join__done > * { animation: surface 0.9s var(--ease-out) both; }
.join__done > :nth-child(2) { animation-delay: 0.15s; }
.join__done > :nth-child(3) { animation-delay: 0.3s; }

@keyframes surface {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
}

.particle {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

.sheen {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background: linear-gradient(100deg, rgb(255 255 255 / 0) 40%, rgb(255 255 255 / 0.55) 50%, rgb(255 255 255 / 0) 60%) 120% 0 / 250% 100% no-repeat;
}

.foot {
  position: relative;
  margin-top: 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;
  color: rgb(45 45 45 / 0.85);
}

/* Short viewports (laptops ≤ 760px tall, small phones): tighter rhythm so the whole
   block fits the pinned screen. */
@media (max-height: 760px) {
  .liquid__body { padding-top: clamp(1.25rem, 5vh, 2.5rem); }
  .join__logo { width: 80px; margin-bottom: 0.875rem; }
  .join__eyebrow { margin-bottom: 0.5rem; }
  .join__title { font-size: clamp(2rem, 7.4vh, 4rem); }
  .join__lede { margin-top: 0.75rem; font-size: 1rem; }
  .join__form { margin-top: 1.25rem; }
  .join__consent { margin-top: 0.625rem; }
  .join__status { margin-top: 0.375rem; }
  .join__done { margin-top: 1.25rem; }
  .foot { margin-top: 0.75rem; }
}

/* ---------- Scrolly mode (JS + motion allowed) ---------- */

.is-scrolly .scene { height: 260vh; height: 260svh; }

.is-scrolly .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.is-scrolly .film {
  position: absolute;
  inset: 0;
  height: auto;
}

.is-scrolly .film__video {
  transform: scale(calc(1 + var(--lp) * 0.14));
  transform-origin: 50% 40%;
}

.is-scrolly .liquid {
  position: absolute;
  inset: 0;
  transform: translate3d(0, calc((1 - var(--lp)) * (100% + var(--surface) * 0.44)), 0);
  will-change: transform;
}

.is-scrolly .liquid__body {
  height: 100%;
  min-height: 0;
  /* Never a nested scroller: it would swallow wheel/touch scrolling of the page. */
  overflow: hidden;
  background: none; /* the glass pane behind it is the surface */
}

/* The film runs behind the pane here → real frosted glass (where supported). */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .is-scrolly .glass__pane {
    -webkit-backdrop-filter: blur(40px) saturate(1.2);
    backdrop-filter: blur(40px) saturate(1.2);
    background:
      var(--glass-grain),
      linear-gradient(to bottom, rgb(255 255 255 / 0.18), rgb(255 255 255 / 0) calc(var(--surface) * 1.6)),
      /* Clear at the edge, dense under the form: the film is only a warm hint there. */
      linear-gradient(to bottom, rgb(246 232 222 / 0.6), rgb(246 232 222 / 0.9) calc(var(--surface) * 2.5), rgb(246 232 222 / 0.94));
  }
}

.is-scrolly .reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 1.1s var(--ease-out),
    filter 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.is-scrolly .reveal--1 { --i: 0; }
.is-scrolly .reveal--2 { --i: 1; }
.is-scrolly .reveal--3 { --i: 2; }
.is-scrolly .reveal--4 { --i: 3; }
.is-scrolly .reveal--5 { --i: 4; }
.is-scrolly .reveal--6 { --i: 6; }

.is-scrolly .is-filled .reveal {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .film__video { display: none; }
  .film__still { display: block; }
  .dust { display: none; }
  .cue__arrow,
  .glass__drift,
  .btn[aria-busy="true"] .btn__label,
  .join__done > *,
  .done__mark circle,
  .done__mark path { animation: none; }
  .done__mark circle,
  .done__mark path { stroke-dashoffset: 0; }
  .btn::after { display: none; }
}

/* Fallback pages (joined / oops / 404) */
.join__lede a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}

/* ---------- Legal page (privacy) ---------- */

.legal {
  max-width: 42rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) 3rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ole-black);
}

html:has(.legal),
html:has(.legal) body { background: var(--ole-cream); }

.legal__home { display: inline-block; margin-bottom: clamp(2rem, 5vh, 3rem); }
.legal__home img { width: 88px; height: auto; }

.legal__title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  line-height: 1.05;
}

.legal__meta {
  margin: 0.75rem 0 2rem;
  font-size: 0.875rem;
  color: rgb(45 45 45 / 0.85);
}

.legal h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal p + p { margin-top: 0.875rem; }

.legal a { color: inherit; text-underline-offset: 3px; }

.legal a:focus-visible {
  outline: 2px solid var(--ole-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.legal__back { margin-top: 3rem; font-weight: 700; }
