/* ==========================================================
   Ternastra — shared styles
   "Stars in threes": one studio, three arms (films, games, apps)
   Brand: deep space #04060d · electric blue #4c8dff · ice #8fd3ff
   Look: dark glass over a live starfield, planets, fluid motion
   ========================================================== */

:root {
  --ink: #04060d;
  --ink-2: #0a0f1f;
  --ink-3: #121a33;
  --paper: #eef3ff;      /* starlight: light fills on dark */
  --accent: #4c8dff;     /* electric blue */
  --accent-2: #8fd3ff;   /* ice blue */
  --violet: #7b6bff;     /* nebula */
  --accent-soft: rgba(76, 141, 255, 0.14);
  --love: #eaa3b8;       /* thanks page */
  --text: #e8eeff;
  --text-dim: #98a6c6;
  --text-mute: #5d6987;
  --line: rgba(170, 195, 255, 0.1);
  --line-strong: rgba(170, 195, 255, 0.2);

  /* a four-point star, used for bullets and markers */
  --star: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);

  /* glass */
  --glass: linear-gradient(160deg, rgba(140, 170, 255, 0.09), rgba(140, 170, 255, 0.02));
  --glass-flat: rgba(8, 12, 26, 0.62);
  --glass-border: rgba(160, 190, 255, 0.13);
  --glass-hi: inset 0 1px 0 rgba(200, 220, 255, 0.1);
  --glass-blur: blur(18px) saturate(150%);

  --font: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

/* Lenis smooth scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain over everything, very faint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.05; letter-spacing: -0.03em; }

::selection { background: var(--accent); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Ambient light (sits behind everything) ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.ambient i {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  will-change: transform;
}
.ambient i:nth-child(1) {
  background: radial-gradient(circle, var(--accent), transparent 65%);
  top: -25vmax;
  left: -15vmax;
  animation: drift-a 26s ease-in-out infinite alternate;
}
.ambient i:nth-child(2) {
  background: radial-gradient(circle, var(--violet), transparent 65%);
  top: 30vh;
  right: -25vmax;
  opacity: 0.16;
  animation: drift-b 32s ease-in-out infinite alternate;
}
.ambient i:nth-child(3) {
  background: radial-gradient(circle, #1fb6ff, transparent 65%);
  bottom: -30vmax;
  left: 20vw;
  opacity: 0.1;
  animation: drift-c 28s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(18vw, 22vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-22vw, -18vh) scale(0.9); } }
@keyframes drift-c { to { transform: translate(-14vw, -26vh) scale(1.1); } }

/* live starfield (drawn by JS on a canvas) */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  /* the tallest the viewport gets (phone address bar hidden), so the sky keeps one size
     while the browser bar slides in and out and the stars never get re-scattered */
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
}

/* ---------- Scroll progress, cursor ---------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 80;
  background: linear-gradient(90deg, var(--violet), var(--accent), var(--accent-2));
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

.cursor,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
}
.cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent-2); box-shadow: 0 0 10px 2px rgba(143, 211, 255, 0.7); }
.cursor-ring {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid rgba(220, 230, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.45s var(--ease-out), height 0.45s var(--ease-out), margin 0.45s var(--ease-out),
    background 0.3s, border-color 0.3s, opacity 0.3s;
}
.cursor-ring span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.25s;
}
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(220, 230, 255, 0.08);
  border-color: rgba(220, 230, 255, 0.5);
  backdrop-filter: blur(3px);
}
.cursor-ring.has-label {
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  background: var(--paper);
  border-color: var(--paper);
}
.cursor-ring.has-label span { opacity: 1; }
.cursor-ring.is-down { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
/* a labelled ring squeezes a little on press instead of collapsing and hiding its label */
.cursor-ring.has-label.is-down { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
.cursor-hidden .cursor,
.cursor-hidden .cursor-ring { opacity: 0; }
html.has-cursor,
html.has-cursor a,
html.has-cursor button { cursor: none; }

/* ---------- First-visit intro ---------- */

html.intro::after {
  /* covers the page until the intro element is built */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--ink);
}
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: transform 1.1s var(--ease-out), border-radius 1.1s var(--ease-out);
}
.loader__logo {
  width: min(300px, 72vw);
  height: auto;
  opacity: 0;
  scale: 0.9;
  filter: blur(8px);
  animation: loader-logo 1.1s var(--ease-out) 0.15s forwards;
}
@keyframes loader-logo { to { opacity: 1; scale: 1; filter: blur(0); } }
.loader__bar {
  width: min(240px, 60vw);
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.loader__bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  animation: loader-bar 1.1s var(--ease-out) 0.1s forwards;
}
@keyframes loader-bar { to { transform: scaleX(1); } }
.loader.is-done { transform: translateY(-100%); border-radius: 0 0 50% 50% / 0 0 18vh 18vh; }

/* ---------- Page transitions (Chrome, Edge, Safari) ---------- */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out 0.45s var(--ease-in) both; }
::view-transition-new(root) { animation: page-in 0.8s var(--ease-out) both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-24px) scale(0.985); filter: blur(6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(36px); filter: blur(6px); } }

/* fallback for browsers without them */
html.is-leaving body { opacity: 0; transform: translateY(-16px); transition: opacity 0.35s var(--ease-in), transform 0.35s var(--ease-in); }

