/* ==========================================================================
   Aevox — shared styles (all pages)
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --abyss: #04040a;
  --ink: #09091a;
  --deep: #0d0c24;
  --panel: rgba(20, 18, 46, 0.55);
  --panel-solid: #12112a;
  --line: rgba(169, 157, 255, 0.13);
  --line-strong: rgba(169, 157, 255, 0.26);

  --text: #edebf8;
  --muted: #a6a3c2;
  --faint: #6c6990;

  --violet: #7c6cf6;
  --violet-2: #aa9fff;
  --teal: #62e3d1;
  --red: #ff5b78;
  --green: #31d8a2;
  --amber: #ffb648;

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --nav-h: 68px;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1240px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--abyss);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(124, 108, 246, 0.45); color: #fff; }

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

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--violet); color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 600; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Brand mark ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.02em;
}
.brand-mark {
  position: relative; width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 5px, rgba(98, 227, 209, 0.16) 5.5px 6px, transparent 6.5px 10px, rgba(98, 227, 209, 0.12) 10.5px 11px, transparent 11.5px 16px, rgba(98, 227, 209, 0.08) 16.5px 17px, transparent 17.5px),
    linear-gradient(160deg, #1b1840, #0b0a1d);
  box-shadow: inset 0 0 0 1px rgba(169, 157, 255, 0.22), 0 6px 24px -6px rgba(124, 108, 246, 0.55);
  font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px;
  border: 0; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.35s var(--ease-out), background-color 0.25s, box-shadow 0.35s var(--ease-out), color 0.25s;
}
.btn:active { transform: scale(0.97); }
.btn-sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn-light { background: #f2f0ff; color: #0b0a1d; }
.btn-light:hover { background: #fff; box-shadow: 0 8px 30px -8px rgba(170, 159, 255, 0.7); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--violet-2); }

/* Store buttons */
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 22px 0 18px; border-radius: 16px;
  text-decoration: none; color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)), rgba(8, 8, 20, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 30px -12px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow: hidden; isolation: isolate;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}
.store-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120px 60px at var(--mx, 50%) var(--my, 120%), rgba(170, 159, 255, 0.45), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.store-btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(170, 159, 255, 0.5), 0 18px 40px -14px rgba(124, 108, 246, 0.6); }
.store-btn:hover::before { opacity: 1; }
.store-btn svg { width: 24px; height: 24px; flex: none; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.1; }
.store-btn small { font-size: 11px; font-weight: 500; opacity: 0.7; letter-spacing: 0.01em; }
.store-btn b { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  transition: transform 0.5s var(--ease-out);
  isolation: isolate;
}

/* Liquid glass bar: the blur/refraction sits on the bar itself,
   ::before adds the tint and bright rims, ::after a pointer-following sheen */
