/* AEGIS reference page: system-first, quiet, iOS-adjacent.
   Light is the default; dark follows the system preference. */

:root {
  color-scheme: light dark;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --hairline: rgba(60, 60, 67, 0.14);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --bad: #d70015;
  --warn: #a05a00;
  --ok: #248a3d;
  --nav-bg: rgba(245, 245, 247, 0.82);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);

  --radius-md: 20px;
  --radius-lg: 28px;

  --page-max: 1080px;
  --gutter: clamp(20px, 5vw, 48px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Atmosphere */
  --dot-color: rgba(60, 60, 67, 0.11);
  --dot-gap: 4px;
  --static-opacity: 0.05;
  --static-blend: multiply;
  --static-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23s)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08080a;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;
    --hairline: rgba(255, 255, 255, 0.12);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --bad: #ff453a;
    --warn: #ffd60a;
    --ok: #30d158;
    --nav-bg: rgba(8, 8, 10, 0.78);
    --shadow-sm: none;

    /* Atmosphere */
    --dot-color: rgba(255, 255, 255, 0.13);
    --static-opacity: 0.075;
    --static-blend: screen;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

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

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: max(16px, env(safe-area-inset-top));
}

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

/* ---------- Atmosphere: dotted muster + TV static ---------- */

body {
  position: relative;
  isolation: isolate;
}

body::after {
  content: "";
  position: fixed;
  inset: -48px;
  z-index: 0;
  pointer-events: none;
  background-image: var(--static-image);
  background-size: 160px 160px;
  opacity: var(--static-opacity);
  mix-blend-mode: var(--static-blend);
  will-change: transform;
  animation: tv-static 0.8s steps(1) infinite;
}