/* ---------- Small brand pieces ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.eyebrow::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--accent-2);
  clip-path: var(--star);
  flex: none;
}

.accent,
.accent .wi { /* the split-headline words carry the gradient themselves */
  background: linear-gradient(100deg, var(--accent-2), var(--accent) 55%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.tag:hover { border-color: var(--line-strong); color: var(--text); }
.tag--accent { border-color: rgba(143, 211, 255, 0.55); color: var(--accent-2); background: var(--accent-soft); }

/* ---------- Buttons: magnetic (via JS), with a fill that grows from the cursor ---------- */

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.6s var(--ease-out), color 0.4s var(--ease-out),
    border-color 0.4s, box-shadow 0.4s;
}
.btn::before {
  content: "";
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 260%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.7s var(--ease-out);
  z-index: -1;
}
.btn:hover::before { transform: translate(-50%, -50%) scale(1); }
.btn:active { transition-duration: 0.15s; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #030614;
  box-shadow: 0 8px 30px -8px rgba(76, 141, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn--primary::before { background: var(--paper); }
.btn--primary:hover { box-shadow: 0 14px 40px -10px rgba(76, 141, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

.btn--ghost {
  color: var(--text);
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi);
}
.btn--ghost::before { background: var(--accent); }
.btn--ghost:hover { color: #030614; border-color: var(--accent); }

.btn .arrow { transition: transform 0.5s var(--spring); }
.btn:hover .arrow { transform: translateX(5px); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Header: floating glass pill ---------- */

.site-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0 var(--gutter);
  pointer-events: none;
  transition: transform 0.7s var(--ease-out);
}
.site-header.is-hidden { transform: translateY(calc(-100% - 20px)); }
.nav.wrap {
  position: relative;
  max-width: calc(var(--wrap) - 2 * var(--gutter));
  height: 64px;
  padding: 0 8px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 999px;
  pointer-events: auto;
}
.nav::before {
  /* the glass lives on a pseudo-element so the mobile menu can be position: fixed */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--glass-flat);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), 0 12px 40px -12px rgba(0, 0, 0, 0.5);
}
.nav__logo { position: relative; z-index: 2; display: block; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__logo { display: block; height: 40px; width: auto; flex: none; transition: transform 0.6s var(--spring), filter 0.6s var(--ease-out); }
.brand:hover .brand__logo { transform: scale(1.04); filter: drop-shadow(0 0 14px rgba(143, 211, 255, 0.45)); }
.nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}
.nav__links a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--text-dim);
  transition: color 0.3s;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--text); }
.nav__pill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 38px;
  margin-top: -19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition:
    transform 0.55s var(--spring), width 0.55s var(--spring), opacity 0.3s;
}
.nav__pill.is-on { opacity: 1; }
.nav__links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  background: var(--accent-2);
  clip-path: var(--star);
}
.nav__cta { padding: 11px 20px; font-size: 15px; position: relative; z-index: 2; }
.nav__end { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; }

/* Sound on/off: a little equalizer that goes flat when muted */
.sound-toggle {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.5s var(--spring);
}
.sound-toggle:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.sound-toggle:active { transform: scale(0.9); }
.sound-toggle__bars { display: flex; align-items: center; gap: 2.5px; height: 16px; }
.sound-toggle__bars i {
  display: block;
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 50% 50%;
  animation: eq 0.9s ease-in-out infinite alternate;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}
.sound-toggle__bars i:nth-child(1) { animation-duration: 0.7s; }
.sound-toggle__bars i:nth-child(2) { animation-duration: 1.1s; animation-delay: -0.4s; background: var(--accent-2); }
.sound-toggle__bars i:nth-child(3) { animation-duration: 0.8s; animation-delay: -0.2s; }
.sound-toggle__bars i:nth-child(4) { animation-duration: 1s; animation-delay: -0.6s; }
@keyframes eq {
  from { transform: scaleY(0.25); }
  to { transform: scaleY(1); }
}
.sound-toggle.is-off .sound-toggle__bars i { animation: none; transform: scaleY(0.15); opacity: 0.5; }

