/* NASA Exp landing and privacy pages.
   Tokens come from nasa.exp/Core/DesignSystem/AppColors.swift; direction from
   .interface-design/system.md. Always dark. Every animation is progressive enhancement:
   the base styles show all content, motion lives in prefers-reduced-motion: no-preference
   and, where support varies, in @supports. */

:root {
  color-scheme: dark;

  --bg-top: #030817;
  --bg-bottom: #03030d;
  --glow: #123357;

  --surface: #0a1429;
  --surface-2: #121f38;
  --surface-3: #1a2947;

  --accent: #38dbf5;
  --accent-2: #ffba4d;
  --accent-muted: #85e3f2;

  --text: #f2faff;
  --text-2: #bdd1eb;
  --text-3: #829cba;

  --border: rgb(89 140 189 / 0.28);
  --border-strong: rgb(107 224 245 / 0.45);

  --font: "Avenir Next", "Avenir", system-ui, sans-serif;
  --gutter: 16px;
  --maxw: 1120px;
  --radius: 22px;
  --radius-sm: 14px;
  --header-h: 116px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 900px) {
  :root {
    --gutter: 32px;
    --header-h: 72px;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg-bottom);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* SpaceBackground: gradient canvas, radial glow and a sparse star field. Fixed layer
   instead of background-attachment: fixed, which iOS ignores. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, rgb(242 250 255 / 0.55), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgb(242 250 255 / 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 42%, rgb(133 227 242 / 0.5), transparent 60%),
    radial-gradient(1px 1px at 26% 71%, rgb(242 250 255 / 0.35), transparent 60%),
    radial-gradient(1px 1px at 90% 83%, rgb(242 250 255 / 0.4), transparent 60%),
    radial-gradient(900px 620px at 85% -8%, rgb(18 51 87 / 0.85), transparent 65%),
    radial-gradient(700px 520px at -10% 55%, rgb(18 51 87 / 0.45), transparent 70%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-muted);
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg-top);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgb(3 8 23 / 0.94);
  border-bottom: 1px solid var(--border);
  view-transition-name: site-header;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header {
    background: rgb(3 8 23 / 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px var(--gutter) 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand lang"
    "nav nav";
  align-items: center;
  column-gap: 12px;
}

@media (min-width: 900px) {
  .header-inner {
    padding-block: 10px;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav lang";
  }
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

/* One brand per page carries the shared name (the footer repeats the brand). A duplicated
   name aborts the whole transition. */
.site-header .brand,
.doc main > nav .brand {
  view-transition-name: brand;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border);
}

.site-nav {
  grid-area: nav;
  min-width: 0;
}

.site-nav ul {
  display: flex;
  gap: 2px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav ul::-webkit-scrollbar {
  display: none;
}

@media (min-width: 900px) {
  .site-nav ul {
    justify-content: center;
    margin: 0;
    padding: 0;
  }
}

.site-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 24px;
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 480px) {
  .site-nav a {
    padding-inline: 8px;
    font-size: 14.5px;
  }
}

.site-nav a:hover {
  color: var(--text);
  background: rgb(26 41 71 / 0.7);
}

.lang-switch {
  grid-area: lang;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.lang-switch a,
.lang-switch span {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text-3);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--text);
}

.lang-switch [aria-current] {
  color: var(--bg-top);
  background: var(--accent);
}

/* Reading progress: only where scroll-driven animations exist. */
.progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display: block;
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 2px;
      transform-origin: 0 50%;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      animation: progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@keyframes progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---------- Shared pieces ---------- */

main {
  overflow-x: clip;
}

.section {
  padding-block: 72px;
  scroll-margin-top: var(--header-h);
}

@media (min-width: 900px) {
  .section {
    padding-block: 104px;
  }
}

.section-head {
  max-width: 680px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(30px, 6vw, 46px);
}

.section-head h2:focus {
  outline: none;
}

.section-head p:not(.kicker) {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 18px;
}

.kicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgb(10 20 41 / 0.8);
  color: var(--accent-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgb(18 31 56 / 0.92), rgb(10 20 41 / 0.92));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  color: var(--bg-top);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgb(56 219 245 / 0.35), 0 0 28px rgb(56 219 245 / 0.22);
}

