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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  height: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: auto;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
}

::selection {
  background: rgba(201, 162, 39, 0.35);
  color: #0b1f3a;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Prefer keyboard-visible focus without fighting mouse clicks */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--ems-mid);
  outline-offset: 2px;
}

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.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: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-xs);
  background: var(--ems);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.skip-link:focus {
  top: 1rem;
}

/* Ambient background */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: orb-drift 18s var(--ease) infinite alternate;
}

.bg-orb-a {
  width: 520px;
  height: 520px;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(0, 87, 184, 0.18), transparent 68%);
}

.bg-orb-b {
  width: 460px;
  height: 460px;
  top: -8%;
  right: -6%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.18), transparent 68%);
  animation-delay: -6s;
}

.bg-orb-c {
  width: 480px;
  height: 480px;
  bottom: -18%;
  left: 35%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.12), transparent 70%);
  animation-delay: -11s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 63, 135, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 63, 135, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 24px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb { animation: none; }
  html { scroll-behavior: auto; }
}
