/* Worklode — worklode.io
   Palette: white / light grey / blue. Light only, by design. */

:root {
  --ink: #0f172a;
  --slate: #475569;
  --muted: #64748b;
  --mist: #f1f5f9;
  --line: #e2e8f0;
  --lode: #1d4ed8;
  --lode-dark: #1e3a8a;
  --pull: #38bdf8;
  --white: #fff;

  --wrap: 1100px;
  --radius: 12px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--lode); }

code {
  font-family: var(--mono);
  font-size: .9em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--white);
  border: 2px solid var(--lode);
  border-radius: 8px;
}

/* ── Nav ──────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 1.06rem;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: .93rem;
}

.nav-links a {
  color: var(--slate);
  text-decoration: none;
}

.nav-links a:hover { color: var(--lode); }

.nav-cta {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink) !important;
}

.nav-cta:hover {
  border-color: var(--lode);
  background: var(--mist);
}

@media (max-width: 860px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: 112px 0 96px;
  background:
    radial-gradient(1000px 460px at 50% -8%, #eff6ff 0%, rgb(239 246 255 / 0%) 70%),
    var(--white);
  border-bottom: 1px solid var(--line);
}

.field {
  position: absolute;
  inset: 0;
  opacity: .38;
  pointer-events: none;
  /* Fade the lines out behind the headline so copy stays the focus. */
  mask-image: radial-gradient(closest-side at 50% 50%, transparent 30%, #000 72%);
}

.field svg { width: 100%; height: 100%; }

.hero-inner {
  position: relative;
  text-align: center;
}

.hero-mark {
  display: block;
  margin: 0 auto 28px;
  width: clamp(76px, 9vw, 112px);
  height: auto;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--lode);
}

h1 {
  margin: 0 0 26px;
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  line-height: 1.1;
  letter-spacing: -.032em;
  font-weight: 680;
}

h1 em {
  font-style: normal;
  color: var(--lode);
}

.lede {
  max-width: 660px;
  margin: 0 auto 34px;
  font-size: 1.13rem;
  color: var(--slate);
}

.lede strong { color: var(--ink); font-weight: 620; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0 0 30px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: .96rem;
  font-weight: 560;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--lode);
  color: var(--white);
}

.btn-primary:hover { background: var(--lode-dark); }

.btn-ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--lode); color: var(--lode); }

.btn-invert {
  background: var(--white);
  color: var(--lode-dark);
}

.hero-meta {
  margin: 0;
  font-size: .87rem;
  color: var(--muted);
}

.hero-meta code {
  color: var(--ink);
  background: var(--mist);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ── Bands ────────────────────────────────────────────────────────────── */

.band {
  padding: 96px 0;
  /* Keep in-page anchors clear of the sticky header. */
  scroll-margin-top: 64px;
}

.band-mist {
  background: var(--mist);
  border-block: 1px solid var(--line);
}

.band-deep {
  background: linear-gradient(160deg, var(--lode-dark), var(--lode));
  color: var(--white);
}

.kicker {
  margin: 0 0 12px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--lode);
}

.kicker-light { color: var(--pull); }

h2 {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -.026em;
  font-weight: 660;
  max-width: 22ch;
}

.band-deep h2 { color: var(--white); }

h3 {
  margin: 0 0 8px;
  font-size: 1.06rem;
  font-weight: 620;
  letter-spacing: -.012em;
}

.section-lede {
  max-width: 660px;
  margin: 0 0 48px;
  font-size: 1.06rem;
  color: var(--slate);
}

.section-lede strong { color: var(--ink); font-weight: 620; }

.section-lede-light {
  color: rgb(255 255 255 / 88%);
}

.section-note {
  max-width: 720px;
  margin: 40px 0 0;
  font-size: .97rem;
  color: var(--muted);
}

/* ── Beats ────────────────────────────────────────────────────────────── */

.beats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.beat {
  position: relative;
  padding: 28px 26px 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.beat::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--lode), var(--pull));
}

.beat-n {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--lode);
  letter-spacing: .08em;
}

.beat p {
  margin: 0;
  color: var(--slate);
  font-size: .97rem;
}

@media (max-width: 820px) {
  .beats { grid-template-columns: 1fr; }
}

/* ── Diagrams ─────────────────────────────────────────────────────────── */

.diagram { margin: 0; }

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}