.nav__toggle {
  position: relative;
  z-index: 2;
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s var(--ease-out), background 0.3s;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
  transition: transform 0.5s var(--spring), background 0.2s;
}
.nav__toggle span::before,
.nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav-open .nav__toggle span { background: transparent; }
.nav-open .nav__toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav__toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav.wrap { height: 60px; padding: 0 6px 0 18px; }
  .nav__toggle { display: inline-flex; }
  .nav__cta { display: none; }
  .nav__pill { display: none; }
  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 100px var(--gutter) 40px;
    background: rgba(4, 6, 14, 0.8);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    font-size: clamp(40px, 12vw, 56px);
    font-weight: 500;
    letter-spacing: -0.03em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease-out), visibility 0s 0.5s;
  }
  .nav__links li {
    overflow: hidden;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.7s var(--ease-out), opacity 0.5s;
  }
  .nav__links a { padding: 4px 0; color: var(--text); }
  .nav__links a[aria-current="page"] { color: var(--accent-2); }
  .nav__links a[aria-current="page"]::after { display: none; }
  .nav-open .nav__links { opacity: 1; visibility: visible; transition: opacity 0.5s var(--ease-out); }
  .nav-open .nav__links li { transform: none; opacity: 1; }
  .nav-open .nav__links li:nth-child(1) { transition-delay: 0.08s; }
  .nav-open .nav__links li:nth-child(2) { transition-delay: 0.14s; }
  .nav-open .nav__links li:nth-child(3) { transition-delay: 0.2s; }
  .nav-open .nav__links li:nth-child(4) { transition-delay: 0.26s; }
  .nav-open .nav__links li:nth-child(5) { transition-delay: 0.32s; }
  .nav-open .nav__links li:nth-child(6) { transition-delay: 0.38s; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 140px 0 100px;
  overflow: hidden;
  isolation: isolate;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero .eyebrow,
.page-hero .lockup {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi);
}
.hero h1 {
  font-size: clamp(48px, 8.4vw, 120px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 26px 0 30px;
}
.hero h1 .line { display: block; }
.hero__lead {
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 38px;
}
.hero__lead--tight { margin-bottom: 16px; }
/* a quieter line under the description: smaller and dimmer, with a small star in front */
.hero__note {
  position: relative;
  max-width: 520px;
  margin: 0 0 38px;
  padding-left: 22px;
  font-size: clamp(14px, 1.2vw, 15.5px);
  line-height: 1.6;
  color: #7f8cab; /* a step quieter than the description, still easy to read */
}
.hero__note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 11px;
  height: 11px;
  background: var(--accent-2);
  opacity: 0.8;
  clip-path: var(--star);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__mark {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 460px;
  justify-self: end;
  perspective: 900px;
}
.hero__mark .world { position: absolute; inset: 0; --size: 100%; }
.hero__mark .mark-tilt {
  position: absolute;
  left: 4%;
  top: 0;
  z-index: 3;
  width: 52%;
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transition: transform 1s var(--ease-out);
}
.hero__mark .mark-tilt img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(143, 211, 255, 0.3));
  animation: float 7s ease-in-out infinite;
}
.hero__mark::before {
  content: "";
  position: absolute;
  inset: 12%;
  background: radial-gradient(circle, rgba(76, 141, 255, 0.4), rgba(123, 107, 255, 0.15) 45%, transparent 68%);
  filter: blur(40px);
  z-index: -1;
  animation: glow 5s ease-in-out infinite alternate;
}
.hero__mark::after {
  /* slow orbit ring */
  content: "";
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  border: 1px dashed rgba(220, 230, 255, 0.12);
  animation: spin 60s linear infinite;
}
@keyframes float {
  /* uses `translate` so it sits outside the spin (`rotate`) and the click squash (`transform`) */
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -16px; }
}
/* the glow and orbit ring are decoration: clicks and hovers go straight through to the logo */
.hero__mark::before,
.hero__mark::after { pointer-events: none; }
.mark-tilt {
  cursor: pointer;
  /* spam-clicking it should never select, drag, zoom or flash */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mark-tilt img { -webkit-user-drag: none; pointer-events: none; }
.mark-tilt.is-pop img { animation: mark-pop 0.7s var(--spring), float 7s ease-in-out 0.7s infinite; }
@keyframes mark-pop {
  /* a quick squash on each click; the spin itself comes from JS */
  0% { transform: scale(1); }
  30% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
@keyframes glow { to { opacity: 0.6; transform: scale(1.1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* decorative layer behind the hero content */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero__scroll::after {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent-2);
  clip-path: var(--star);
  animation: drop 1.8s ease-in-out infinite;
}
@keyframes drop {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(18px); opacity: 0; }
}

@media (max-width: 860px) {
  .hero { min-height: auto; padding: 120px 0 80px; }
  .hero__grid { grid-template-columns: 1fr; gap: 20px; }
  .hero__mark { order: -1; max-width: 240px; justify-self: start; }
  .hero__scroll { display: none; }
}

/* ---------- Page hero (division pages) ---------- */

.page-hero {
  position: relative;
  padding: 180px 0 100px;
  overflow: hidden;
  isolation: isolate;
}
.page-hero h1 {
  font-size: clamp(44px, 7.4vw, 104px);
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 26px 0 28px;
  max-width: 14ch;
}
.page-hero .hero__lead { max-width: 640px; }
.page-hero .hero__bg .world {
  position: absolute;
  right: -6%;
  top: 50%;
  translate: 0 -50%;
  --size: min(560px, 58vw);
  opacity: 0.6;
}
@media (max-width: 760px) {
  .page-hero .hero__bg .world { right: -38%; opacity: 0.35; }
}
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.lockup .brand__logo { height: 34px; }
.lockup__name {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

/* ---------- Sections ---------- */

.section { padding: clamp(80px, 11vw, 150px) 0; position: relative; }
.section--paper {
  /* a midnight-blue panel floating in space */
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(76, 141, 255, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(12, 20, 50, 0.82), rgba(6, 10, 26, 0.9));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), 0 40px 100px -60px rgba(0, 0, 0, 0.9);
  margin: 0 clamp(8px, 1.4vw, 20px);
  border-radius: clamp(26px, 3vw, 44px);
}
.section--line { border-top: 1px solid var(--line); }

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: clamp(40px, 6vw, 72px);
  flex-wrap: wrap;
}
.section__head h2 {
  font-size: clamp(38px, 5.4vw, 72px);
  letter-spacing: -0.035em;
  margin-top: 18px;
  max-width: 16ch;
}
.section__head p { max-width: 440px; color: var(--text-dim); margin: 0; }

.text-dim { color: var(--text-dim); }

/* ---------- Glass surfaces with a cursor spotlight + tilt (via JS) ---------- */

.division,
.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), 0 20px 50px -30px rgba(0, 0, 0, 0.6);
}
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(76, 141, 255, 0.16), transparent 45%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.spot:hover::after { opacity: 1; }
.tilt {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.9s var(--ease-out), border-color 0.4s;
}
.tilt.is-tilting { transition: transform 0.25s var(--ease-out), border-color 0.4s; }