.nav {
  -webkit-backdrop-filter: blur(14px) saturate(185%) brightness(1.06);
  backdrop-filter: blur(14px) saturate(185%) brightness(1.06);
}
/* Chromium can bend the backdrop through an SVG filter: the "liquid" part */
.lg-refract .nav {
  -webkit-backdrop-filter: url(#nav-glass) blur(9px) saturate(185%) brightness(1.06);
  backdrop-filter: url(#nav-glass) blur(9px) saturate(185%) brightness(1.06);
}
.nav::before,
.nav::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.nav::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 48%, rgba(255, 255, 255, 0.045) 100%),
    rgba(14, 12, 36, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 2px 6px -2px rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -12px 20px -14px rgba(170, 159, 255, 0.45),
    0 12px 32px -20px rgba(0, 0, 0, 0.75);
  transition: background-color 0.4s;
}
.nav::after {
  background:
    radial-gradient(260px 120px at var(--gx, 30%) -30%, rgba(255, 255, 255, 0.10), transparent 70%),
    linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.035) 22%, transparent 34%, transparent 64%, rgba(255, 255, 255, 0.03) 78%, transparent 90%);
}
.nav.is-scrolled::before { background-color: rgba(10, 9, 28, 0.38); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links > a,
.nav-legal > button {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  text-decoration: none; background: none; border: 0; cursor: pointer;
  transition: color 0.25s, background-color 0.25s;
}
.nav-links > a:hover,
.nav-legal > button:hover,
.nav-legal > button[aria-expanded="true"] { color: var(--text); background: rgba(169, 157, 255, 0.08); }
.nav-links > a.is-active { color: var(--text); }
.nav-links > a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 10px var(--teal);
}
.nav-legal { position: relative; }
.nav-legal svg { width: 10px; height: 10px; transition: transform 0.3s var(--ease-out); }
.nav-legal > button[aria-expanded="true"] svg { transform: rotate(180deg); }
.legal-menu {
  position: absolute; top: calc(100% + 10px); right: -8px; min-width: 260px;
  padding: 8px; border-radius: 18px;
  background: rgba(14, 13, 34, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 60px -20px rgba(0, 0, 0, 0.9);
  transform-origin: top right;
  animation: menu-in 0.35s var(--ease-out);
}
.legal-menu[hidden] { display: none; }
.legal-menu a {
  display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  font-weight: 600; font-size: 15px; transition: background-color 0.2s;
}
.legal-menu a:hover, .legal-menu a[aria-current="page"] { background: rgba(169, 157, 255, 0.1); }
.legal-menu small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
}

.nav-end { display: flex; align-items: center; gap: 14px; }
.nav-depth {
  font-size: 12px; color: var(--faint); letter-spacing: 0.04em;
  min-width: 6.5ch; text-align: right; font-variant-numeric: tabular-nums;
}
.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(169, 157, 255, 0.08); border: 0; cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; border-radius: 2px; background: var(--text);
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21.5px; transform: rotate(-45deg); }