.lyr rect {
  fill: var(--white);
  stroke: var(--line);
  stroke-width: 1.5;
}

.lyr-intent rect {
  fill: #eff6ff;
  stroke: var(--lode);
}

.lyr-obs rect {
  stroke-dasharray: 5 4;
  stroke: #94a3b8;
}

.lyr-name {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 640;
  fill: var(--ink);
}

.lyr-tag {
  font-family: var(--sans);
  font-size: 12.5px;
  fill: var(--muted);
}

.lyr-items {
  font-family: var(--mono);
  font-size: 12.5px;
  fill: var(--slate);
}

.spine line {
  stroke: var(--lode);
  stroke-width: 2;
}

.spine circle {
  fill: var(--white);
  stroke: var(--lode);
  stroke-width: 2;
}

.diagram figcaption {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: .93rem;
  color: var(--muted);
}

/* ── Drift formula ────────────────────────────────────────────────────── */

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 26px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 1.02rem;
}

.term {
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
}

.term-obs { border-style: dashed; color: var(--slate); }
.term-int { border-color: var(--lode); color: var(--lode); }
.term-ack { color: var(--muted); }

.term-drift {
  background: var(--lode);
  border-color: var(--lode);
  color: var(--white);
  font-weight: 600;
}

.op { color: var(--muted); }
.eq { color: var(--ink); }

.formula-note {
  max-width: 720px;
  margin: 18px 0 48px;
  font-size: .95rem;
  color: var(--muted);
}

/* ── Cards ────────────────────────────────────────────────────────────── */

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}

.card {
  padding: 24px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.band-mist .card { background: var(--white); }

.card p {
  margin: 0;
  font-size: .95rem;
  color: var(--slate);
}

.card code {
  background: var(--mist);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--lode-dark);
}

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4,
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── Stores ───────────────────────────────────────────────────────────── */

.stores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 24px;
}

.store {
  padding: 30px 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.store-kind {
  margin: 0 0 6px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lode);
}

.store h3 {
  font-size: 1.32rem;
  margin-bottom: 12px;
}

.store p {
  margin: 0;
  font-size: .96rem;
  color: var(--slate);
}

.store code {
  background: var(--mist);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--lode-dark);
}

.join {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.join-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--line), var(--lode));
}

.join-line:last-child {
  background: linear-gradient(var(--lode), var(--line));
}

.join-label {
  font-family: var(--mono);
  font-size: .76rem;
  white-space: nowrap;
  color: var(--lode);
}

@media (max-width: 880px) {
  .stores { grid-template-columns: 1fr; }
  .join { flex-direction: row; }
  .join-line { width: 40px; height: 1px; background: var(--line); }
}

/* ── Pull quote ───────────────────────────────────────────────────────── */

.pull {
  max-width: 720px;
  margin: 0 0 48px;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--lode);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -.012em;
}

.pull code {
  background: var(--mist);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--lode-dark);
}

/* ── Terminal blocks ──────────────────────────────────────────────────── */

.term-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
}

.term-block pre {
  margin: 0;
  padding: 22px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.75;
  color: var(--ink);
}

.term-block .c { color: var(--muted); }
.term-block .p { color: var(--lode); font-weight: 600; }
.term-block .s { color: #0f766e; }

.term-dark {
  border-color: rgb(255 255 255 / 18%);
  background: #0b1220;
}

.term-dark .term-bar {
  background: rgb(255 255 255 / 6%);
  border-bottom-color: rgb(255 255 255 / 12%);
}

.term-dark .dot { background: rgb(255 255 255 / 22%); }
.term-dark .term-title { color: rgb(255 255 255 / 55%); }
.term-dark pre { color: #e2e8f0; }
.term-dark .c { color: #64748b; }
.term-dark .p { color: var(--pull); }
.term-dark .s { color: #7dd3fc; }

.band-deep .cta-row { justify-content: flex-start; margin-top: 32px; }

/* ── Footer ───────────────────────────────────────────────────────────── */

.foot {
  padding: 52px 0;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 640;
}

.foot-links {
  display: flex;
  gap: 22px;
  font-size: .93rem;
}

.foot-links a {
  color: var(--slate);
  text-decoration: none;
}

.foot-links a:hover { color: var(--lode); }

.foot-note {
  flex-basis: 100%;
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
}

/* ── Reveal on scroll ─────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover { transform: none; }
}
