/* Shared tokens, typography and components (header controls, phone mockup, video player). */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --teal: #36d6c6;
  --teal-600: #2ac4b4;
  --teal-700: #20b2aa;
  --teal-ink: #0b5249;
  --turquoise: #40e0d0;
  --mint-50: #f1fcfa;
  --mint-100: #ddf7f1;
  --mint-150: #d8f7f1;
  --mint-200: #cdf3ea;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --line: rgb(17 24 39 / 0.08);
  --font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-md: 0 10px 30px -12px rgb(16 24 40 / 0.18);
  --shadow-lg: 0 24px 60px -20px rgb(16 24 40 / 0.28);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--gray-900);
  font-family: var(--font), var(--emoji);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgb(54 214 198 / 0.55);
  outline-offset: 2px;
}

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

.i {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Brand mark ---------- */

.logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 28%;
  background: linear-gradient(to right, #5fdfce, #36d6c6);
  box-shadow: 0 6px 16px -6px rgb(32 178 170 / 0.55);
  flex-shrink: 0;
}

.logo svg {
  width: 65%;
  height: 65%;
}

/* ---------- Segmented controls (view switch, language) ---------- */

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--gray-100);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented button:hover {
  background: var(--gray-200);
}

/* Selected state is a turquoise frame on white, so the waitlist button stays
   the only solid turquoise control on the page. */
.segmented button[aria-pressed='true'] {
  background: #fff;
  color: #0e7a6a;
  box-shadow: inset 0 0 0 2px var(--teal), 0 4px 12px -6px rgb(32 178 170 / 0.5);
}

.segmented--lang button {
  padding: 8px 14px;
  font-size: 13px;
}

/* ---------- Phone mockup ----------
   All inner sizes are in em; the phone's font-size is derived from its width, so one
   component renders at any size (hero, deck canvas) without transforms. */

.phone {
  --w: 260px;
  position: relative;
  width: var(--w);
  aspect-ratio: 260 / 536;
  font-size: calc(var(--w) / 26);
  flex-shrink: 0;
}

.phone::before {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 3em;
  background: linear-gradient(135deg, rgb(54 214 198 / 0.45), rgb(42 196 180 / 0.35));
  filter: blur(2.6em);
  z-index: -1;
}

.phone__frame {
  position: absolute;
  inset: 0;
  border-radius: 4.2em;
  padding: 0.75em;
  background: linear-gradient(145deg, #2a3038, #0b0e12 40%, #1b2027);
  box-shadow: inset 0 0 0 0.12em #3a414b, var(--shadow-lg);
}

.phone__screen {
  position: relative;
  height: 100%;
  border-radius: 3.5em;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, #3fe0cf 0%, #2ac4b4 55%, #22b3a5 100%);
  color: #fff;
}

.phone__island {
  position: absolute;
  top: 1.1em;
  left: 50%;
  translate: -50% 0;
  width: 8.6em;
  height: 2.5em;
  border-radius: 999px;
  background: #05070a;
  z-index: 5;
}

.phone__status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.55em 2.4em 0 2.9em;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.phone__status-icons {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.phone__status-icons svg {
  height: 0.85em;
  width: auto;
}

.phone__clock {
  margin-top: 3.4em;
  text-align: center;
}

.phone__time {
  font-size: 5.6em;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
}

.phone__date {
  margin-top: 0.5em;
  font-size: 1.25em;
  font-weight: 500;
  opacity: 0.85;
}

.notif {
  margin: 2.6em 1.3em 0;
  text-align: left;
  padding: 1.2em;
  border-radius: 2em;
  background: rgb(255 255 255 / 0.96);
  color: var(--gray-900);
  box-shadow: 0 1.6em 3em -1.2em rgb(4 60 55 / 0.55);
  backdrop-filter: blur(20px);
}

.notif__head {
  display: flex;
  align-items: center;
  gap: 0.9em;
}

.notif__avatar {
  width: 3.4em;
  height: 3.4em;
  border-radius: 0.9em;
  object-fit: cover;
}

.notif__app {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.notif__name {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-size: 1.4em;
  font-weight: 700;
}

.notif__name small {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--gray-500);
}

.notif__via {
  font-size: 1.15em;
  color: var(--gray-500);
}

.notif__title {
  margin-top: 0.75em;
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1.3;
}

.notif__body {
  margin-top: 0.35em;
  font-size: 1.2em;
  line-height: 1.4;
  color: var(--gray-700);
}

.notif__image {
  margin-top: 0.9em;
  width: 100%;
  height: 9em;
  border-radius: 1.2em;
  object-fit: cover;
}

.phone__unlock {
  position: absolute;
  left: 50%;
  bottom: 3.4em;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 1.4em;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.35);
  background: rgb(255 255 255 / 0.18);
  backdrop-filter: blur(6px);
  font-size: 1.05em;
  font-weight: 600;
  white-space: nowrap;
}

.phone__unlock .i {
  width: 1.1em;
  height: 1.1em;
}

.phone__home {
  position: absolute;
  left: 50%;
  bottom: 1.1em;
  translate: -50% 0;
  width: 11em;
  height: 0.45em;
  border-radius: 999px;
  background: #fff;
  z-index: 4;
}

/* The notification "arrives" on load and again after the video ends. */
.phone[data-arrive] .notif {
  animation: notif-in 0.9s var(--ease-out) both;
  animation-delay: 0.35s;
}

@keyframes notif-in {
  from {
    opacity: 0;
    transform: translateY(-2.4em) scale(0.94);
  }
}

/* ---------- Video player inside the phone ---------- */

.phone__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b0e12;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  z-index: 2;
}

