/* ==========================================================================
   Setheun Development Interactive
   core.css — tokens, reset, typography, layout shell, motion primitives

   Hard constraints for this project:
   - No gradient functions of any kind. Every fill is one flat colour value.
   - No box-shadows used as glow. Depth comes from hairlines and flat planes.
   - Animate transform / opacity / clip-path / grid-template-rows only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* --- Neutrals. Every one tinted to the brand hue 258. No pure #000/#fff. */
  --void: oklch(0.11 0.012 258);
  --surface: oklch(0.155 0.014 258);
  --surface-2: oklch(0.2 0.016 258);
  --line: oklch(0.28 0.018 258);
  --line-2: oklch(0.4 0.02 258);
  --line-3: oklch(0.52 0.022 258);

  --ink: oklch(0.97 0.005 258);
  --ink-2: oklch(0.76 0.012 258);
  --ink-3: oklch(0.58 0.014 258);

  /* --- Blue. Committed strategy: structural, not a 10% accent.
     --blue is pinned at the lightness where --ink on it clears 4.5:1, which
     is the constraint that sets the whole scale. There is no headroom to go
     lighter on hover without failing that, so --blue-hot goes darker: on a
     black canvas a deepening fill reads as engaged anyway. */
  --blue: oklch(0.535 0.205 257);
  --blue-hot: oklch(0.485 0.195 257);
  --blue-lit: oklch(0.78 0.145 252);
  --blue-deep: oklch(0.33 0.13 260);
  --blue-edge: oklch(0.47 0.15 258);
  --blue-rule: oklch(0.62 0.15 256);

  /* --- Type */
  --font: "Archivo", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* The hero headline now runs the full shell width, so --t-mega can go big
     again; the cap keeps the longest word inside 1320px. */
  --t-mega: clamp(3rem, 10vw, 8.5rem);
  --t-xl: clamp(2.2rem, 5vw, 4rem);
  --t-lg: clamp(1.7rem, 3vw, 2.6rem);
  --t-md: clamp(1.25rem, 1.8vw, 1.55rem);
  --t-body: clamp(1rem, 1.05vw, 1.0625rem);
  --t-sm: 0.9375rem;
  --t-xs: 0.8125rem;
  --t-xxs: 0.6875rem;

  /* --- Space & shell */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --shell: min(1320px, 100% - 2 * var(--gutter));
  --measure: 68ch;

  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: clamp(3.5rem, 8vw, 6rem);
  --s-9: clamp(5rem, 12vh, 9rem);

  /* --- Geometry. Near-zero radii: instrument panel, not Roblox default. */
  --r: 2px;
  --hair: 1px;
  --rail: 68px;

  /* --- Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --d-1: 120ms;
  --d-2: 220ms;
  --d-3: 420ms;
  --d-4: 700ms;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  /* No smooth-scroll override. Native scrolling is what the visitor's
     device and settings already do; hijacking it only adds latency. */
  scroll-padding-top: calc(var(--rail) + var(--s-6));
}

body {
  min-height: 100vh;
  background-color: var(--void);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: 400;
  font-stretch: 100%;
  /* Light type on a dark canvas reads thinner; buy it extra leading. */
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  height: auto;
  background-color: var(--surface);
}

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

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: 0;
  border-top: var(--hair) solid var(--line);
}

::selection {
  background-color: var(--blue);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   3. Focus
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--blue-lit);
  outline-offset: 3px;
  border-radius: var(--r);
}

.skip {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 200;
  padding: 0.6rem 1rem;
  background-color: var(--blue);
  color: var(--ink);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform var(--d-2) var(--ease-out);
}

.skip:focus-visible {
  transform: none;
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

/* Contrast comes from the Archivo width axis, not a second family. */

h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.t-mega {
  font-size: var(--t-mega);
  font-stretch: 118%;
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.t-xl {
  font-size: var(--t-xl);
  font-stretch: 112%;
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.t-lg {
  font-size: var(--t-lg);
  font-stretch: 106%;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.t-md {
  font-size: var(--t-md);
  font-stretch: 103%;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 46ch;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  letter-spacing: -0.012em;
}

.prose {
  max-width: var(--measure);
  color: var(--ink-2);
}

.prose p + p {
  margin-top: 1.1em;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose a {
  color: var(--blue-lit);
  border-bottom: var(--hair) solid var(--blue-edge);
  transition: color var(--d-1) var(--ease-out), border-color var(--d-1) var(--ease-out);
}

.prose a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Mono is for numerals and short data labels only. Never for prose,
   and never as a decorative kicker above every section heading. */
.mono {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

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

/* --------------------------------------------------------------------------
   5. Layout shell
   -------------------------------------------------------------------------- */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

main {
  display: block;
}

.band {
  padding-block: var(--s-8);
  position: relative;
}

.band-tight {
  padding-block: var(--s-7);
}

.band-blue {
  background-color: var(--blue-deep);
}

.band-line {
  border-top: var(--hair) solid var(--line);
}

/* Section header: heading, then a hairline consuming the remaining width.
   No repeated uppercase kicker labels. */
.sechead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-6);
}

.sechead h2 {
  flex: 0 0 auto;
}

.sechead .rule {
  flex: 1 1 2rem;
  min-width: 2rem;
  height: 0;
  border-top: var(--hair) solid var(--line);
}

.sechead .count {
  flex: 0 0 auto;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Visible 12-column hairline grid. Built from real elements so the project
   contains zero gradient functions. Decorative only. */
.grid-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  pointer-events: none;
  z-index: 0;
}

.grid-lines span {
  border-left: var(--hair) solid var(--line);
  opacity: 0.55;
}

.grid-lines span:first-child {
  border-left-color: transparent;
}

@media (min-width: 900px) {
  .grid-lines {
    grid-template-columns: repeat(12, 1fr);
  }
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

/* --------------------------------------------------------------------------
   6. Motion

   The whole motion budget for this site is listed here, and it is short on
   purpose. There is no scroll-triggered reveal system, no counting numbers,
   no page-transition fade, no parallax and no ambient loop. Sections are
   simply present when you scroll to them.

   What is left:
   - one masked line reveal on the page heading, once, on load
   - the nav rail gaining a background when the page is scrolled
   - hover and focus feedback on things that are actually interactive
   - the mobile menu opening
   -------------------------------------------------------------------------- */

/* Masked line reveal for the page heading. Overflow clip plus translate, so
   no layout property is animated. Runs once. */
.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.09em;
}

.mask > span {
  display: block;
  transform: translateY(125%);
  transition: transform var(--d-4) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.is-loaded .mask > span {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   7. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .mask > span {
    transform: none;
  }
}

/* Class mirror of the media query, set by app.js from the same source of
   truth so the heading is simply in place rather than animating in. */
.no-motion .mask > span {
  transform: none;
  transition: none;
}

/* --------------------------------------------------------------------------
   8. Utilities
   -------------------------------------------------------------------------- */

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}