/* ---------- Division cards (home) ---------- */

.divisions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.division {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding: 32px;
}
.division:hover { border-color: rgba(76, 141, 255, 0.45); }
.division__num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
}
.division__art {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 28px;
  height: 180px;
  transition: transform 0.8s var(--ease-out);
}
.division:hover .division__art { transform: scale(1.06) translateY(-4px); }
.division h3 { font-size: 34px; margin-bottom: 10px; }
.division h3 { font-size: 28px; }
.division h3 span { color: var(--text-mute); font-weight: 400; }
.division p { color: var(--text-dim); font-size: 16px; margin-bottom: 20px; }
.division__list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.division__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  font-weight: 500;
  margin-top: auto;
}
.division__link .arrow { transition: transform 0.5s var(--spring); }
.division:hover .division__link .arrow { transform: translateX(6px); }

/* ---------- Planets (hero, division cards, page heroes) ---------- */

.world {
  --size: 160px;
  position: relative;
  width: var(--size);
  aspect-ratio: 1;
  flex: none;
}
.world__planet {
  position: absolute;
  inset: 20%;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--planet);
  box-shadow:
    inset -14px -12px 34px rgba(0, 0, 0, 0.7),
    inset 6px 6px 18px rgba(255, 255, 255, 0.12),
    0 0 50px var(--halo);
}
.world__planet::before {
  /* cloud bands drifting across the surface, so it reads as turning */
  content: "";
  position: absolute;
  inset: -10% -100%;
  background: repeating-linear-gradient(170deg,
    transparent 0 9%, rgba(255, 255, 255, 0.09) 9% 13%, transparent 13% 21%, rgba(0, 0, 0, 0.12) 21% 24%);
  animation: bands 26s linear infinite;
}
.world__planet::after {
  /* night side */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, transparent 38%, rgba(2, 4, 12, 0.72) 78%);
}
@keyframes bands { to { translate: 50% 0; } }
.world__ring {
  position: absolute;
  left: 2%;
  right: 2%;
  top: 41%;
  height: 18%;
  border-radius: 50%;
  border: 2px solid rgba(180, 215, 255, 0.5);
  box-shadow: 0 0 14px rgba(143, 211, 255, 0.35), inset 0 0 10px rgba(143, 211, 255, 0.25);
  rotate: -16deg;
}
.world__ring--back { z-index: 0; }
.world__ring--front { z-index: 2; clip-path: inset(50% 0 0 0); }
.world__orbit {
  position: absolute;
  inset: 4%;
  z-index: 2;
  border-radius: 50%;
  border: 1px dashed rgba(170, 200, 255, 0.22);
  animation: spin 9s linear infinite;
}
.world__orbit--2 { inset: 12%; animation-duration: 6s; animation-direction: reverse; }
.world__moon,
.world__sat {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #a9c8ff);
  box-shadow: 0 0 12px rgba(160, 200, 255, 0.9);
}
.world__orbit--2 .world__moon { width: 7px; height: 7px; top: -3.5px; margin-left: -3.5px; }
.world__sat {
  width: 16px;
  height: 6px;
  top: -3px;
  margin-left: -8px;
  border-radius: 2px;
  background: linear-gradient(90deg, #8fd3ff 0 35%, #e8eeff 35% 65%, #8fd3ff 65%);
}
.world--hero {
  --planet: radial-gradient(circle at 30% 26%, #d6eaff 0%, #6aa2ff 15%, #2a52d6 40%, #0d1a5c 70%, #040818 100%);
  --halo: rgba(76, 141, 255, 0.45);
}
.world--hero .world__planet { inset: 26% 4% 4% 26%; } /* a 70% square, lower right */
.world--hero .world__ring { left: 12%; right: -10%; top: 52%; }
.world--films {
  --planet: radial-gradient(circle at 30% 28%, #ecf7ff 0%, #8fd3ff 20%, #3a7bd5 52%, #0b1b4a 82%);
  --halo: rgba(143, 211, 255, 0.4);
}
.world--games {
  --planet: radial-gradient(circle at 30% 28%, #ece6ff 0%, #a597ff 20%, #4a3fb8 52%, #120c3f 84%);
  --halo: rgba(123, 107, 255, 0.45);
}
.world--apps {
  --planet: radial-gradient(circle at 30% 28%, #e2fdff 0%, #6fe0ff 20%, #1c7fb0 52%, #06223d 84%);
  --halo: rgba(80, 210, 255, 0.4);
}
.division:hover .world__orbit { animation-duration: 3s; }
.division:hover .world__orbit--2 { animation-duration: 2s; }

@media (max-width: 960px) {
  .divisions { grid-template-columns: 1fr; }
  .division { min-height: 0; }
}

/* ---------- Why Ternastra (the name) ---------- */

.name__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  margin-bottom: clamp(48px, 7vw, 88px);
}
.name h2 {
  font-size: clamp(54px, 10vw, 150px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-top: 20px;
}
.name h2 .syl { color: var(--text-mute); font-weight: 300; }
.name__say {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--accent-2);
}
.name__sum {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.name__part {
  padding: 26px 22px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi);
  text-align: center;
}
.name__part b { display: block; font-size: clamp(30px, 3.6vw, 46px); font-weight: 500; letter-spacing: -0.02em; font-style: italic; }
.name__part span { display: block; margin-top: 8px; font-size: 14px; color: var(--text-dim); }
.name__op { font-size: 28px; color: var(--text-mute); font-weight: 300; }
.name__eq {
  grid-column: 1 / -1;
  margin-top: 6px;
  text-align: center;
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -0.02em;
}
.name__eq span { color: var(--text-mute); margin-right: 10px; }
.name__line { margin-top: clamp(40px, 6vw, 72px); max-width: 760px; font-size: clamp(18px, 1.7vw, 22px); color: var(--text-dim); }
.card__icon .stars { display: flex; gap: 3px; }
.card__icon .stars i { width: 10px; height: 10px; background: currentColor; clip-path: var(--star); }
@media (max-width: 860px) {
  .name__grid { grid-template-columns: 1fr; }
}

/* ---------- Project features ---------- */

.feature {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.feature + .feature { margin-top: clamp(90px, 11vw, 150px); }
.feature--flip .feature__media { order: 2; }
.feature__media {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--glass-border);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
}
.feature__body h3 { font-size: clamp(38px, 4.8vw, 64px); letter-spacing: -0.03em; margin: 18px 0 18px; }
.feature__body p { color: var(--text-dim); }
.feature__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 30px; }


@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature--flip .feature__media { order: 0; }
}

/* Key art: a real image with the title over a fade */
.key-art { position: absolute; inset: 0; background: #04060d; overflow: hidden; }
.key-art img {
  /* taller than its box so parallax never shows an edge */
  position: absolute;
  top: -7.5%;
  left: 0;
  width: 100%;
  height: 115%;
  object-fit: cover;
  transition: transform 1.6s var(--ease-out);
}
.feature:hover .key-art img,
.wide-art:hover .key-art img { transform: scale(1.05); }
.key-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 6, 14, 0.9));
}
.key-art__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  z-index: 1;
  text-align: center;
  font-size: clamp(24px, 3.6vw, 52px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: #eef3ff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.key-art__title small {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: rgba(238, 243, 255, 0.7);
}

