@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0b1220;
  --surface: #0f1a2e;
  --border: rgba(130, 175, 220, 0.08);
  --text: #e8eef6;
  --text-secondary: #7a93b0;
  --accent: #3d9be9;
  --accent-glow: rgba(61, 155, 233, 0.15);
  --grain-opacity: 0.03;
}

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

html {
  color-scheme: dark;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  font-family: "Instrument Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.01em;
  overflow-x: hidden;
  position: relative;
}

/* ── Ambient background ── */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(30, 100, 180, 0.12), transparent),
    radial-gradient(ellipse 50% 50% at 80% 100%, rgba(20, 60, 120, 0.08), transparent);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
  opacity: var(--grain-opacity);
  pointer-events: none;
}

/* ── Page layout ── */

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(2rem, 8vw, 8rem);
  position: relative;
}

/* ── Hero ── */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 64rem;
  gap: clamp(2.5rem, 5vw, 4rem);
}

/* ── Brand ── */

.brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  animation: fade-up 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-mark {
  width: clamp(3rem, 6vw, 3.8rem);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(61, 155, 233, 0.2));
}

.brand-name {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.25rem;
}

.brand-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background: var(--text-secondary);
}

/* ── Copy ── */

.hero-copy {
  display: grid;
  gap: clamp(1.2rem, 2.5vw, 1.8rem);
  animation: fade-up 800ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.035em;
  max-width: 16ch;
  text-wrap: balance;
  background: linear-gradient(180deg, var(--text) 40%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.05em;
}

.hero-copy p {
  max-width: 42rem;
  font-size: clamp(1.05rem, 1vw + 0.5rem, 1.2rem);
  line-height: 1.75;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ── Contact ── */

.contact {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fade-up 800ms cubic-bezier(0.16, 1, 0.3, 1) 240ms both;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.contact a {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 520;
  text-decoration: none;
  position: relative;
  transition: color 300ms;
}

.contact a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms;
}

.contact a:hover {
  color: #6bb8f0;
}

.contact a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
  opacity: 0.6;
}

.contact a:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 0.3rem;
  border-radius: 0.15rem;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  animation: fade-up 800ms cubic-bezier(0.16, 1, 0.3, 1) 320ms both;
}

.legal-links a,
.policy-home {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 520;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 300ms;
}

.legal-links a:hover,
.policy-home:hover {
  color: var(--text);
}

.legal-links a:focus-visible,
.policy-home:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 0.3rem;
  border-radius: 0.15rem;
}

/* ── Decorative line ── */

.hero::after {
  content: "";
  position: fixed;
  left: clamp(2rem, 8vw, 8rem);
  bottom: 0;
  width: 1px;
  height: 30vh;
  background: linear-gradient(to top, var(--border), transparent);
  animation: line-reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 500ms both;
}

/* ── 404 overrides ── */

.not-found .hero-copy h1 {
  max-width: 10ch;
}

.not-found .hero-copy p {
  max-width: 30rem;
}

.not-found .contact {
  border-top: 0;
  padding-top: 0;
}

/* ── Policy pages ── */

.policy-page .page {
  display: block;
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(2rem, 6vw, 4rem);
}

.policy-shell {
  max-width: 56rem;
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
}

.policy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: fade-up 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.policy-header .brand {
  animation: none;
}

.policy-card {
  display: grid;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(15, 26, 46, 0.95), rgba(11, 18, 32, 0.92));
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: 0 24px 80px rgba(3, 10, 22, 0.35);
  animation: fade-up 800ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

.policy-intro {
  display: grid;
  gap: 0.85rem;
}

.policy-kicker {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.policy-card h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.policy-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 44rem;
}

.policy-sections {
  display: grid;
  gap: 1.75rem;
}

.policy-sections section {
  display: grid;
  gap: 0.85rem;
}

.policy-sections h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.policy-sections p,
.policy-sections li {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.policy-sections ul {
  display: grid;
  gap: 0.6rem;
  padding-left: 1.2rem;
}

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

.policy-sections a,
.policy-aside a {
  color: var(--accent);
  text-decoration: none;
  transition: color 300ms;
}

.policy-sections a:hover,
.policy-aside a:hover {
  color: #6bb8f0;
}

.policy-sections a:focus-visible,
.policy-aside a:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 0.3rem;
  border-radius: 0.15rem;
}

.policy-aside {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

/* ── Animations ── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-reveal {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ── Responsive ── */

@media (max-width: 42rem) {
  .page {
    padding: 1.5rem;
  }

  .hero::after {
    left: 1.5rem;
  }

  .contact,
  .policy-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .policy-card h1 {
    max-width: none;
  }
}

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