/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display: "Inter Tight", "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --maxw: 1440px;
  --pad: clamp(20px, 4vw, 64px);
  --accent: #E8B339;
}

/* Paper — warm off-white, the new default */
html[data-theme="paper"] {
  --bg: #F2EEE6;
  --bg-2: #E9E4D9;
  --fg: #14110D;
  --fg-2: #4A4640;
  --fg-3: #8E887C;
  --rule: #D8D2C3;
  --rule-2: #C2BBAB;
}

/* Bone — cooler near-white for a more clinical feel */
html[data-theme="bone"] {
  --bg: #F6F5F2;
  --bg-2: #ECEAE5;
  --fg: #0E0E0C;
  --fg-2: #3D3D38;
  --fg-3: #8A8A82;
  --rule: #DEDCD4;
  --rule-2: #CBC9BF;
}

/* Ink — deep navy-charcoal alternative for the "I want darker" case, but never pure black */
html[data-theme="ink"] {
  --bg: #1B2230;
  --bg-2: #232A38;
  --fg: #ECEAE3;
  --fg-2: #B6B3AA;
  --fg-3: #7B7D85;
  --rule: #2D3441;
  --rule-2: #3B414E;
}

/* Fallback if no theme attr */
html:not([data-theme]) {
  --bg: #F2EEE6;
  --bg-2: #E9E4D9;
  --fg: #14110D;
  --fg-2: #4A4640;
  --fg-3: #8E887C;
  --rule: #D8D2C3;
  --rule-2: #C2BBAB;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

.mono-xs {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
}

.page {
  position: relative;
  min-height: 100vh;
  padding-top: 0;
}

.sep { color: var(--fg-3); padding: 0 6px; }

/* ─── Status bar ─────────────────────────────────────────────── */
.status-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px var(--pad);
  background: color-mix(in oklab, var(--bg), transparent 8%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.status-left { display: flex; align-items: center; gap: 10px; }
.status-mid { display: flex; gap: 0; justify-content: center; }
.status-right { text-align: right; color: var(--fg-3); }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 80%);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 85%); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent), transparent 92%); }
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(32px, 6vw, 72px) var(--pad) clamp(40px, 8vw, 96px);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero::before {
  /* faint grid overlay */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.35;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 5vw, 64px);
  max-width: var(--maxw);
  margin: 0 auto;
}
.hero-meta {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 8px;
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}
.meta-row { display: grid; grid-template-columns: 80px 1fr; gap: 8px; color: var(--fg-3); }
.meta-k { color: var(--fg-3); }
.meta-v { color: var(--fg-2); }

.hero-wordmark-wrap {
  grid-column: 2 / 3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 12px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(13px, 1.05vw, 15px);
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--fg);
  font-weight: 500;
  font-family: var(--display);
}
.hero-eyebrow-mark {
  width: 28px;
  height: 2px;
  display: inline-block;
}
.hero-wordmark {
  width: 100%;
  max-width: 880px;
  height: auto;
  display: block;
  filter: var(--wm-filter, none);
}
html[data-theme="ink"] .hero-wordmark {
  filter: invert(1);
}
html[data-theme="paper"] .hero-wordmark,
html[data-theme="bone"] .hero-wordmark {
  filter: none;
}
.hero-wordmark-tag {
  display: none;
}

.hero-headline-block {
  grid-column: 2 / 3;
  margin-top: clamp(40px, 7vw, 88px);
  max-width: 1100px;
}
.hero-headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 8vw, 120px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.hero-subline {
  margin: 24px 0 0;
  max-width: 56ch;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.4;
  color: var(--fg-2);
  text-wrap: pretty;
}

.hero-foot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: clamp(40px, 7vw, 88px);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.hero-foot-l { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--fg-3); }
.hero-foot-l > span { display: inline-flex; align-items: center; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 5px;
  border: 1px solid var(--rule-2);
  color: var(--fg-2);
  margin-right: 6px;
  border-radius: 2px;
}
.hero-mail {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg);
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.hero-mail:hover { color: var(--accent); border-color: var(--accent); }
.mail-arrow { color: var(--accent); }

/* ─── Tick rail ──────────────────────────────────────────────── */
.tick-rail {
  position: absolute;
  right: 8px; top: 0; bottom: 0;
  width: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
  opacity: 0.7;
}
.tick {
  position: relative;
  height: 1px;
  width: 12px;
  background: var(--rule-2);
}
.tick.major { width: 22px; background: var(--fg-3); }
.tick-label {
  position: absolute;
  left: 28px;
  top: -7px;
  font-size: 9px;
  color: var(--fg-3);
}
@media (max-width: 720px) { .tick-rail { display: none; } }

/* ─── Section heads ──────────────────────────────────────────── */
.section-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--rule);
  color: var(--fg-3);
}
.sh-idx { color: var(--accent); }
.sh-label { color: var(--fg); letter-spacing: 0.16em; }
.sh-rule { flex: 1; height: 1px; background: var(--rule); }
.sh-right { color: var(--fg-3); }

