/* ==========================================================================
   Ironyx — Base: reset, typography, layout primitives, a11y, JS states
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  scroll-padding-top: calc(var(--nav-top) + var(--nav-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-feature-settings: var(--font-features);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ul[role="list"], ol[role="list"], .list-reset { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: inherit;
  line-height: 1.2;
  overflow-wrap: break-word;
}

img, svg, video, canvas, picture { display: block; max-width: 100%; }
img, video { height: auto; }
svg { flex-shrink: 0; }
svg:not([fill]) { fill: currentColor; }
img { border-style: none; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { margin: 0; }
textarea { resize: vertical; }
table { border-collapse: collapse; border-spacing: 0; }
hr { border: 0; height: 1px; background: var(--border); margin: 0; }
[hidden] { display: none !important; }
:where(p, li) { text-wrap: pretty; }

/* ---- Selection, focus, scrollbar ---------------------------------------- */
::selection { background: rgba(218, 78, 36, .55); color: #fff; }

:focus { outline: none; }
[tabindex="-1"]:focus-visible { outline: none; }
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn:focus-visible { border-radius: var(--r-12); }

html { scrollbar-color: #2a2a2a #000; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #242424; border-radius: 99px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ---- Typography utilities ----------------------------------------------- */
.h1, .h2, .h2-alt, .h3, .h4, .display {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
}
.display { font-size: var(--fs-display); line-height: .92; letter-spacing: var(--ls-display); }
.h1     { font-size: var(--fs-h1);     line-height: var(--lh-h1);     letter-spacing: var(--ls-tight); }
.h2     { font-size: var(--fs-h2);     line-height: var(--lh-h2);     letter-spacing: var(--ls-tight); }
.h2-alt { font-size: var(--fs-h2-alt); line-height: var(--lh-h2-alt); letter-spacing: var(--ls-tight); }
.h3     { font-size: var(--fs-h3);     line-height: var(--lh-h3);     letter-spacing: var(--ls-snug); }
.h4     { font-size: var(--fs-h4);     line-height: var(--lh-h4);     letter-spacing: var(--ls-snug); }

.text-l { font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
.text   { font-size: var(--fs-body);   line-height: var(--lh-body); }
.small  { font-size: var(--fs-small);  line-height: var(--lh-small); font-weight: 500; }
.xs     { font-size: var(--fs-xs);     line-height: var(--lh-xs); }

.muted   { color: var(--text-2); }
.muted-2 { color: var(--text-3); }
.white   { color: var(--text); }
.accent  { color: var(--orange); }
.accent-blue { color: var(--blue); }
.medium  { font-weight: 500; }
.semibold { font-weight: 600; }
.upper   { text-transform: uppercase; letter-spacing: var(--ls-eyebrow); }
.tabular { font-variant-numeric: tabular-nums; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.balance { text-wrap: balance; }   /* never on [data-split] elements */

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* SplitText pieces inside a .gradient-text receive their own clipped slice of the gradient (split.js) */
.gradient-text.is-split { background: none; }
.gradient-piece {
  background-image: var(--grad-text);
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* room for descenders (g, y, p) on tight line-heights: background-clip:text only paints inside the box */
  padding-bottom: .18em;
  margin-bottom: -.18em;
}

/* ---- Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--head-gap);
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: var(--head-mb);
  text-align: center;
}
.section-head > .eyebrow { margin-bottom: 2px; }
.section-head p { color: var(--text-2); max-width: 620px; }
.section-head--left {
  align-items: flex-start;
  text-align: left;
  margin-inline: 0;
}
.section-head--left p { max-width: 560px; }
.section-head--flush { margin-bottom: 0; }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.wrap    { flex-wrap: wrap; }
.gap-2   { gap: var(--space-2); }
.gap-3   { gap: var(--space-3); }
.gap-4   { gap: var(--space-4); }
.gap-6   { gap: var(--space-6); }
.gap-8   { gap: var(--space-8); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-row--center { justify-content: center; }

.divider {
  height: 1px;
  border: 0;
  background: var(--border);
}
.divider--fade { background: var(--grad-hairline); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: var(--z-skip);
  padding: 10px 16px;
  border-radius: var(--r-8);
  background: #fff;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  transform: translateY(-160%);
  transition: transform .25s var(--ease-out);
}
.skip-link:focus-visible { transform: none; outline-color: var(--orange); }

/* ---- Smooth scroll wrapper ---------------------------------------------- */
#smooth-wrapper { position: relative; }
#smooth-content { position: relative; overflow-x: clip; }  /* no horizontal scroll from wide glows */
main { position: relative; z-index: 1; display: block; }  /* sits above .footer__glow */

/* ---- JS / progressive enhancement states -------------------------------- */
/* Content is fully visible without JS. With JS, reveal/split targets stay hidden only
   until main.js arms them (GSAP writes inline styles), then html.is-ready lifts this rule. */
html.js:not(.is-ready) :is([data-reveal], [data-split]) { visibility: hidden; }
/* Sections are initialised one by one (hero first): each one lifts the gate for itself as soon
   as its module has armed its states (main.js adds .is-armed), without waiting for the rest. */
html.js:not(.is-ready) .is-armed :is([data-reveal], [data-split]) { visibility: inherit; }
/* Failsafe (set by the inline head script if main.js never boots) */
html.reveal-failsafe :is([data-reveal], [data-split]) {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
html.no-js .js-only { display: none !important; }
html.js .no-js-only { display: none !important; }

/* Split text: avoid kerning jumps when splitting chars */
[data-split="chars"] { font-kerning: none; }

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.js:not(.is-ready) :is([data-reveal], [data-split]) { visibility: visible; }
}
/* Visitor turned animations off (footer button, remembered in localStorage) */
html.motion-off *, html.motion-off *::before, html.motion-off *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html.motion-off.js:not(.is-ready) :is([data-reveal], [data-split]) { visibility: visible; }
