/* coldsmoke — base styles */
:root {
  --bg: oklch(0.985 0.004 240);
  --bg-2: oklch(0.96 0.006 240);
  --bg-3: oklch(0.92 0.008 240);
  --ink: oklch(0.18 0.02 250);
  --ink-2: oklch(0.32 0.02 250);
  --ink-3: oklch(0.52 0.015 250);
  --rule: oklch(0.85 0.01 240);
  --rule-2: oklch(0.78 0.012 240);
  --sky: oklch(0.58 0.14 250);
  --sky-deep: oklch(0.42 0.13 250);
  --warm: oklch(0.72 0.14 60);
  --snow: #fff;

  --f-display: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-body: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(20px, 3vw, 40px);
  --maxw: 1360px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle snow grain over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.6  0 0 0 0 0.65  0 0 0 0 0.72  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ——— Type ——— */
.eyebrow, .mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before { content: "// "; color: var(--sky); }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.02em; margin: 0; line-height: 1.02; text-wrap: balance; }
h1 { font-size: clamp(56px, 8.4vw, 148px); letter-spacing: -0.035em; font-weight: 500; }
h2 { font-size: clamp(36px, 4.6vw, 72px); letter-spacing: -0.028em; }
h3 { font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -0.02em; line-height: 1.15; }
h4 { font-size: 18px; line-height: 1.25; }
p { margin: 0; }
.lede { font-size: clamp(19px, 1.8vw, 24px); line-height: 1.42; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.body { color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }

/* ——— Layout primitives ——— */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); position: relative; z-index: 2; }
.row { display: flex; gap: 16px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; }
.divider { height: 1px; background: var(--rule); width: 100%; }
.heavy-divider { height: 1px; background: var(--ink); width: 100%; }

/* ——— Nav ——— */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 500; letter-spacing: -0.02em; font-size: 16px; }
.brand-mark { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 28px; font-family: var(--f-display); font-size: 14px; font-weight: 500; letter-spacing: -0.005em; color: var(--ink-2); }
.nav-links a { position: relative; padding: 6px 0; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 0; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-family: var(--f-display); font-size: 14px; font-weight: 500; letter-spacing: -0.005em; transition: transform 0.15s, background 0.15s; }
.btn:hover { transform: translateY(-1px); background: var(--sky-deep); border-color: var(--sky-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); transform: translateY(-1px); }
.btn-arrow::after { content: "→"; }

/* Footer */
footer { margin-top: 120px; border-top: 1px solid var(--ink); padding: 56px 0 32px; position: relative; z-index: 2; }
footer .shell { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
footer h4 { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; font-weight: 400; }
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
footer .colophon { display: flex; justify-content: space-between; padding-top: 24px; margin-top: 56px; border-top: 1px solid var(--rule); font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* Page heading shared across inner pages */
.page-head { padding: 80px 0 48px; border-bottom: 1px solid var(--rule); }
.page-head .meta { display: flex; gap: 24px; align-items: baseline; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(48px, 7vw, 110px); }

/* Cards */
.card { border: 1px solid var(--rule); padding: 24px; background: var(--snow); transition: border-color 0.2s; }
.card:hover { border-color: var(--ink); }

/* Mono table */
.mtable { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 13px; }
.mtable th, .mtable td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.mtable th { font-weight: 500; color: var(--ink-3); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--rule-2); border-radius: 999px; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sky); display: inline-block; }
.badge.warm .dot { background: var(--warm); }

/* Hairline list */
.hr-list { border-top: 1px solid var(--ink); }
.hr-list > * { border-bottom: 1px solid var(--rule); padding: 28px 0; }

/* Snowfall placeholder image */
.placeholder {
  background: repeating-linear-gradient(135deg, var(--bg-2) 0 8px, var(--bg-3) 8px 16px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--rule);
}
.placeholder::before { content: ""; }

/* Section spacing */
section { padding: 96px 0; }
section + section { border-top: 1px solid var(--rule); }

/* Util */
.col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.col-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.col-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }

/* Responsive */
@media (max-width: 880px) {
  .col-2, .col-3, .col-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  footer .shell { grid-template-columns: 1fr 1fr; }
}