/* ─── Practice ───────────────────────────────────────────────── */
.practice {
  padding: 0 0 clamp(40px, 7vw, 96px);
  border-bottom: 1px solid var(--rule);
}
.practice-lede {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--pad) clamp(24px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
.section-h {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 4.6vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.section-h .muted { color: var(--fg-3); }
.section-p {
  margin: 0;
  font-size: clamp(15px, 1.1vw, 17px);
  color: var(--fg-2);
  line-height: 1.5;
  max-width: 50ch;
}

.cap-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.cap-list {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--rule);
}
.cap-row {
  display: grid;
  grid-template-columns: 56px 1fr 32px;
  align-items: center;
  gap: 16px;
  padding: clamp(20px, 2.8vw, 32px) clamp(16px, 2vw, 28px) clamp(20px, 2.8vw, 32px) 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  color: var(--fg);
  transition: padding-left 0.25s ease, color 0.2s;
  position: relative;
}
.cap-row:last-child { border-bottom: 0; }
.cap-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.cap-row.is-active { padding-left: 18px; }
.cap-row.is-active::before { transform: scaleY(1); }
.cap-row.is-active .cap-arrow { color: var(--accent); transform: translateX(4px); }

.cap-id { color: var(--fg-3); font-family: var(--mono); }
.cap-row.is-active .cap-id { color: var(--accent); }
.cap-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.02em;
}
.cap-arrow {
  color: var(--fg-3);
  transition: transform 0.25s, color 0.25s;
  font-family: var(--mono);
}

.cap-detail {
  padding: clamp(20px, 2.8vw, 36px) 0 clamp(20px, 2.8vw, 36px) clamp(24px, 3vw, 40px);
  display: flex; flex-direction: column; gap: 18px;
}
.cap-detail-head {
  display: flex; align-items: center; gap: 12px;
  color: var(--fg-3);
}
.cap-detail-rule { flex: 1; height: 1px; background: var(--rule); }
.cap-blurb {
  font-family: var(--display);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.4;
  color: var(--fg);
  margin: 0;
  text-wrap: pretty;
  max-width: 38ch;
}
.cap-points {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.cap-points li {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: baseline;
  gap: 12px;
  color: var(--fg-2);
  font-size: 15px;
}
.cap-point-id { color: var(--fg-3); }

/* ─── Proof ──────────────────────────────────────────────────── */
.proof {
  padding: 0 0 clamp(40px, 7vw, 96px);
  border-bottom: 1px solid var(--rule);
}
.proof-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--pad) clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 64px);
}
.proof-client { display: flex; gap: 6px; align-items: center; color: var(--fg-3); margin-bottom: 18px; }
.proof-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.proof-title .ital { font-style: italic; font-weight: 400; color: var(--fg-2); }
.proof-lede {
  margin: 0;
  font-size: clamp(15px, 1.15vw, 18px);
  color: var(--fg-2);
  line-height: 1.5;
  max-width: 52ch;
  text-wrap: pretty;
}
.proof-lede strong {
  color: var(--fg);
  font-weight: 600;
  font-style: normal;
}

.status-block {
  display: flex; flex-direction: column;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  padding: 4px 0;
}
.status-block > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.status-block > div:last-child { border-bottom: 0; }
.sb-k { color: var(--fg-3); }
.sb-v { color: var(--fg); display: inline-flex; align-items: center; gap: 8px; }
.sb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 80%);
}

/* Metric grid */
.metric-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-left: 0; border-right: 0;
}
.metric {
  padding: clamp(20px, 2.4vw, 32px) clamp(20px, 2vw, 28px) clamp(24px, 2.6vw, 36px);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 16px;
  position: relative;
  transition: background 0.3s;
}
.metric:last-child { border-right: 0; }
.metric:hover { background: var(--bg-2); }
.metric-head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--fg-3);
}
.metric-live {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
  font-size: 9px;
}
.metric-dot {
  width: 6px; height: 6px; border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
}
.metric-value {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 48px);
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.spark {
  width: 100%;
  height: 56px;
  display: block;
}

.proof-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px var(--pad) 0;
  color: var(--fg-3);
  display: flex; gap: 0; flex-wrap: wrap;
}

/* ─── Contact ────────────────────────────────────────────────── */
.contact {
  padding: 0 0 clamp(24px, 4vw, 48px);
}
.contact-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--pad) clamp(40px, 6vw, 96px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
.contact-line {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(20px, 2vw, 28px);
  color: var(--fg-2);
  font-weight: 400;
}
.contact-mail {
  display: inline-flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  transition: color 0.25s, border-color 0.25s;
}
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }
.contact-arrow {
  font-family: var(--mono);
  font-size: 0.4em;
  transition: transform 0.25s;
}
.contact-mail:hover .contact-arrow { transform: translateX(8px); }
.contact-fine {
  margin-top: 18px;
  color: var(--fg-3);
  max-width: 50ch;
  letter-spacing: 0.05em;
}

.contact-r {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
}
.contact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--fg-2);
}
.contact-row > span:first-child, .contact-row > a:first-child { color: var(--fg-3); }
.contact-row a:hover { color: var(--accent); }

.page-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--pad);
  border-top: 1px solid var(--rule);
  display: flex; align-items: center; gap: 12px;
  color: var(--fg-3);
}
.page-foot .sh-rule { background: var(--rule); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-meta { border-left: 0; padding-left: 0; padding-top: 0; }
  .hero-wordmark-wrap, .hero-headline-block { grid-column: 1 / -1; }
  .practice-lede, .proof-head, .contact-grid { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; }
  .cap-list { border-right: 0; border-bottom: 1px solid var(--rule); }
  .cap-detail { padding-left: 0; padding-top: 24px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(1), .metric:nth-child(2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 600px) {
  .status-mid { display: none; }
  .status-bar { grid-template-columns: 1fr auto; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--rule); }
  .metric:last-child { border-bottom: 0; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .contact-mail { font-size: clamp(36px, 12vw, 56px); }
}
