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

html {
  scroll-behavior: smooth;
  /* Anchors land below the fixed header instead of underneath it */
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  /* Brand backdrop */
  background:
    radial-gradient(ellipse 70% 50% at 50% 108%, rgba(240,123,63,0.14) 0%, transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(45,64,89,0.35) 0%, transparent 65%),
    var(--bg-base);
  background-attachment: fixed;
  color: var(--tx1);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; position: relative; z-index: var(--z-content); }

img, svg, video { max-width: 100%; height: auto; }
img { border: 0; }

a { color: var(--tx-link); }

/* Headings*/
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: var(--lh-tight);
  color: var(--tx-strong);
}

/* Accessibility */

/* Screen readers */
.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-to-content link, first tab key */
.skip-link {
  position: absolute;
  inset-inline-start: 0;
  top: -100%;
  z-index: var(--z-skip);
  background: var(--brand-yellow);
  color: var(--btn-tx);
  padding: 0.8rem 1.4rem;
  font-size: var(--fs-xsmall);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
/* Remove focus ring */
@supports selector(:focus-visible) {
  :focus:not(:focus-visible) { outline: none; }
}

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

/* High contrast */
@media (forced-colors: active) {
  .glass-card, .btn-primary, .btn-ghost, .btn-submit { border: 1px solid ButtonText; }
}

/*  No JavaScript fallback  */
.noscript-message {
  position: relative;
  z-index: var(--z-nav);
  margin: 0;
  padding: 0.9rem 1.25rem;
  background: var(--err-bg);
  border-bottom: 1px solid var(--brand-red);
  color: var(--tx1);
  font-size: var(--fs-small);
  text-align: center;
}
.noscript-message a { color: var(--brand-yellow); }

/* Hide elements that absolutely require JS */
html.no-js [data-requires-js] { display: none !important; }

/*  Background progressive enhancement  */
#bg-canvas {
  position: fixed; inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  opacity: 1;
}

#sol-glow {
  position: fixed; inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%,
              var(--glow) 0%, rgba(240, 123, 63, 0.07) 42%, transparent 68%);
}

/* Utilities */
.text-center { text-align: center; }
.mx-auto    { margin-inline: auto; }
.stack > * + * { margin-top: var(--space-3); }