@keyframes tv-static {
  0% {
    transform: translate3d(0, 0, 0);
  }
  12.5% {
    transform: translate3d(-17px, -11px, 0);
  }
  25% {
    transform: translate3d(13px, -23px, 0);
  }
  37.5% {
    transform: translate3d(-29px, 16px, 0);
  }
  50% {
    transform: translate3d(22px, 8px, 0);
  }
  62.5% {
    transform: translate3d(-9px, -31px, 0);
  }
  75% {
    transform: translate3d(31px, 19px, 0);
  }
  87.5% {
    transform: translate3d(-23px, 27px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* Keep content above the fixed atmosphere layers. */
main,
.footer {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: border-color 0.35s var(--ease-out);
}

.nav.is-scrolled {
  border-bottom-color: var(--hairline);
}

.nav-inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top);
  height: calc(52px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text);
}

.nav-brand:hover,
.nav-link:hover {
  text-decoration: none;
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.8125rem;
}

.nav-links a {
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  padding-block: clamp(56px, 11vh, 120px);
}

/* Fine dot muster, confined to the hero and faded out before the sections. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at center, var(--dot-color) 0.75px, transparent 0.95px);
  background-size: var(--dot-gap) var(--dot-gap);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 92%);
}

.scroll-pill {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3vh, 30px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.scroll-pill:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.scroll-pill svg {
  width: 14px;
  height: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-pill svg {
    animation: scroll-nudge 2.4s var(--ease-out) infinite;
  }
}

@keyframes scroll-nudge {
  0%,
  100% {
    transform: translateY(-1px);
  }
  50% {
    transform: translateY(2px);
  }
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-copy {
  max-width: 34rem;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  margin-bottom: clamp(16px, 2.5vh, 24px);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-logo {
  display: block;
}

.hero-logo:hover {
  text-decoration: none;
}

.hero-mark {
  width: clamp(260px, 32vw, 460px);
  filter: invert(1);
  opacity: 0.94;
}

@media (prefers-color-scheme: dark) {
  .hero-mark {
    filter: none;
  }
}

.hero-title {
  font-size: clamp(1.875rem, 3.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.hero-lede {
  margin-top: clamp(14px, 2.2vh, 20px);
  max-width: 46ch;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.actions {
  margin-top: clamp(24px, 4vh, 34px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    background 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.button:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
}

.button.secondary:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.button:active {
  transform: scale(0.98);
}

.button svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

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

.section {
  padding-block: clamp(60px, 9vw, 124px);
  border-top: 1px solid var(--hairline);
}

.section-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(20px, 5vw, 64px);
  align-items: start;
}

.section-kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  padding-top: 0.35rem;
}

.section-body {
  max-width: 720px;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.body {
  margin-top: clamp(16px, 2.4vw, 24px);
  font-size: clamp(1.0625rem, 1.4vw, 1.125rem);
  line-height: 1.62;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ---------- Grouped rows ---------- */

.rows {
  margin-top: clamp(28px, 4vw, 44px);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.row {
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.4vw, 26px);
  border-top: 1px solid var(--hairline);
}

.row:first-child {
  border-top: 0;
}

.row h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.row p {
  margin-top: 4px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ---------- Policy ---------- */

.policy {
  margin-top: clamp(28px, 4vw, 44px);
}

.policy-block {
  padding-top: clamp(24px, 3.4vw, 34px);
  margin-top: clamp(24px, 3.4vw, 34px);
  border-top: 1px solid var(--hairline);
}

.policy-block:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.policy-block p {
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.62;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.list li {
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.9688rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.list strong {
  color: var(--text);
  font-weight: 600;
}

.contact-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.contact-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.9688rem;
}

.contact-list li:first-child {
  border-top: 0;
}

.contact-list span {
  color: var(--text-secondary);
}

.contact-list a {
  overflow-wrap: anywhere;
}

.updated {
  margin-top: clamp(20px, 3vw, 28px);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

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

.footer {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(28px, 4vw, 44px);
  padding-bottom: calc(clamp(28px, 4vw, 44px) + env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-meta {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.footer-meta a {
  color: var(--text-tertiary);
}

.footer-meta a:hover {
  color: var(--text-secondary);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.75s var(--ease-out),
      transform 0.75s var(--ease-out);
  }

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

  .hero .eyebrow,
  .hero-mark,
  .hero-title,
  .hero-lede {
    animation: rise 0.9s var(--ease-out) both;
  }

  .hero .eyebrow {
    animation-delay: 0.05s;
  }

  .hero-mark {
    animation-delay: 0.15s;
  }

  .hero-title {
    animation-delay: 0.25s;
  }

  .hero-lede {
    animation-delay: 0.35s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- GDPR confirmation page ---------- */

.gdpr-page {
  padding-block: clamp(40px, 7vw, 84px);
  flex: 1 0 auto;
}

.gdpr-card {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-sm);
}

.gdpr-loading {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

.gdpr-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.gdpr-title {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.gdpr-lede {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.gdpr-list {
  margin: 22px 0 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.9688rem;
  line-height: 1.6;
}

.gdpr-list li {
  margin-top: 10px;
}

.gdpr-warning {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.gdpr-warning strong {
  color: var(--warn);
}

.gdpr-alert {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  color: var(--bad);
  font-size: 0.9375rem;
}

.gdpr-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
  cursor: pointer;
}

.gdpr-check input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: none;
}

.gdpr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.gdpr-help {
  margin-top: 22px;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.gdpr-reference {
  margin-top: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.button.danger {
  background: var(--bad);
  color: #fff;
}

.button.danger:hover {
  background: color-mix(in srgb, var(--bad) 85%, black);
}

altcha-widget {
  --altcha-max-width: 100%;
  --altcha-padding: 13px;
  --altcha-border-width: 1px;
  --altcha-border-radius: 14px;
  --altcha-color-base: var(--surface);
  --altcha-color-base-content: var(--text);
  --altcha-color-primary: var(--accent);
  --altcha-color-primary-content: #ffffff;
  --altcha-color-neutral: var(--text-secondary);
  --altcha-color-neutral-content: var(--text);
  --altcha-color-success: var(--ok);
  --altcha-color-error: var(--bad);
  --altcha-shadow: none;
  display: block;
  margin-top: 20px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: clamp(28px, 6vw, 40px);
  }

  .hero-visual {
    order: -1;
    justify-content: flex-start;
  }

  .hero-mark {
    width: clamp(220px, 52vw, 330px);
  }

  .hero-copy {
    max-width: none;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-kicker {
    padding-top: 0;
  }
}

@media (max-width: 480px) {
  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }

  .contact-list li {
    flex-direction: column;
    gap: 2px;
  }
}
