/* 0Labs website styles.
   Tokens mirror tokens/brand.json. Use the variables below, never raw colour values. */

/* ---------- Fonts (self-hosted, OFL — licences in /assets/fonts) ---------- */
@font-face {
  font-family: "Spectral";
  src: url("/assets/fonts/spectral-300-latin.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ServerMono";
  src: url("/assets/fonts/servermono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper-50: #FFFFFF;
  --paper-100: #FBFBFB;
  --paper-200: #F4F4F5;
  --paper-300: #E8E8EA;
  --paper-400: #D4D4D8;

  --ink-100: #E4E4E7;
  --ink-200: #C8C8CD;
  --ink-300: #A1A1A8;
  --ink-400: #8A8A93;
  --ink-500: #71717A;
  --ink-600: #52525B;
  --ink-700: #3F3F46;
  --ink-800: #27272A;
  --ink-900: #18171C;
  --ink-950: #0C0B0E;

  --primary-500: #00FF66;
  --primary-600: #00D455;

  /* Headlines: Spectral Light stands in for Kai on the web (Kai's file isn't web-licensed). */
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "ServerMono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 4px;
  --frame: 1200px;
  --gutter: 16px;

  /* Motion: matches the old site's hover timing (fast start, gentle finish). */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.5s;

  /* Semantic (brand.json "semantic") */
  --bg-page: var(--paper-100);
  --bg-dark: var(--ink-900);
  --text-primary: var(--ink-900);
  --text-body: var(--ink-600);
  --text-muted: var(--ink-500);
  --text-inverse: var(--paper-100);
  --border: var(--paper-300);
  --border-dark: var(--ink-800);
}

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

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3, .display-l { text-wrap: balance; }
p { text-wrap: pretty; }
img, svg, canvas { display: block; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--ink-900);
  outline-offset: 3px;
}
.on-dark :focus-visible { outline-color: var(--primary-500); }

.visually-hidden {
  position: absolute !important;
  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;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink-900);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--gutter); }

/* ---------- Layout ---------- */
.frame {
  width: min(var(--frame), 100% - 2 * var(--gutter));
  margin-inline: auto;
  border-inline: 1px solid var(--border);
}
.container {
  width: min(var(--frame), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Footer reveal: the page (main) scrolls up like a curtain over a footer that stays
   pinned to the bottom of the screen. Short screens get a normal footer instead. */
main {
  position: relative;
  z-index: 1;
  background: var(--bg-page);
}

/* ---------- Type ---------- */
.display-xl {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.75rem, 1.4rem + 4.4vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.display-l {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.625rem, 1.15rem + 2.2vw, 2.625rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Text links: underline sweeps in from the left on hover and out to the right. */
.link {
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
  text-decoration: none;
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dur) var(--ease-out);
}
.link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}
.link:active { opacity: 0.7; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    transform 0.25s var(--ease-out);
}
.btn:active { transform: scale(0.97); }

/* Text roll on hover: the label slides up and an identical copy rises from below. */
.btn__label {
  position: relative;
  display: block;
  height: 1.25em;
  overflow: hidden;
  line-height: 1.25;
}
.btn__text {
  display: block;
  transition: transform var(--dur) var(--ease-out);
}
.btn__text--clone {
  position: absolute;
  left: 0;
  top: 100%;
}
.btn:focus-visible .btn__text { transform: translateY(-100%); }

.btn__arrow {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform var(--dur) var(--ease-out);
}
.btn:focus-visible .btn__arrow { transform: translateX(4px); }

.btn--primary { background: var(--primary-500); color: var(--ink-900); }
.btn--ink { background: var(--ink-900); color: var(--text-inverse); }

/* Hover effects only where hovering exists, so they don't stick after a tap on touch screens. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__text { transform: translateY(-100%); }
  .btn:hover .btn__arrow { transform: translateX(4px); }
  .btn--primary:hover { background: var(--primary-600); }
  .btn--ink:hover { background: var(--ink-700); }
  .link:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

.btn--small { padding: 10px 16px; font-size: 0.875rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding-inline: 16px;
}
.brand { display: inline-flex; padding: 8px 0; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav__link {
  padding-top: 3px; /* balances the underline space below, so the text centres on the button */
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }
.brand__img { height: 28px; width: auto; }

/* ---------- Hero ---------- */
.hero { background: var(--bg-page); }
.hero__frame {
  position: relative;
  overflow: hidden;
  padding: clamp(104px, 13vw, 184px) 24px clamp(104px, 12vw, 172px);
  text-align: center;
}
.ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__ascii {
  color: var(--ink-400);
  --ascii-alpha: 0.8;
}
.hero__content {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
}
.hero__title { margin-bottom: 24px; }
.hero__lede {
  max-width: 31em;
  margin: 0 auto 36px;
  color: var(--text-body);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.55;
}


/* ---------- Statement ---------- */
.statement__frame {
  padding: clamp(80px, 10vw, 136px) 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.statement__text {
  max-width: 22em;
  margin-inline: auto;
}

/* Load-in for .reveal text: main.js splits it into words that fade up from a slight blur,
   one after another, when it scrolls into view. head.js adds .js before first paint so the
   text starts hidden rather than flashing; without JS it simply shows. */
.js .reveal:not(.is-split) { opacity: 0; }
.js .reveal__word {
  display: inline-block;
  animation: word-in 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  animation-play-state: paused;
}
.js .reveal.is-in .reveal__word { animation-play-state: running; }
@keyframes word-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(0.18em);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* ---------- Pillars ---------- */
.pillars__frame { padding-bottom: clamp(72px, 9vw, 128px); }
.pillars__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 40px 68px;
  text-align: center;
}
.pillar + .pillar { border-left: 1px solid var(--border); }
/* Pillar icons are inline SVG (rebuilt from the brand kit PNGs) so pillars.js can rewire
   their dots on hover. The "goo" filter in each SVG melts dots and stems together. */
.pillar__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 32px;
  color: var(--ink-900);
  overflow: visible;
}
.pillar__index { margin-bottom: 10px; }
.pillar__title {
  margin-bottom: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.pillar__body {
  max-width: 36ch;
  color: var(--text-body);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ---------- Contact band ---------- */
.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(104px, 12vw, 168px) 24px;
  background: var(--bg-dark);
  color: var(--text-inverse);
  text-align: center;
}
.cta__ascii {
  color: var(--primary-500);
  --ascii-alpha: 0.45;
}
.cta__content {
  position: relative;
  max-width: 640px;
  margin-inline: auto;
}
.cta__title { margin-bottom: 16px; }
.cta__lede {
  margin-bottom: 36px;
  color: var(--ink-200);
  font-size: 1.0625rem;
}

/* ---------- Footer (revealed under the page) ---------- */
.site-footer {
  position: sticky;
  bottom: 0;
  z-index: 0;
  background: var(--ink-950);
  color: var(--text-inverse);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 48px;
  padding: 64px 0 72px;
}
.site-footer__tagline {
  max-width: 30ch;
  margin-top: 18px;
  color: var(--ink-300);
  font-size: 0.9375rem;
}
.site-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 72px;
}
.site-footer .label {
  margin-bottom: 14px;
  color: var(--ink-400);
}
.site-footer ul {
  padding: 0;
  list-style: none;
}
.site-footer__cols a {
  color: var(--text-inverse);
  font-size: 1rem;
}
.site-footer__bottom {
  padding: 20px 0 28px;
  border-top: 1px solid var(--border-dark);
  color: var(--ink-400);
  font-size: 0.8125rem;
}

