/* 1337.AI design system, shared by every page of this site.
   Matches the 1337.ai parent site: dark by default, light on request; Lab Mono
   (Noto Mono) for headings, labels and controls; Arial for running text;
   hairline rules; square corners; no colour except where data needs it. */

@font-face {
  font-family: 'Lab Mono';
  src: url('/assets/noto-mono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --fg: #eeeeec;
  --muted: #a1a19d;
  --soft: #82827e;
  --line: #2a2a29;
  --panel: #141414;
  --hover: #1b1b1b;
  --gain: #7fc79a;        /* data only: growth, up moves */
  --loss: #ec8f8f;        /* data only: depreciation, down moves */
  --gain-fill: rgba(127, 199, 154, 0.08);
  --mono: 'Lab Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: Arial, Helvetica, sans-serif;
  --rail: 188px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f5;
  --fg: #181818;
  --muted: #62625e;
  --soft: #6c6c66;
  --line: #d5d5d1;
  --panel: #eeeeeb;
  --hover: #e9e9e5;
  --gain: #1f6b3f;
  --loss: #a3302f;
  --gain-fill: rgba(31, 107, 63, 0.07);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 34px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border-radius: 0; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: color .18s, background-color .18s, border-color .18s; }
a { color: inherit; text-decoration: none; }
button, a, input, [tabindex] { outline-offset: 5px; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--fg); }
::selection { color: var(--bg); background: var(--fg); }
[hidden] { display: none !important; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--mono); font-weight: 400; }
h2 { font-size: clamp(1.8rem, 2.65vw, 2.7rem); line-height: 1.28; letter-spacing: -.045em; margin-bottom: 0; }
.sr-only {
  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: fixed; left: 20px; top: 12px; z-index: 100; padding: 12px 20px;
  background: var(--fg); color: var(--bg); transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.eyebrow {
  font: 400 .8125rem/1.5 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 19px;
}
.mono { font-family: var(--mono); }

/* ---------- Rail (left sidebar; a top bar on phones) ---------- */
.site-rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail);
  border-right: 1px solid var(--line);
  padding: 32px 22px 26px;
  display: flex; flex-direction: column;
  z-index: 25; background: var(--bg);
}
.brand { display: flex; gap: 9px; align-items: center; font: 400 15px/1.2 var(--mono); letter-spacing: -.05em; white-space: nowrap; }
.brand-mark {
  flex-shrink: 0; width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--fg); color: var(--bg);
  font: 400 15px/1 var(--mono); letter-spacing: -.08em;
}
.main-nav { display: flex; flex-direction: column; gap: 18px; margin-top: 77px; font: 400 14px/1.6 var(--mono); }
.main-nav a { color: var(--muted); white-space: nowrap; }
.main-nav a span[aria-hidden] { color: var(--soft); margin-right: 4px; letter-spacing: -1px; }
.main-nav a:hover, .main-nav a.is-active { color: var(--fg); }
.main-nav a.is-active span[aria-hidden] { color: var(--fg); }
.rail-bottom { margin-top: auto; color: var(--muted); font: 400 12px/1.8 var(--mono); }
.rail-bottom p { margin-bottom: 24px; }
.theme-button {
  background: none; border: 0; padding: 5px 0;
  display: flex; align-items: center; gap: 9px;
  font: 400 14px/1.6 var(--mono); color: var(--fg);
}
.theme-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.rail-domain { display: block; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 17px; font-size: 12px; }
.rail-domain a { color: var(--muted); }
.rail-domain a:hover { color: var(--fg); }
.menu-toggle { display: none; }

