/* Reset, fonts, typography, layout primitives. */

/* ---------- Fonts (self-hosted, latin subset, variable) ---------- */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis owns scrolling */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(91, 140, 255, 0.35);
  color: #fff;
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-head);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  letter-spacing: -0.04em;
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--fs-h3);
}

p {
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-dim);
  max-width: 46ch;
}

/* No eyebrow labels. A mono-uppercase "WHAT WE DO" above a heading that already says what we do
   is decoration standing in for design, the heading carries the section, and where it needs
   support it gets a real sentence (.section-head__note), not a label. */

.grad-text {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Layout ---------- */

.container {
  width: var(--container);
  margin-inline: auto;
}

.container-narrow {
  width: var(--container-narrow);
  margin-inline: auto;
}

/* Every section states where it starts. A hairline plus an alternating ground is enough. Both
   grounds are near-black, so the page stays monochrome while a visitor can still see one block
   end and the next begin. Without this the whole page read as one undifferentiated scroll. */
.section {
  position: relative;
  padding-block: var(--space-5);
  border-top: 1px solid var(--glass-border);
}

.section--raised {
  background: var(--bg-elev);
}

/* The section a visitor is meant to act in gets the most air. */
.section--act {
  padding-block: var(--space-5);
}

/* Editorial section head: the heading holds the left, a supporting sentence sits with it on the
   right, and a hairline closes the block. The rule is the only ornament, and it earns its place
   by separating the head from the content rather than labelling it. */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-2) var(--space-4);
  align-items: end;
  /* Was --space-4 / --space-3 (90px + 32px at desktop). Combined with each block's own top
     padding that left a hole between a heading and its content which read as a mistake, not air. */
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--glass-border);
}

/* Headings want to land on two lines, not three stubby ones. */
.section-head h2 {
  max-width: 17ch;
}

.section-head__note {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 42ch;
  padding-bottom: 0.35em; /* sits on the heading's baseline, not its descender */
}

@media (max-width: 820px) {
  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: var(--space-2);
  }

  .section-head__note {
    padding-bottom: 0;
  }
}

.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: -100%;
  left: var(--space-2);
  z-index: calc(var(--z-nav) + 1);
  padding: 0.75rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--glass-border-lit);
  border-radius: var(--radius-pill);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ---------- Atmosphere ---------- */

/* Film grain so the dark background doesn't read as flat black. */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Soft gradient orb used behind sections. Position with inline style or a modifier. */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* One orb, one colour. There is no second accent to differentiate. */
.orb--accent {
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
}

/* Hairline divider with a lit centre. */
.hairline {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--glass-border-lit), transparent);
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .grain {
    display: none;
  }
}

/* A closing line that hands the visitor to the next step. Sections that end on a wall of cards
   give a reader nowhere to go; this is the "and now what" answer. */
.section-out {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--glass-border);
  color: var(--text-dim);
}