/* ---------- Careers ---------- */
.careers__intro-frame {
  position: relative;
  overflow: hidden;
  padding: clamp(112px, 13vw, 184px) 24px clamp(88px, 10vw, 136px);
}
.careers__intro {
  position: relative;
  max-width: 640px;
}
.careers__title { margin-bottom: 24px; }
.careers__lede {
  max-width: 32em;
  color: var(--text-body);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.55;
}
.roles__frame { padding-bottom: clamp(72px, 9vw, 128px); }
.roles {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.roles__head {
  display: flex;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.roles__head .label { margin: 0; font-weight: 400; }
.roles__empty { padding: 40px 24px 44px; }
.roles__title {
  margin-bottom: 10px;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---------- 404 ---------- */
.notfound__frame {
  padding: clamp(112px, 14vw, 200px) 24px;
  text-align: center;
}
.notfound__title { margin: 14px 0 20px; }
.notfound__lede {
  max-width: 30em;
  margin: 0 auto 36px;
  color: var(--text-body);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .pillars__grid { grid-template-columns: 1fr; }
  .pillar { padding: 48px 24px 52px; }
  .pillar + .pillar { border-left: 0; border-top: 1px solid var(--border); }
}

/* Phones: the hero fills the first screen (headline centred, ASCII above and below),
   and spacing tightens to a steady rhythm. */
@media (max-width: 600px) {
  .site-header__inner { height: 60px; padding-inline: 12px; }
  .brand__img { height: 22px; }
  .btn--small { padding: 11px 16px; }
  .site-nav { gap: 20px; }
  .site-nav__link { font-size: 0.875rem; }
  .hero__frame {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 61px);
    min-height: calc(100svh - 61px);
    padding: 64px 16px 80px;
  }
  .hero__title { margin-bottom: 20px; }
  .hero__lede { margin-bottom: 32px; }
  .statement__frame { padding: 96px 20px; }
  .notfound__frame { padding-inline: 16px; }
  .careers__intro-frame { padding: 88px 16px 72px; }
  .roles__head { padding: 16px; }
  .roles__empty { padding: 32px 16px 36px; }
  .roles__title { font-size: 1.3125rem; }
  .roles__frame { padding-bottom: 48px; }
  .site-footer__cols { gap: 32px 40px; }
  .pillars__frame { padding-bottom: 48px; }
  .pillar { padding: 48px 24px 52px; }
  .pillar__icon { margin-bottom: 24px; }
  .cta { padding: 96px 20px; }
  .cta__lede { margin-bottom: 32px; }
  .site-footer__inner { padding: 48px 0 44px; gap: 36px; }
}

/* Very small phones: a slightly tighter header so the logo, Careers and Contact all breathe. */
@media (max-width: 360px) {
  .brand__img { height: 20px; }
  .site-nav { gap: 14px; }
  .btn--small { padding: 10px 13px; }
}

/* Landscape phones: a compact hero that fits the short screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header__inner { height: 56px; }
  .hero__frame {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 57px);
    min-height: calc(100svh - 57px);
    padding: 32px 24px 40px;
  }
  .hero__title { margin-bottom: 14px; font-size: clamp(2.25rem, 1rem + 4vw, 3rem); }
  .hero__lede { margin-bottom: 22px; }
}

/* Too short to pin the footer without hiding part of it. */
@media (max-height: 600px) {
  .site-footer { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal__word { animation: none; }
  .btn__text,
  .btn__arrow,
  .link::after { transition: none; }
}