.phone[data-state='playing'] .phone__video,
.phone[data-state='paused'] .phone__video {
  opacity: 1;
}

.phone__hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  cursor: pointer;
}

.phone__hit:focus-visible {
  outline-offset: -4px;
}

/* Hover hint on the idle lock screen: the whole screen is a play button. */
.phone__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(6 40 37 / 0.28);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 3;
}

.phone__hint span {
  display: grid;
  place-items: center;
  width: 6.4em;
  height: 6.4em;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.95);
  color: var(--teal-700);
  box-shadow: var(--shadow-lg);
}

.phone__hint .i {
  width: 2.6em;
  height: 2.6em;
  margin-left: 0.3em;
  fill: currentColor;
}

@media (hover: hover) {
  .phone[data-state='idle']:not([data-buffering]) .phone__hit:hover ~ .phone__hint {
    opacity: 1;
  }
}

.phone[data-state='paused'] .phone__hint {
  opacity: 1;
}

.phone__controls {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.phone[data-state='playing'] .phone__controls,
.phone[data-state='paused'] .phone__controls {
  opacity: 1;
}

.phone__controls button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.4em;
  height: 3.4em;
  border-radius: 50%;
  background: rgb(10 14 18 / 0.55);
  color: #fff;
  backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: background-color 0.2s, transform 0.2s;
}

.phone__controls button:hover {
  background: rgb(10 14 18 / 0.75);
  transform: scale(1.06);
}

.phone__controls .i {
  width: 1.6em;
  height: 1.6em;
}

.phone__mute,
.phone__close {
  bottom: 3.3em;
}

.phone__mute {
  left: 1.6em;
}

.phone__close {
  left: 5.6em;
}

.phone__mute .i-on,
.phone[data-muted] .phone__mute .i-off {
  display: block;
}

.phone__mute .i-off,
.phone[data-muted] .phone__mute .i-on {
  display: none;
}

.phone__progress {
  position: absolute;
  left: 10.2em;
  right: 2.2em;
  bottom: 4.85em;
  height: 0.4em;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.35);
  overflow: hidden;
}

/* Touch screens: controls grow to a finger-sized target (about 44px on the hero phone). */
@media (pointer: coarse) {
  .phone__controls button {
    width: 4.4em;
    height: 4.4em;
  }
  .phone__controls .i {
    width: 1.9em;
    height: 1.9em;
  }
  .phone__mute {
    left: 1.4em;
  }
  .phone__close {
    left: 6.6em;
  }
  .phone__progress {
    left: 12em;
    bottom: 5.3em;
  }
  .phone--film .phone__progress {
    bottom: 3.6em;
  }
}

.phone__progress span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #fff;
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

.phone__spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.4em;
  height: 4.4em;
  margin: -2.2em 0 0 -2.2em;
  border-radius: 50%;
  border: 0.42em solid rgb(255 255 255 / 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  z-index: 4;
  display: none;
}

.phone[data-buffering] .phone__spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Poster variant (deck slide 2): the idle screen is the film's first frame. */
.phone__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone--film {
  aspect-ratio: 9 / 16;
}

.phone--film .phone__frame {
  padding: 0.55em;
  border-radius: 3em;
  background: var(--teal);
  box-shadow: 0 2em 4em -2em rgb(8 90 80 / 0.45);
}

.phone--film .phone__screen {
  border-radius: 2.6em;
}

.phone--film .phone__hint {
  opacity: 1;
  background: rgb(6 40 37 / 0.18);
}

.phone--film[data-state='playing'] .phone__hint {
  opacity: 0;
}

.phone--film .phone__mute,
.phone--film .phone__close {
  bottom: 1.6em;
}

.phone--film .phone__progress {
  bottom: 3.1em;
}

/* ---------- "Play the film" call-to-action next to a phone ---------- */

.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px 12px 12px;
  border-radius: 22px;
  background: rgb(255 255 255 / 0.92);
  border: 1px solid rgb(54 214 198 / 0.35);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  text-align: left;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
}

.play-cta:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 18px 40px -16px rgb(32 178 170 / 0.55);
}

.play-cta__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: #fff;
  color: #13a294;
  flex-shrink: 0;
}

.play-cta__icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgb(54 214 198 / 0.55);
  animation: ping 2.2s var(--ease-out) infinite;
}

.play-cta[data-state='playing'] .play-cta__icon::after {
  animation: none;
  opacity: 0;
}

@keyframes ping {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  80%,
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.play-cta__icon .i {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.play-cta__icon .i-play {
  margin-left: 3px;
}

.play-cta__label,
.play-cta__meta {
  white-space: nowrap;
}

.play-cta__label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.25;
}

.play-cta__meta {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

/* Each state shows its own label; data-state is mirrored from the phone by the player. */
.play-cta [data-when] {
  display: none;
}

.play-cta[data-state='idle'] [data-when~='idle'],
.play-cta[data-state='playing'] [data-when~='playing'],
.play-cta[data-state='paused'] [data-when~='paused'] {
  display: block;
}

.play-cta .i[data-when] {
  display: none;
}

.play-cta[data-state='idle'] .i[data-when~='idle'],
.play-cta[data-state='playing'] .i[data-when~='playing'],
.play-cta[data-state='paused'] .i[data-when~='paused'] {
  display: block;
}

/* ---------- Entrance animations ---------- */

/* Above the fold: plays on load without waiting for JS. */
.rise {
  animation: rise 0.8s var(--ease-out) both;
  animation-delay: var(--delay, 0s);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* Below the fold: revealed on scroll (only when JS runs). */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