.wide-art {
  position: relative;
  isolation: isolate;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}
.wide-art .key-art__title { font-size: clamp(28px, 5.4vw, 76px); }
@media (max-width: 760px) { .wide-art { aspect-ratio: 16 / 10; } }

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(24px, 5vw, 72px);
  margin: clamp(40px, 6vw, 64px) 0 clamp(40px, 6vw, 64px);
}
.split h2 { font-size: clamp(42px, 6.4vw, 88px); letter-spacing: -0.04em; margin-top: 18px; }
.split p { color: var(--text-dim); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  transition: transform 0.9s var(--ease-out), filter 0.6s;
}
.gallery:hover img { filter: brightness(0.6) saturate(0.8); }
.gallery img:hover { filter: none; transform: scale(1.03); }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

/* Phone screenshots */
.shot {
  flex: none;
  aspect-ratio: 9 / 19;
  border-radius: 24px;
  border: 5px solid #05070f;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.fan {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  /* deep space: a dark navy sky with a soft blue nebula and a violet glow, like the rest of the site */
  background:
    radial-gradient(60% 55% at 22% 12%, rgba(76, 141, 255, 0.34), transparent 70%),
    radial-gradient(55% 55% at 85% 95%, rgba(123, 107, 255, 0.3), transparent 70%),
    linear-gradient(165deg, #0b1535 0%, #070d24 55%, #04060d 100%);
}
/* a faint field of stars behind the phones */
.fan::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 28% 78%, rgba(200, 220, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 46% 14%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 64% 86%, rgba(200, 220, 255, 0.7), transparent),
    radial-gradient(1px 1px at 78% 24%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 90% 58%, rgba(200, 220, 255, 0.8), transparent),
    radial-gradient(1px 1px at 6% 60%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 38% 50%, rgba(200, 220, 255, 0.5), transparent),
    radial-gradient(1px 1px at 72% 62%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 55% 40%, rgba(200, 220, 255, 0.5), transparent);
}
/* a soft pool of light under the phones */
.fan::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -6%;
  height: 34%;
  z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(76, 141, 255, 0.28), transparent 70%);
  filter: blur(14px);
}
.fan .shot {
  height: 84%;
  transition: transform 0.9s var(--spring);
  border-color: #0a1022;
  box-shadow: 0 0 0 1px rgba(160, 190, 255, 0.16), 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px -10px rgba(76, 141, 255, 0.35);
}
.fan .shot:nth-child(1) { transform: translateX(34%) rotate(-9deg) scale(0.86); }
.fan .shot:nth-child(2) { position: relative; z-index: 2; }
.fan .shot:nth-child(3) { transform: translateX(-34%) rotate(9deg) scale(0.86); }
.feature:hover .fan .shot:nth-child(1) { transform: translateX(22%) rotate(-14deg) scale(0.88); }
.feature:hover .fan .shot:nth-child(2) { transform: translateY(-10px) scale(1.03); }
.feature:hover .fan .shot:nth-child(3) { transform: translateX(-22%) rotate(14deg) scale(0.88); }