a.btn-primary:hover {
  color: var(--bg-top);
  background: var(--accent-muted);
}

.btn-secondary {
  color: var(--accent-2);
  background: rgb(255 186 77 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(255 186 77 / 0.4);
}

.btn-secondary:hover {
  color: #ffd08a;
  background: rgb(255 186 77 / 0.16);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* Phone mockup. The scroll animation goes on .phone; the view-transition-name on
   .phone-screen, so the two never share an element. */
.phone {
  width: min(76vw, 300px);
  padding: 9px;
  border-radius: 46px;
  background: linear-gradient(160deg, #1b2a45, #070c19 55%);
  box-shadow:
    inset 0 0 0 1px rgb(107 224 245 / 0.25),
    0 0 60px rgb(18 51 87 / 0.7);
}

.phone-screen {
  overflow: clip;
  border-radius: 37px;
  background: var(--bg-top);
}

.phone-screen img {
  width: 100%;
}

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

.hero {
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 64px;
}

.hero-grid {
  display: grid;
  gap: 48px;
  justify-items: center;
}

@media (min-width: 900px) {
  .hero {
    padding-top: calc(var(--header-h) + 72px);
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    justify-items: stretch;
  }

  .hero .phone {
    justify-self: center;
    width: 320px;
  }
}

.hero-copy h1 {
  font-size: clamp(38px, 9vw, 64px);
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-copy .lead {
  margin-top: 20px;
  max-width: 560px;
  color: var(--text-2);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

@media (max-width: 520px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Explore (tabs) ---------- */

.tablist {
  display: none;
}

.js .tablist {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(10 20 41 / 0.85);
  max-width: 520px;
}

.tablist [role="tab"] {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-3);
  font: 600 13px/1.2 var(--font);
  cursor: pointer;
}

.tablist [role="tab"] > :not(.tab-pill) {
  position: relative;
}

.tablist [role="tab"] svg {
  width: 22px;
  height: 22px;
}

.tablist [role="tab"]:hover {
  color: var(--text);
}

.tablist [aria-selected="true"] {
  color: var(--accent);
}

.tab-pill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgb(56 219 245 / 0.12);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  opacity: 0;
}

[aria-selected="true"] > .tab-pill {
  opacity: 1;
}

.tab-panel {
  display: grid;
  gap: 32px;
  justify-items: center;
}

.tab-panel + .tab-panel {
  margin-top: 64px;
}

.js .tab-panel + .tab-panel {
  margin-top: 0;
}

/* Until the script marks the tabs ready, show only the first panel (no flash of the
   stacked no-JS layout). */
.js .tabs:not(.is-ready) .tab-panel + .tab-panel,
.tab-panel[hidden] {
  display: none;
}

@media (min-width: 900px) {
  .tab-panel {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
    gap: 72px;
  }
}

.panel-copy {
  max-width: 520px;
}

.panel-copy h3 {
  font-size: clamp(26px, 5vw, 36px);
}

.panel-copy > p:not(.kicker) {
  margin-top: 14px;
  color: var(--text-2);
}

.ticks {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.ticks li {
  position: relative;
  padding-left: 26px;
  color: var(--text-2);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgb(56 219 245 / 0.5);
}

/* ---------- Widgets and daily notification ---------- */

.widgets-grid {
  display: grid;
  gap: 40px;
  justify-items: center;
}

@media (min-width: 900px) {
  .widgets-grid {
    grid-template-columns: auto 1fr;
    gap: 72px;
    align-items: center;
    justify-items: start;
  }

  .widgets-grid .section-head {
    margin-bottom: 28px;
  }
}

.widget-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget-list li {
  padding: 16px 18px;
}

.widget-list strong {
  display: block;
  font-size: 17px;
}

.widget-list span {
  color: var(--text-2);
  font-size: 15px;
}

.notif-wrap {
  margin-top: 28px;
}

.notif-wrap > p:not(.kicker) {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 14px;
}

.notif {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 4px 12px;
  align-items: start;
  max-width: 440px;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid rgb(189 209 235 / 0.2);
  background: rgb(26 41 71 / 0.75);
}

.notif img {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.notif-app {
  color: var(--text-3);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notif-time {
  color: var(--text-3);
  font-size: 13px;
}

.notif-text {
  grid-column: 2 / -1;
  font-size: 15px;
  line-height: 1.4;
}

.notif-text strong {
  display: block;
}

/* ---------- Features (filterable cards) ---------- */

.chips {
  display: none;
}

.js .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 15px/1 var(--font);
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip[aria-pressed="true"] {
  color: var(--bg-top);
  background: var(--accent);
  border-color: var(--accent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.card[hidden] {
  display: none;
}

.card h3 {
  font-size: 19px;
  line-height: 1.25;
}

.card p {
  color: var(--text-2);
  font-size: 15px;
}

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Gallery ---------- */

.gallery {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 8px max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter))) 28px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
  overscroll-behavior-x: contain;
}

.gallery:focus-visible {
  outline-offset: -2px;
}

.gallery > li {
  flex: 0 0 210px;
  scroll-snap-align: start;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  border-radius: 26px;
  border: 1px solid var(--border);
}

.gallery-item figcaption {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- FAQ ---------- */

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgb(10 20 41 / 0.88);
}

.faq-list details[open] {
  border-color: var(--border-strong);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary:focus-visible {
  border-radius: var(--radius-sm);
  outline-offset: -2px;
}

.chev {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

details[open]:not(.is-closing) .chev {
  rotate: 180deg;
}

/* Height animation with a 0fr → 1fr grid row (interpolate-size does not exist on iPhone).
   Opening animates through @starting-style. Closing animates only with site.js, which keeps
   [open] while .is-closing collapses the row; without JS, or with reduced motion, the
   element closes natively. No ::details-content rule: in Safari it leaves an empty box
   for the whole transition. */
.faq-panel {
  display: grid;
  grid-template-rows: 1fr;
}

.faq-inner {
  min-height: 0;
  overflow: clip;
}

.faq-inner > div {
  padding: 0 18px 18px;
  color: var(--text-2);
}

.faq-inner p + p {
  margin-top: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  .chev {
    transition: rotate 0.3s var(--ease-out);
  }

  .faq-panel {
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s var(--ease-out);
  }

  details[open] > .faq-panel {
    grid-template-rows: 1fr;
  }

  details.is-closing > .faq-panel {
    grid-template-rows: 0fr;
  }

  @starting-style {
    details[open] > .faq-panel {
      grid-template-rows: 0fr;
    }
  }
}

/* ---------- Final CTA and footer ---------- */

.cta-band {
  padding: 40px 24px;
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(28px, 5vw, 40px);
}

.cta-band p:not(.kicker) {
  margin: 12px auto 0;
  max-width: 560px;
  color: var(--text-2);
}

.cta-band .hero-actions {
  justify-content: center;
}

.site-footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h2 {
  margin-bottom: 10px;
  color: var(--text-2);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.site-footer a {
  display: inline-block;
  padding-block: 4px;
}

.site-footer a.brand {
  display: inline-flex;
  margin-bottom: 8px;
  padding-block: 0;
}

.footer-note {
  margin-top: 32px;
  font-size: 13px;
}

/* ---------- Privacy policy (document page) ---------- */

.doc main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px var(--gutter) 72px;
  overflow-x: visible;
}

.doc main > nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
}

.doc main > nav .brand {
  font-size: 17px;
}

.doc h1 {
  font-size: clamp(30px, 6vw, 40px);
  margin-bottom: 6px;
  scroll-margin-top: 16px;
}

.doc h2 {
  margin: 36px 0 10px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 21px;
}

.doc p,
.doc li {
  color: var(--text-2);
}

.doc p + p,
.doc ul + p {
  margin-top: 12px;
}

.doc p.meta {
  margin-bottom: 24px;
  color: var(--text-3);
}

.doc ul {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc strong {
  color: var(--text);
}

/* ---------- Motion (progressive enhancement) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Hero text on first paint. */
  .hero-copy > * {
    transition:
      opacity 0.7s ease,
      translate 0.8s var(--ease-out);
  }

  .hero-copy > :nth-child(2) {
    transition-delay: 0.08s;
  }

  .hero-copy > :nth-child(3) {
    transition-delay: 0.16s;
  }

  .hero-copy > :nth-child(4) {
    transition-delay: 0.24s;
  }

  .hero-copy > :nth-child(5) {
    transition-delay: 0.32s;
  }

  @starting-style {
    .hero-copy > * {
      opacity: 0;
      translate: 0 18px;
    }
  }

  /* Feature cards shown by a filter chip. Hangs off .is-filtering, which the script adds
     on the first chip click, because @starting-style also fires on first paint. Entry
     only: hiding is instant so the grid reflows once. */
  .is-filtering .card {
    transition:
      opacity 0.4s ease,
      translate 0.5s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 45ms);
  }

  @starting-style {
    .is-filtering .card {
      opacity: 0;
      translate: 0 14px;
    }
  }
}

/* Scroll-driven reveals. The hidden state lives only in the keyframes. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 85%;
    }

    .tab-panel .phone {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }

    .widgets .phone {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }

    .hero .phone {
      animation: hero-out linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 90%;
    }

    .gallery-item {
      animation: slide-in linear both;
      animation-timeline: view(inline);
      animation-range: entry 0% entry 100%;
    }
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 28px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 64px;
    scale: 0.94;
  }
  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

@keyframes hero-out {
  to {
    opacity: 0.35;
    translate: 0 -40px;
    scale: 0.94;
  }
}

@keyframes slide-in {
  from {
    opacity: 0.2;
    scale: 0.88;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

/* ---------- View Transitions ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Between documents: landing ↔ privacy ↔ the other language. The brand keeps its
     name on every page; the hero screen morphs between languages. */
  @view-transition {
    navigation: auto;
  }

  /* data-vt is set by site.js only for same-document transitions, so the hero screen
     keeps its name just for navigations between documents. */
  html:not([data-vt]) .hero .phone-screen {
    view-transition-name: hero-screen;
  }

  ::view-transition-group(*) {
    animation-duration: 0.4s;
    animation-timing-function: var(--ease-out);
  }

  /* (a) Explore tabs: only the visible panel and the selected tab carry names. */
  html[data-vt^="tab"] .tab-panel:not([hidden]) .phone-screen {
    view-transition-name: explore-screen;
  }

  html[data-vt^="tab"] .tab-panel:not([hidden]) .panel-copy {
    view-transition-name: explore-copy;
  }

  html[data-vt^="tab"] [role="tab"][aria-selected="true"] > .tab-pill {
    view-transition-name: tab-pill;
  }

  html[data-vt="tab-forward"]::view-transition-old(explore-screen) {
    animation: 0.3s ease both vt-out-left;
  }

  html[data-vt="tab-forward"]::view-transition-new(explore-screen) {
    animation: 0.42s var(--ease-out) both vt-in-right;
  }

  html[data-vt="tab-back"]::view-transition-old(explore-screen) {
    animation: 0.3s ease both vt-out-right;
  }

  html[data-vt="tab-back"]::view-transition-new(explore-screen) {
    animation: 0.42s var(--ease-out) both vt-in-left;
  }

  /* (b) Header nav jumps: the header keeps its own name and stays put while the page
     slides in the direction of travel. */
  html[data-vt="nav-down"]::view-transition-old(root) {
    animation: 0.28s ease both vt-out-up;
  }

  html[data-vt="nav-down"]::view-transition-new(root) {
    animation: 0.4s var(--ease-out) both vt-in-up;
  }

  html[data-vt="nav-up"]::view-transition-old(root) {
    animation: 0.28s ease both vt-out-down;
  }

  html[data-vt="nav-up"]::view-transition-new(root) {
    animation: 0.4s var(--ease-out) both vt-in-down;
  }
}

@keyframes vt-out-left {
  to {
    opacity: 0;
    translate: -10% 0;
  }
}

@keyframes vt-in-right {
  from {
    opacity: 0;
    translate: 10% 0;
  }
}

@keyframes vt-out-right {
  to {
    opacity: 0;
    translate: 10% 0;
  }
}

@keyframes vt-in-left {
  from {
    opacity: 0;
    translate: -10% 0;
  }
}

@keyframes vt-out-up {
  to {
    opacity: 0;
    translate: 0 -48px;
  }
}

@keyframes vt-in-up {
  from {
    opacity: 0;
    translate: 0 48px;
  }
}

@keyframes vt-out-down {
  to {
    opacity: 0;
    translate: 0 48px;
  }
}

@keyframes vt-in-down {
  from {
    opacity: 0;
    translate: 0 -48px;
  }
}
