/* =============================================================
   GELCAM — Base: reset, typography, layout primitives, sections
   ============================================================= */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-relaxed);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 320ms var(--ease), color 320ms var(--ease);
}

img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--g-red); color: #fff; }

/* ---------- HEADINGS ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-snug);
  letter-spacing: var(--track-display);
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--t-4xl); line-height: var(--lh-tight); }
h2 { font-size: var(--t-3xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); font-weight: 700; }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
strong, b { font-weight: 700; color: var(--text); }

/* ---------- DISPLAY ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--t-5xl);
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- EYEBROW ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-eyebrow);
  color: var(--g-red);
  margin: 0 0 var(--s-4);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 2px;
  background: var(--g-red);
  display: inline-block;
}
.eyebrow.center { justify-content: center; }

.lead {
  font-size: var(--t-md);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
}

.mono { font-family: var(--font-mono); }

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding-inline: var(--s-6);
}
.container.narrow { max-width: var(--content-narrow); }

.section { padding-block: var(--s-10); position: relative; }
.section.tight { padding-block: var(--s-9); }
.section.bg-2 { background: var(--bg-2); }
.section.surface { background: var(--surface); }

/* dark band that holds in both themes */
.section.dark {
  background: var(--hero-to);
  color: #F3F5F8;
}
.section.dark h1, .section.dark h2, .section.dark h3, .section.dark h4 { color: #fff; }
.section.dark .lead { color: rgba(255,255,255,0.72); }
.section.dark p { color: rgba(255,255,255,0.66); }

/* ---------- SECTION HEADER ---------- */
.sec-head { max-width: 760px; margin-bottom: var(--s-8); }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head h2 { margin-bottom: var(--s-4); }
.sec-head .lead { margin: 0; }

/* ---------- TECH GRID BACKDROP ---------- */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

/* ---------- UTILITY ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: var(--s-4); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.text-red { color: var(--g-red); }
.text-muted { color: var(--text-muted); }
.center { text-align: center; }
.hide { display: none !important; }

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- RESPONSIVE TYPE ---------- */
@media (max-width: 720px) {
  .section { padding-block: var(--s-8); }
  .container { padding-inline: var(--s-5); }
}
