/* =========================================================
   Modal: shared base for every page
   Tokens, type, buttons, the release status, nav, footer and
   motion controls. Colours come from the launcher's own dark
   theme (src/Modal.UI/Themes/Resources.axaml). The landing
   page's own layout is in home.css; legal pages use terms.css.
   ========================================================= */

/* Inter, served from this site (latin subset) so visitors' browsers never contact a font CDN. It is also the
   launcher's own typeface. Licensed under the SIL Open Font License: assets/fonts/LICENSE-OFL.txt */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("assets/fonts/inter-latin-800-normal.woff2") format("woff2"); }

:root {
  --bg: #080b0f;
  --bg-elev: #0c1117;
  --surface: #10161d;
  --surface-2: #151d26;
  --surface-3: #1a2430;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .12);

  --text: #eaf1f7;
  --muted: #94a2b0;
  --faint: #808d9a;   /* ≥ 4.9:1 on every surface (WCAG 1.4.3) */

  --accent: #5cc8ff;  /* the launcher's ModalAccentBrush */
  --accent-2: #a6e4ff;
  --accent-deep: #0e3550;
  --accent-ink: #04202f;
  --accent-soft: rgba(92, 200, 255, .12);

  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* keep anchored and focused content clear of the fixed nav */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word; /* a long word or address never pushes a page sideways */
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: rgba(92, 200, 255, .6); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
main:focus { outline: none; } /* focus target for the skip link only */

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .8);
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; outline: 2px solid #fff; outline-offset: 3px; }

.ic {
  width: 1.15em; height: 1.15em;
  flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; letter-spacing: -.01em;
  border-radius: 12px;
  transition: transform .25s var(--ease), background .25s, border-color .25s;
  white-space: nowrap;
}
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-ghost {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .07); }

/* ---------- Release status ----------
   Drawn like the launcher's instance card while it prepares a launch: a spinning LoaderCircle and a thin progress
   bar that never claims a percentage, because there is no date to count down to. The words carry the meaning. */
.status {
  display: flex; align-items: center; gap: 16px;
  max-width: 460px;
  padding: 14px 18px 14px 14px;
  border-radius: 16px;
  background: #141920;                       /* ModalSurfaceBrush */
  border: 1px solid #212934;                 /* ModalBorderBrush */
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset;
}
.status-logo { width: 44px; height: 44px; flex: none; border-radius: 11px; }
.status-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15px; line-height: 1.35; }
.status-line b { font-weight: 600; letter-spacing: -.01em; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  background: rgba(92, 200, 255, .12);       /* ModalAccentSoftBrush */
  color: #7dd3ff;                            /* ModalAccentTextBrush */
  font-size: 12.5px; font-weight: 600;
}
.status-dot {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(92, 200, 255, .55);
  animation: status-pulse 2.4s ease-out infinite;
}
@keyframes status-pulse { 70%, 100% { box-shadow: 0 0 0 6px rgba(92, 200, 255, 0); } }
.status-sub { font-size: 14px; line-height: 1.45; color: #98a4b3; } /* ModalTextSecondaryBrush */
.status-bar {
  position: relative; display: block; overflow: hidden;
  height: 3px; margin-top: 9px; border-radius: 3px;
  background: rgba(255, 255, 255, .08);
}
.status-bar > span {
  position: absolute; inset: 0 auto 0 0; width: 38%;
  border-radius: inherit;
  background: var(--accent);
  animation: status-sweep 2.2s cubic-bezier(.45, 0, .25, 1) infinite;
}
@keyframes status-sweep { from { transform: translateX(-110%); } to { transform: translateX(290%); } }
.status-spin { width: 20px; height: 20px; color: var(--accent); animation: spin360 1s linear infinite; }
.status-sm { padding: 10px 14px 10px 10px; gap: 12px; border-radius: 13px; }
.status-sm .status-logo { width: 34px; height: 34px; border-radius: 9px; }
.status-sm .status-line { font-size: 14px; }
.status-sm .status-sub { font-size: 13px; }
.status-sm .status-bar { margin-top: 7px; }
@keyframes spin360 { to { transform: rotate(360deg); } }
.spin { animation: spin360 1s linear infinite; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 11, 15, .78);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: 14px 24px;
  min-height: 68px; /* matches --nav-h in terms.css and home.css */
  /* logo on the left, the page links in the middle, the status (on the landing page) on the right */
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
}
.nav-inner > :last-child:not(.nav-links) { justify-self: end; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .07); }
.brand {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -.02em;
}
.brand img { border-radius: 9px; }

/* ---------- Page header backdrop (legal pages) ---------- */
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 30%, transparent 75%);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.hero-glow.g1 {
  width: 820px; height: 520px; left: 50%; top: -220px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(92, 200, 255, .38), transparent);
}

/* Brand cube (echoes the logo), floating in the legal pages' headers */
.cube-float { position: absolute; z-index: 2; animation: bob 7s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.cube {
  width: var(--s); height: var(--s);
  position: relative;
  transform-style: preserve-3d;
  animation: spin 18s linear infinite;
}
.cube .f {
  position: absolute; inset: 0;
  border-radius: 4px;
  backface-visibility: hidden;
}
.cube .front  { background: #d9f0ff; transform: translateZ(calc(var(--s) / 2)); }
.cube .back   { background: #0e3550; transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube .right  { background: #0e3550; transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube .left   { background: #bfe6fc; transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube .top    { background: #ffffff; transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube .bottom { background: #0a2a40; transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
@keyframes spin {
  from { transform: rotateX(-28deg) rotateY(0deg); }
  to   { transform: rotateX(-28deg) rotateY(360deg); }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0 48px; margin-top: 90px; }
.footer-inner {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px 32px;
}
.footer .brand { font-size: 17px; }
.footer .brand img { border-radius: 7px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 24px; font-size: 14.5px; color: var(--muted); }
.footer-links a { display: inline-block; padding: 6px 0; } /* ≥ 24px tall targets (WCAG 2.5.8) */
.footer-links a:hover { color: var(--text); }
.footer-links [aria-current] { color: var(--text); }
.footer-bottom {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
}
.legal { font-size: 13px; color: var(--faint); }

/* Pause / play animations (WCAG 2.2.2) */
.motion-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: color .2s, background .2s, border-color .2s;
}
.motion-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.motion-toggle .ic { width: 14px; height: 14px; }
.motion-toggle .when-paused { display: none; }
.motion-paused .motion-toggle { color: var(--accent); border-color: rgba(92, 200, 255, .4); }
.motion-paused .motion-toggle .when-running { display: none; }
.motion-paused .motion-toggle .when-paused { display: block; }

/* While paused, every looping animation holds still */
.motion-paused *, .motion-paused *::before, .motion-paused *::after {
  animation-play-state: paused !important;
}

/* ---------- Reveal on scroll (legal pages' headers) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .container, .nav-inner { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .status-bar > span { transform: none; width: 100%; opacity: .35; } /* a still bar instead of a sweep */
  .motion-toggle { display: none; } /* nothing animates, so there is nothing to pause */
}
