/* ==========================================================================
   G Factor — Base
   Reset · Type · Layout · Atmosphere · Text and media motion
   ========================================================================== */

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

@view-transition {
  navigation: auto;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 24px);
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote,
address {
  margin: 0;
}

address {
  font-style: normal;
}

:where(ul, ol)[role="list"] {
  list-style: none;
  padding: 0;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

::selection {
  background: var(--violet-hi);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--violet-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Type ---------- */
h1,
h2,
h3 {
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -0.038em;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.12;
  letter-spacing: -0.024em;
}

p {
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--text-2);
}

.mono {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.02em;
}

.dim {
  color: var(--text-3);
}

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

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-sm);
  transform: translateY(-150%);
  transition: transform 0.25s var(--ease);
}

.skip:focus {
  transform: none;
}

/* ---------- Layout ---------- */
.wrap {
  --bleed: max(var(--gutter), calc((100vw - var(--max)) / 2));
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

/* Grid children may shrink below their content: aspect-ratio + min-height would
   otherwise convert into a minimum width wider than the viewport. */
.grid > * {
  min-width: 0;
}

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

.section-head {
  display: grid;
  gap: var(--s2);
  margin-bottom: var(--s6);
}

.section-head h2 {
  max-width: 16ch;
}

.section-head .lead {
  max-width: 44ch;
}

@media (min-width: 1000px) {
  .section-head--split {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: end;
  }

  .section-head--split h2 {
    grid-column: 1 / span 7;
  }

  .section-head--split .lead {
    grid-column: 9 / span 4;
  }
}

/* ---------- Atmosphere ---------- */
.glow-floor {
  position: relative;
  isolation: isolate;
}

.glow-floor::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 70%;
  z-index: -2;
  background: radial-gradient(70% 90% at 50% 100%, rgba(var(--glow-rgb), 0.5), rgba(53, 22, 198, 0.18) 45%, transparent 75%);
  pointer-events: none;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.09;
  mix-blend-mode: overlay;
}

.hairgrid {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ---------- Motion: text ----------
   Headings rise word by word through a mask. */
.js [data-split] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.js [data-split] .wi {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease);
  transition-delay: calc(var(--n, 0) * 38ms);
}

.js [data-split].is-in .wi {
  transform: none;
}

/* ---------- Motion: blocks ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Media opens like a shutter, once. */
.js [data-open] > * {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.3s var(--ease);
}

.js [data-open].is-in > * {
  clip-path: inset(0 -20% -20% -20%);
}

@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;
    transition-delay: 0ms !important;
  }

  .js [data-split] .wi,
  .js [data-reveal] {
    transform: none;
    opacity: 1;
  }

  .js [data-open] > * {
    clip-path: none;
  }
}