.screens {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 32px);
}
.screens figure { margin: 0; text-align: center; }
.screens .shot { width: min(250px, 40vw); transition: transform 0.9s var(--spring); }
.screens figure:hover .shot { transform: translateY(-10px) rotate(-1.5deg); }
.screens figure:nth-child(2):hover .shot { transform: translateY(-10px) rotate(1.5deg); }
.screens figcaption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Store stats */
.stats { display: flex; flex-wrap: wrap; gap: 32px; margin: 4px 0 28px; }
.stats b { display: block; font-size: 32px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* ---------- Services list ---------- */

.services {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.services li {
  position: relative;
  display: grid;
  grid-template-columns: 70px 1fr 1.2fr 120px;
  gap: 24px;
  align-items: baseline;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.6s var(--ease-out), color 0.4s;
}
.services li::before {
  /* blue wash that slides in on hover */
  content: "";
  position: absolute;
  inset: 0 -16px;
  z-index: -1;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(76, 141, 255, 0.1), rgba(76, 141, 255, 0));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.7s var(--ease-out);
}
.services { position: relative; isolation: isolate; }
.services li:hover { padding-left: 16px; }
.services li:hover::before { transform: scaleX(1); }
.services__num { font-family: var(--mono); font-size: 13px; color: var(--text-mute); }
.services h3 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.02em; }
.services p { margin: 0; color: var(--text-dim); font-size: 16px; }
.services__div {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 760px) {
  .services li { grid-template-columns: 1fr; gap: 8px; }
  .services li:hover { padding-left: 0; }
  .services__num { display: none; }
  .services__div { text-align: left; }
}

/* ---------- Cards grid ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.cards--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cards--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards--4 { grid-template-columns: 1fr; } }

.card { padding: 30px; }
.card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(76, 141, 255, 0.2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  transition: transform 0.6s var(--spring), background 0.4s, color 0.4s;
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.1); background: var(--accent); color: #030614; }
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 24px; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 16px; margin: 0; }

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps li {
  padding: 30px 28px 0 0;
  border-top: 2px solid var(--line-strong);
  position: relative;
}
.steps li::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-2);
  margin-bottom: 18px;
}
.steps li::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 8px;
  height: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.9s var(--ease-out);
}
.steps li.is-visible::after { width: 100%; height: 2px; top: -2px; }
.steps h3 { font-size: 24px; margin-bottom: 10px; }
.steps p { color: var(--text-dim); font-size: 16px; margin: 0; }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------- Showreel placeholder ---------- */

.reel {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(76, 141, 255, 0.25), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(220, 230, 255, 0.08), transparent 50%),
    rgba(12, 18, 38, 0.6);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.reel::before {
  /* darkens the poster's lower edge so the caption stays readable */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55));
  pointer-events: none;
  transition: opacity 0.5s;
}
.reel__play,
.reel__corner,
.reel__meta { z-index: 2; transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out); }
.reel { cursor: pointer; }
.reel.is-playing { cursor: auto; }
.reel.is-playing::before,
.reel.is-playing .reel__play,
.reel.is-playing .reel__corner,
.reel.is-playing .reel__meta { opacity: 0; pointer-events: none; }
.reel.is-loading .reel__play { animation: none; opacity: 0.7; }
.reel__play {
  position: relative;
  margin-top: 13%; /* sits below the poster's centred title */
  border: 0;
  cursor: pointer;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #030614;
  box-shadow: 0 0 0 14px rgba(76, 141, 255, 0.15);
  animation: pulse 2.4s var(--ease-out) infinite;
  transition: transform 0.6s var(--spring);
}
.reel:hover .reel__play { transform: scale(1.12); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 141, 255, 0.35); }
  100% { box-shadow: 0 0 0 36px rgba(76, 141, 255, 0); }
}
.reel__play svg { width: 30px; height: 30px; margin-left: 5px; }
.reel__meta {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.reel__corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 0 solid var(--paper);
  opacity: 0.6;
  transition: transform 0.7s var(--ease-out);
}
.reel__corner--tl { top: 20px; left: 20px; border-width: 2px 0 0 2px; }
.reel__corner--tr { top: 20px; right: 20px; border-width: 2px 2px 0 0; }
.reel__corner--bl { bottom: 52px; left: 20px; border-width: 0 0 2px 2px; }
.reel__corner--br { bottom: 52px; right: 20px; border-width: 0 2px 2px 0; }
.reel:hover .reel__corner--tl { transform: translate(8px, 8px); }
.reel:hover .reel__corner--tr { transform: translate(-8px, 8px); }
.reel:hover .reel__corner--bl { transform: translate(8px, -8px); }
.reel:hover .reel__corner--br { transform: translate(-8px, -8px); }

/* ---------- Marquee (moved by JS, speeds up as you scroll) ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  gap: 48px;
  animation: marquee 32s linear infinite;
  font-size: clamp(30px, 4.4vw, 56px);
  font-weight: 400;
  letter-spacing: -0.03em;
  will-change: transform;
}
.js-motion .marquee__track { animation: none; }
.marquee__track span { display: inline-flex; align-items: center; gap: 48px; }
.marquee__track span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px rgba(220, 230, 255, 0.5); }
.marquee__track span::after {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--accent-2);
  clip-path: var(--star);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- CTA: a big glass panel ---------- */