.main { margin-left: var(--rail); padding: 0 clamp(30px, 4vw, 72px); max-width: 1740px; }
.topline {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 34px 0 26px; border-bottom: 1px solid var(--line);
  font: 400 12px/1.5 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Sections ---------- */
.section { padding: 77px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 35px; margin-bottom: 30px; }
.section-intro { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 360px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  padding: 13px 18px; min-height: 48px;
  font: 400 14px/1.5 var(--mono); text-align: center;
}
.btn:hover { background: var(--hover); border-color: var(--muted); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { background: var(--muted); border-color: var(--muted); color: var(--bg); }
.text-link { font: 400 14px/1.5 var(--mono); color: var(--fg); border-bottom: 1px solid var(--soft); padding-bottom: 1px; }
.text-link:hover { border-color: var(--fg); }
.linklike {
  background: none; border: none; padding: 0; font: inherit; letter-spacing: inherit;
  color: inherit; cursor: pointer;
}
.linklike:hover { color: var(--fg); }

/* Segmented choice (filters on the parent site) */
.segmented { display: flex; gap: 4px; flex-wrap: wrap; }
.segmented button {
  font: 400 14px/1.5 var(--mono); background: none; border: 1px solid transparent;
  padding: 9px 13px; min-height: 42px; color: var(--muted);
}
.segmented button:hover { color: var(--fg); }
.segmented button[aria-pressed="true"] { border-color: var(--line); color: var(--fg); background: var(--panel); }

/* ---------- Cards ---------- */
.card { min-width: 0; display: flex; flex-direction: column; width: 100%; text-align: left; }
.card-art {
  width: 100%; aspect-ratio: 1.36; overflow: hidden; position: relative;
  background: var(--panel); border: 1px solid var(--line); isolation: isolate;
}
.card-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid transparent; transition: border-color .2s;
}
.card-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 13px; border-top: 1px solid var(--line); background: var(--bg);
  font: 400 12px/1.4 var(--mono); color: var(--fg);
}
.card-caption span:last-child { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; align-self: center; }
.card-info { display: flex; flex: 1; flex-direction: column; padding-top: 19px; width: 100%; }
.card-category { font: 400 12px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin-bottom: 9px; }
.card h3 { font-size: 22px; line-height: 1.3; letter-spacing: -.045em; margin-bottom: 10px; }
.card-description { font-size: 16px; line-height: 1.6; color: var(--muted); margin-bottom: 21px; }
.card-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  font: 400 12px/1.5 var(--mono); color: var(--muted);
}
.card-action { font: 400 14px/1.5 var(--mono); color: var(--fg); border-bottom: 1px solid var(--soft); padding-bottom: 1px; }
@media (hover: hover) {
  .card:hover .card-art::after { border-color: var(--soft); }
  .card:hover .card-action { border-color: var(--fg); }
}

/* ---------- Rows (the parent's "More from the lab" list) ---------- */
.rows { min-width: 0; }
.rows > * {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 18px; align-items: baseline;
  border-bottom: 1px solid var(--line); padding: 15px 0;
}
.rows > *:first-child { padding-top: 0; }
.rows strong { font: 400 16px/1.6 var(--mono); letter-spacing: -.03em; }
.rows p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--muted); }
.rows p em { color: var(--fg); font-style: normal; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 75px; align-items: start; }
.split-copy > p:not(.eyebrow) { font-size: 17px; line-height: 1.8; color: var(--muted); max-width: 460px; margin: 24px 0 0; }

/* ---------- Call to action (the parent's contact block) ---------- */
.cta-section {
  display: flex; align-items: center; justify-content: space-between; gap: 35px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 49px 0;
}
.cta-section .eyebrow { margin-bottom: 14px; }
.cta-section h2 { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -.05em; }
.cta-section p:last-child { font-size: 16px; color: var(--muted); margin: 16px 0 0; line-height: 1.8; max-width: 580px; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; width: 330px; max-width: 100%; flex-shrink: 0; }
.cta-actions .btn { width: 100%; }