/* Mobile menu: a compact liquid-glass panel under the hamburger */
.mobile-menu {
  position: fixed; z-index: 99;
  top: calc(var(--nav-h) + 10px); right: 12px;
  width: min(290px, calc(100vw - 24px));
  max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto;
  padding: 8px; border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0.05) 100%),
    rgba(16, 14, 40, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.05);
  backdrop-filter: blur(24px) saturate(190%) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 -14px 24px -18px rgba(170, 159, 255, 0.5),
    0 24px 60px -20px rgba(0, 0, 0, 0.85);
  transform-origin: calc(100% - 24px) 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-8px) scale(0.94);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out), visibility 0s linear 0.35s;
}
.mobile-menu.is-open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity 0.25s ease, transform 0.45s var(--ease-out), visibility 0s;
}
.mobile-menu ol { list-style: none; margin: 0; padding: 0; }
.mobile-menu li a {
  display: block; padding: 11px 14px; border-radius: 14px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none;
  transition: background-color 0.2s;
}
.mobile-menu li a:active, .mobile-menu li a:hover { background: rgba(255, 255, 255, 0.08); }
.mobile-menu-legal { display: flex; gap: 16px; margin: 6px 0 10px; padding: 10px 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.mobile-menu-legal a { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.mobile-menu-legal a:hover { color: var(--text); }
.mobile-menu .store-row { gap: 6px; flex-wrap: nowrap; }
.mobile-menu .store-btn { flex: 1 1 0; min-width: 0; height: 42px; padding: 0 10px; gap: 7px; border-radius: 13px; justify-content: center; }
.mobile-menu .store-btn svg { width: 17px; height: 17px; }
.mobile-menu .store-btn small { display: none; }
.mobile-menu .store-btn b { font-size: 13.5px; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}
@media (min-width: 961px) {
  .mobile-menu { display: none; }
}
@media (max-width: 420px) {
  .nav-end .btn { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  padding: 72px 0 calc(36px + env(safe-area-inset-bottom));
  background: #030307;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.footer-grid {
  display: grid; gap: 40px;
  grid-template-columns: 1.6fr repeat(3, 1fr);
}
.footer-about p { color: var(--muted); max-width: 34ch; margin-top: 16px; font-size: 15px; }
.footer h4 {
  font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); margin-bottom: 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer ul a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer ul a:hover { color: var(--text); }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}
.footer-base p { max-width: 70ch; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

/* ---------- Legal pages ---------- */
.legal-page {
  background:
    radial-gradient(80% 50% at 85% -10%, rgba(124, 108, 246, 0.18), transparent 70%),
    radial-gradient(60% 40% at 0% 10%, rgba(98, 227, 209, 0.06), transparent 70%),
    var(--abyss);
  background-attachment: fixed;
}

.legal-hero { padding: calc(var(--nav-h) + clamp(48px, 9vw, 110px)) 0 clamp(32px, 5vw, 56px); }
.legal-switch {
  display: inline-flex; padding: 4px; border-radius: 999px; gap: 2px;
  background: rgba(169, 157, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 36px;
}
.legal-switch a {
  padding: 8px 18px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: color 0.2s, background-color 0.2s;
}
.legal-switch a:hover { color: var(--text); }
.legal-switch a[aria-current="page"] { background: var(--text); color: var(--ink); }
.legal-hero h1 {
  font-size: clamp(44px, 8vw, 96px); line-height: 1; letter-spacing: -0.028em; font-weight: 750;
}
.legal-hero h1 .soft { color: #6f6b97; }
.legal-meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 26px;
  font: 500 14px var(--mono); color: var(--muted);
}
.legal-meta span::before { content: "◦ "; color: var(--teal); }

.legal-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px);
  padding-bottom: 120px;
}
.legal-toc { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; max-height: calc(100vh - var(--nav-h) - 64px); overflow: auto; }
.legal-toc p { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 12px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.legal-toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent;
  font-size: 13.5px; line-height: 1.4; color: var(--faint); text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.legal-toc a:hover { color: var(--text); }
.legal-toc a.is-active { color: var(--text); border-left-color: var(--teal); }

.legal-body { max-width: 760px; color: #c4c1dc; font-size: 16.5px; line-height: 1.75; }
.legal-body > * + * { margin-top: 1em; }
.legal-body h2 {
  margin-top: 2.6em; padding-top: 1.4em; border-top: 1px solid var(--line);
  font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; color: var(--text);
}
.legal-body h2:first-of-type { margin-top: 2em; }
.legal-body ul { padding-left: 0; list-style: none; }
.legal-body ul li { position: relative; padding-left: 26px; }
.legal-body ul li + li { margin-top: 0.55em; }
.legal-body ul li::before {
  content: ""; position: absolute; left: 4px; top: 0.72em; width: 8px; height: 1px; background: var(--violet-2);
}
.legal-body strong { color: var(--text); font-weight: 650; }
.legal-body a { color: var(--violet-2); text-decoration: underline; text-decoration-color: rgba(170, 159, 255, 0.35); text-underline-offset: 3px; }
.legal-body a:hover { text-decoration-color: currentColor; }
.legal-body .notice,
.legal-body .warning {
  padding: 20px 22px; border-radius: 16px; font-size: 15.5px;
  background: rgba(124, 108, 246, 0.08); box-shadow: inset 0 0 0 1px rgba(124, 108, 246, 0.28);
}
.legal-body .warning { background: rgba(255, 91, 120, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 91, 120, 0.28); }
.legal-body .warning ul { margin-top: 0.8em; }
.legal-body .warning ul li::before { background: var(--red); }
.legal-body .notice strong { color: #fff !important; }

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: calc(var(--nav-h) + 40px) var(--gutter) 60px; }
.lost-depth { font: 600 15px var(--mono); color: var(--teal) !important; }
.lost h1 { margin-top: 18px; font-size: clamp(48px, 9vw, 120px); line-height: 1; letter-spacing: -0.03em; font-weight: 800; }
.lost h1 .soft { color: #6f6b97; }
.lost p { margin: 22px auto 34px; max-width: 40ch; color: var(--muted); font-size: 18px; }
.lost .btn { --h: 52px; padding: 0 26px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