.cta {
  position: relative;
  padding: clamp(60px, 9vw, 120px) 0;
  isolation: isolate;
  text-align: center;
}
.cta .wrap {
  position: relative;
  overflow: hidden;
  width: calc(100% - 2 * var(--gutter));
  padding: clamp(60px, 9vw, 120px) clamp(20px, 5vw, 64px);
  border-radius: clamp(28px, 3vw, 44px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), 0 40px 100px -50px rgba(0, 0, 0, 0.8);
}
.cta .wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -60%;
  width: 900px;
  height: 600px;
  max-width: 160%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(76, 141, 255, 0.32), rgba(123, 107, 255, 0.12) 40%, transparent 65%);
  z-index: -1;
  animation: glow 6s ease-in-out infinite alternate;
}
.cta h2 {
  font-size: clamp(42px, 7.4vw, 108px);
  letter-spacing: -0.045em;
  line-height: 0.98;
  margin: 24px auto 26px;
  max-width: 14ch;
}
.cta p { color: var(--text-dim); max-width: 520px; margin: 0 auto 40px; }
.cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

/* ---------- Special thanks page ---------- */

.thanks {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px var(--gutter) 100px;
  text-align: center;
}
.thanks::before {
  /* soft pink glow behind the heart */
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: -2;
  width: min(110vw, 1000px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 163, 184, 0.2), rgba(123, 107, 255, 0.12) 40%, transparent 65%);
  filter: blur(40px);
  animation: glow 6s ease-in-out infinite alternate;
  pointer-events: none;
}
.thanks h1 {
  font-size: clamp(52px, 10vw, 150px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-wrap: balance; /* "Special / Thanks to" instead of a lone "to" */
}
.thanks h1 .love {
  /* the gradient sits on each word so the word-by-word reveal keeps it */
  color: var(--love);
}
.thanks h1 .love .wi,
.thanks h1 .love:not(:has(.wi)) {
  background: linear-gradient(100deg, var(--love), #c4a8ff 55%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.04em; /* keeps the last letter's gradient from clipping */
}
.thanks__name {
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
  margin: clamp(28px, 4vw, 48px) 0 0;
  font-size: clamp(20px, 2.9vw, 36px);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-indent: 0.26em; /* balances the trailing letter-spacing so it centres */
  text-transform: uppercase;
  color: var(--love);
}
.thanks__name::before,
.thanks__name::after {
  content: "";
  width: clamp(28px, 5vw, 56px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--love));
}
.thanks__name::after { background: linear-gradient(90deg, var(--love), transparent); }

/* A big, faint heart made of 143 twinkling stars (placed by JS) */
.star-heart {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: -1;
  width: min(88vw, 780px);
  translate: -50% -50%;
  display: grid;
  grid-template-columns: repeat(15, 1fr); /* must match the HEART rows in main.js */
  opacity: 0.32;
  animation: heartbeat 2.6s ease-in-out infinite;
  pointer-events: none;
}
.star-heart i {
  aspect-ratio: 1;
  background: var(--love);
  clip-path: var(--star);
  translate: var(--jx, 0) var(--jy, 0);
  opacity: 0;
  scale: 0.2;
  animation:
    cell-in 0.9s var(--ease-out) var(--d, 0s) forwards,
    twinkle 3.5s ease-in-out calc(var(--d, 0s) + 1.2s) infinite;
}
.star-heart i.off { visibility: hidden; animation: none; }
.star-heart i.hot { background: var(--accent-2); }
.star-heart i.shine { background: #ffffff; }
@keyframes cell-in { to { opacity: 1; scale: var(--s, 0.8); } }
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes heartbeat {
  0%, 60%, 100% { scale: 1; }
  12% { scale: 1.045; }
  24% { scale: 1; }
  36% { scale: 1.03; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 0;
  font-size: 15px;
  overflow: hidden;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 56px;
}
.footer__brand .brand { margin-bottom: 18px; }
.footer__brand .brand__logo { height: 52px; }
.footer__brand p { color: var(--text-dim); max-width: 300px; }
.site-footer h4 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 18px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer ul a {
  position: relative;
  color: var(--text-dim);
  transition: color 0.3s;
}
.site-footer ul a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.5s var(--ease-out);
}
.site-footer ul a:hover { color: var(--accent); }
.site-footer ul a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
  font-size: 14px;
}
.footer__mega {
  /* the Ternastra wordmark, used as a mask so it keeps the faint fading-blue look */
  width: min(94%, 1500px);
  aspect-ratio: 402 / 62;
  margin: 30px auto -1.6vw;
  background: linear-gradient(180deg, rgba(160, 195, 255, 0.26), rgba(160, 195, 255, 0.02) 85%);
  -webkit-mask: url("../assets/ternastra-wordmark.svg") center / contain no-repeat;
  mask: url("../assets/ternastra-wordmark.svg") center / contain no-repeat;
  user-select: none;
  pointer-events: none;
}
@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---------- Motion: reveals (only when JS is running) ---------- */

.js .reveal {
  opacity: 0;
  translate: 0 40px;
  filter: blur(8px);
  transition:
    opacity 1.1s var(--ease-out), translate 1.2s var(--ease-out), filter 1.1s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; translate: 0 0; filter: none; }
.js .reveal[data-delay="1"] { transition-delay: 0.08s; }
.js .reveal[data-delay="2"] { transition-delay: 0.16s; }
.js .reveal[data-delay="3"] { transition-delay: 0.24s; }

/* headlines rise in word by word */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.wi {
  display: inline-block;
  translate: 0 110%;
  rotate: 4deg;
  transform-origin: 0 100%;
  transition: translate 1.2s var(--ease-out), rotate 1.2s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.is-visible > .w > .wi,
.is-visible .w .wi { translate: 0 0; rotate: 0deg; }

/* media unmask */
.js .reveal-img {
  clip-path: inset(14% 10% 14% 10% round var(--radius));
  transition: clip-path 1.5s var(--ease-out);
}
.js .reveal-img.is-visible { clip-path: inset(0 0 0 0 round var(--radius)); }
.js .reveal-img img { scale: 1.2; transition: scale 1.8s var(--ease-out); }
.js .reveal-img.is-visible img { scale: 1; }
.js .gallery img.reveal-img { clip-path: inset(18% 18% 18% 18% round 16px); }
.js .gallery img.reveal-img.is-visible { clip-path: inset(0 0 0 0 round 16px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .reveal-img, .wi { opacity: 1; translate: none; filter: none; clip-path: none; rotate: none; }
  html { scroll-behavior: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- SharedSpace page: free-forever pledge, comparison, feature lists ---------- */

.pledge {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.pledge .card { padding: 34px 30px; }
.pledge b {
  display: block;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  background: linear-gradient(120deg, var(--accent-2), var(--accent) 55%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pledge h3 { font-size: 22px; margin-bottom: 8px; }
.pledge p { color: var(--text-dim); font-size: 16px; margin: 0; }
@media (max-width: 860px) { .pledge { grid-template-columns: 1fr; } }

.compare {
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-hi), 0 20px 50px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.compare__head,
.compare__row {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(18px, 3vw, 32px);
}
.compare__head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: rgba(255, 255, 255, 0.03);
}
.compare__head span:last-child { color: var(--accent-2); }
.compare__head span:not(:first-child),
.compare__cell { text-align: center; }
.compare__row { border-top: 1px solid var(--line); transition: background 0.3s; }
.compare__row:hover { background: rgba(140, 170, 255, 0.05); }
.compare__name { font-weight: 500; }
.compare__name small { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--text-dim); }
.pill {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.pill--lock { color: var(--text-mute); border: 1px dashed var(--line-strong); }
.pill--free {
  color: #031024;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 20px -8px rgba(76, 141, 255, 0.8);
}
.compare__note { margin: 18px 4px 0; color: var(--text-mute); font-size: 14px; }
@media (max-width: 700px) {
  .compare__head,
  .compare__row { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .compare__head span:first-child,
  .compare__name { grid-column: 1 / -1; text-align: left; }
  .pill { white-space: normal; font-size: 12px; padding: 6px 10px; }
}

.points { list-style: none; margin: 22px 0 0; padding: 0; }
.points li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 14px;
  color: var(--text-dim);
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 12px;
  background: var(--accent-2);
  clip-path: var(--star);
}
.points b { color: var(--text); font-weight: 500; }

/* two phones instead of three */
.fan--duo .shot:nth-child(1) { transform: translateX(26%) rotate(-7deg) scale(0.9); }
.fan--duo .shot:nth-child(2) { position: static; transform: translateX(-26%) rotate(7deg) scale(0.9); z-index: 2; }
.feature:hover .fan--duo .shot:nth-child(1) { transform: translateX(18%) rotate(-11deg) scale(0.92); }
.feature:hover .fan--duo .shot:nth-child(2) { transform: translateX(-18%) rotate(11deg) scale(0.92); }

.cards--spaced { margin-top: 20px; }

/* a finished banner image that fills the 4:3 media card */
.feature__banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease-out);
}
.feature:hover .feature__banner { transform: scale(1.03); }

/* ---------- Tide page: desktop screenshots ---------- */

.winshots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 3vw, 32px);
}
.winshots figure { margin: 0; }
.winshots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 40px -16px rgba(76, 141, 255, 0.35);
  transition: transform 0.9s var(--spring);
}
.winshots figure:hover img { transform: translateY(-8px); }
.winshots figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (max-width: 700px) { .winshots { grid-template-columns: 1fr; } }

/* a feature inside a paper section follows the pledge cards */
.pledge + .feature { margin-top: clamp(60px, 8vw, 110px); }

/* pledge cards whose headline is a word, not a number */
.pledge--text b {
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.03em;
  white-space: nowrap;
  margin-bottom: 20px;
}

/* the small note under a download button */
.download-note {
  max-width: 420px;
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mute);
}
.download-note b { color: var(--text-dim); font-weight: 500; }

/* a one-line slogan at the top of a feature card */
.feature__slogan {
  margin: 0 0 18px;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}
.feature__body p.feature__slogan { color: var(--text); }

/* the row of download buttons */
.download-row { display: flex; flex-wrap: wrap; gap: 12px; }
.download-row .btn svg { width: 18px; height: 18px; }