/* ---------- Footer ---------- */
.footer { padding: 28px 0 0; overflow: hidden; }
.footer-line {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 25px; flex-wrap: wrap;
  font: 400 12px/1.7 var(--mono); color: var(--muted);
}
.footer-line a:hover, .footer-line button:hover { color: var(--fg); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a, .footer-links button { padding: 6px 0; }
.footer-brand { font-size: 15px; color: var(--fg); }
.footer-wordmark {
  font: 400 clamp(52px, 10.5vw, 190px)/1.2 var(--mono);
  letter-spacing: -.085em; color: var(--line); white-space: nowrap; margin: 0 0 -12px;
}
.footer-wordmark span { color: var(--soft); }

/* ---------- Document pages (privacy, terms, 404) ---------- */
.doc { max-width: 760px; padding: 64px 0 40px; }
.doc h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.14; letter-spacing: -.06em; margin: 0 0 18px; }
.doc h1 em { font-style: normal; color: var(--muted); }
.doc-meta { font: 400 12px/1.5 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-bottom: 26px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.doc .intro { font-size: 19px; line-height: 1.7; color: var(--muted); padding-bottom: 34px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.doc .intro strong { color: var(--fg); font-weight: 400; }
.doc h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); margin: 56px 0 18px; scroll-margin-top: 90px; }
.doc h3 { font-size: 18px; letter-spacing: -.03em; margin: 28px 0 10px; }
.doc p, .doc li { color: var(--muted); line-height: 1.75; }
.doc p strong, .doc li strong { color: var(--fg); font-weight: 400; }
.doc p em, .doc li em { color: var(--fg); }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 22px; }
.doc li { margin-bottom: 8px; }
.doc a:not(.btn) { color: var(--fg); border-bottom: 1px solid var(--soft); }
.doc a:not(.btn):hover { border-color: var(--fg); }
.doc code { font-family: var(--mono); font-size: .9em; color: var(--fg); }
.toc { border: 1px solid var(--line); background: var(--panel); padding: 22px 26px; margin-bottom: 48px; }
.toc h4 { font: 400 12px/1.5 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; columns: 2; column-gap: 32px; }
.toc li { counter-increment: toc; margin: 0; padding: 4px 0; break-inside: avoid; font: 400 14px/1.5 var(--mono); }
.toc li::before { content: counter(toc, decimal-leading-zero) ' '; color: var(--soft); }
.toc a { border: 0 !important; color: var(--fg); }
.callout { border: 1px solid var(--line); border-left: 2px solid var(--fg); background: var(--panel); padding: 20px 24px; margin: 24px 0; }
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Consent bar ---------- */
.consent {
  position: fixed; z-index: 100; left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 600px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--muted);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  padding: 18px 20px; display: flex; gap: 18px; align-items: center;
}
.consent p { margin: 0; flex: 1; font-size: 14px; line-height: 1.55; color: var(--muted); }
.consent a { color: var(--fg); border-bottom: 1px solid var(--soft); }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent-actions .btn { min-height: 44px; padding: 10px 14px; }

/* ---------- Responsive (same breakpoints as the parent) ---------- */
@media (min-width: 1700px) {
  .main { padding-left: 85px; padding-right: 85px; }
  .section { padding: 100px 0; }
}
@media (max-width: 1250px) {
  :root { --rail: 170px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; font-size: 13px; }
  .main { padding: 0 32px; }
  .site-rail { padding: 27px 17px; }
}
@media (max-width: 1000px) {
  :root { --rail: 165px; }
  .main { padding: 0 28px; }
  .site-rail { padding: 25px 16px; }
  .section { padding: 58px 0; }
  .section-heading { display: block; }
  .section-intro { max-width: none; margin-top: 17px; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .cta-section { align-items: flex-start; flex-direction: column; gap: 25px; }
  .cta-actions { width: 100%; max-width: 420px; }
  .footer-wordmark { font-size: 12vw; }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 92px; }
  .site-rail {
    position: sticky; top: 0; width: 100%; height: 70px;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 15px 20px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { font-size: 17px; }
  .menu-toggle {
    display: block; margin-left: auto; background: none; color: var(--fg);
    border: 1px solid var(--line); padding: 8px 14px; min-height: 40px;
    font: 400 14px/1.5 var(--mono);
  }
  .main-nav {
    display: none; position: absolute; top: 69px; left: 0; right: 0; margin: 0;
    padding: 22px 22px 26px; background: var(--bg); border-bottom: 1px solid var(--line);
    font-size: 15px; gap: 6px; box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 9px 0; }
  .rail-bottom { margin: 0 0 0 10px; }
  .rail-bottom p, .rail-domain { display: none; }
  .theme-button { padding: 9px; min-width: 40px; min-height: 40px; justify-content: center; border: 1px solid var(--line); }
  .theme-button svg { width: 18px; height: 18px; }
  .theme-button [data-theme-label] { display: none; }
  .main { margin: 0; padding: 0 20px; max-width: none; }
  .topline { padding: 22px 0 18px; }
  .topline span:last-child { display: none; }
  .section { padding: 45px 0; }
  .rows > * { grid-template-columns: 1fr; gap: 4px; }
  .card h3 { font-size: 22px; }
  .doc { padding-top: 36px; }
  .toc ol { columns: 1; }
  .consent { flex-direction: column; align-items: stretch; left: 12px; right: 12px; }
  .consent-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
