/* Base reset, typography, sections, scroll-reveal primitives. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Keep anchor targets clear of the sticky/fixed header. */
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Any element that can be jumped to needs the same offset when it is the
   scroll target itself (scroll-padding on html does not cover all engines). */
[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  font-family: var(--font-family-sans);
  /* Mobile drawer open — set by site.js */
  overflow-x: hidden;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-primary-text-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-display);
  color: var(--color-heading);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-4);
  letter-spacing: -0.03em;
  font-weight: var(--font-weight-bold);
}

/* Fluid type: headings scale with the viewport instead of overflowing on
   narrow phones and looking undersized on large monitors. */
h1 {
  font-size: clamp(2rem, 1.45rem + 2.6vw, var(--font-size-4xl));
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.625rem, 1.3rem + 1.6vw, var(--font-size-3xl));
  font-weight: var(--font-weight-bold);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.375rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 var(--space-4);
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

body.nav-open {
  overflow: hidden;
}

.visually-hidden {
  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;
  top: var(--space-2);
  left: var(--space-2);
  z-index: calc(var(--z-header) + 10);
  padding: var(--space-2) var(--space-4);
  background: var(--gradient-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-default);
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target-min);
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition:
    background var(--duration-fast) var(--ease-default),
    color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default),
    transform var(--duration-fast) var(--ease-default);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--color-primary-glow);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-bg-elevated);
  color: var(--color-primary-text);
  border-color: rgba(59, 130, 246, 0.45);
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-primary-text-hover);
  border-color: var(--color-primary);
  box-shadow: 0 0 16px var(--color-primary-glow);
}

/* Secondary button placed on the dark hero / dark CTA surfaces */
.hero-banner .btn-secondary,
.page-header .btn-secondary,
.site-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
}

.hero-banner .btn-secondary:hover,
.page-header .btn-secondary:hover,
.site-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #fff;
}

.section {
  padding: var(--space-12) 0;
  position: relative;
}

@media (max-width: 767px) {
  .section {
    padding: var(--space-10) 0;
  }
}

.section-subtle {
  background: var(--color-bg-subtle);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

.section-header {
  margin-bottom: var(--space-8);
  max-width: 42rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal[data-reveal] {
    opacity: 1;
    transform: none;
  }

  .reveal-child {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    filter: blur(8px);
    transition:
      opacity var(--duration-slower) var(--ease-out-expo),
      transform var(--duration-slower) var(--ease-out-expo),
      filter var(--duration-slower) var(--ease-out-expo);
    will-change: opacity, transform, filter;
  }

  .reveal.is-visible .reveal-child {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: calc(var(--z-header) + 20);
  height: 3px;
  width: 0;
  background: var(--gradient-primary);
  box-shadow: 0 0 12px var(--color-accent-glow);
  pointer-events: none;
}

