@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-optical-sizing: auto;
  font-display: swap;
  src: url("../fonts/newsreader.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
}
h1, h2 { font-family: "Inter", system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

html, body { min-height: 100%; }

body {
  min-height: 100dvh;
  background: var(--gradient-washed-fog);
  color: var(--text-primary);
  /* Body: 15px / 1.65 per typography guidelines */
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

@supports not (overflow: clip) {
  body { overflow-x: hidden; }
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body.home {
  /* Layout contract - edit tokens here, not scattered calcs (see LAYOUT.md) */
  --layout-break: 820px;
  --page-pad-y: clamp(3rem, 6vw, 3rem);
  --page-pad-x: clamp(1.5rem, 4vw, 3rem);
  --header-float: 0;
  --header-float-top: var(--space-6);
  --header-block-gap: var(--space-4);
  --header-offset: calc(var(--header-float-top) + var(--logo-size) + var(--header-block-gap));
  --content-max-width: 72rem;
  --content-width: min(var(--content-max-width), calc(100% - 2 * var(--page-pad-x)));
  --home-content-width: var(--content-width);
  --home-feature-block-min-height: min(50vh, 26rem);
  --foundation-pillar-min-height: min(50vh, 26rem);
  --home-stroke-icon-size: clamp(3.25rem, 6.5vmin, 4rem);
  --home-net-line: rgba(213, 223, 229, 0.14);
  --home-net-pattern:
    repeating-linear-gradient(0deg, var(--home-net-line) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, var(--home-net-line) 0 1px, transparent 1px 24px);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0;
  background: #ffffff;
}

/* Home content column - single source for section inner width */
body.home .content-snap-inner {
  width: var(--home-content-width);
  max-width: var(--content-max-width);
  margin-inline: auto;
}

body.page {
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
}

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

/* ─── Focus ring - required on all interactive elements (WCAG AA) ─── */
:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ─── Top rule ─── */
.top-rule {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-subtle) 12%, var(--border-subtle) 88%, transparent 100%);
  animation: grow 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  pointer-events: none;
}

/* ─── Keyframes ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes grow { from { width: 0; } to { width: 100%; } }

/* ─── Mobile: skip entrance / continuous motion (not prefers-reduced-motion) ─── */
@media (max-width: 820px) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
  /* Make all animated elements immediately visible */
  .site-header, .hero-tagline, .hero-statement, .hero-visual, .scroll-hint,
  .content-snap, .product-snap, .platform-snap, .foundation-snap, .products-intro, .product-list,
  .skill-hero, .skill-icon, .site-footer, .page-footer,
  .foundation-pillar {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
