@layer components {

/* ══ hero ═════════════════════════════════════════════════════════ */
.hero { padding-block: clamp(56px, 10vh, 112px) var(--s10); }
.hero-eyebrow { margin-bottom: var(--s5); }
.hero-title {
  font-size: var(--t-display); font-weight: 600; line-height: 1.06;
  letter-spacing: -0.036em; max-width: 17ch;
}
.hero-lede {
  margin-top: var(--s6); color: var(--ink-2);
  font-size: var(--t-prose); line-height: var(--lh-prose); max-width: 58ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s8); }

@media (prefers-reduced-motion: no-preference) {
  [data-arrive] .hero-eyebrow, [data-arrive] .hero-title,
  [data-arrive] .hero-lede, [data-arrive] .hero-actions {
    opacity: 0; transform: translateY(var(--arrive-shift));
  }
  [data-arrive="run"] .hero-eyebrow, [data-arrive="run"] .hero-title,
  [data-arrive="run"] .hero-lede, [data-arrive="run"] .hero-actions {
    opacity: 1; transform: none;
    transition: opacity var(--d-arrive) var(--ease-out), transform var(--d-arrive) var(--ease-out);
  }
  [data-arrive="run"] .hero-title   { transition-delay: 60ms; }
  [data-arrive="run"] .hero-lede    { transition-delay: 120ms; }
  [data-arrive="run"] .hero-actions { transition-delay: 180ms; }
}

/* ══ the two doors ════════════════════════════════════════════════ */
.doors { padding-bottom: var(--s11); }
.door-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
@media (max-width: 900px) { .door-grid { grid-template-columns: 1fr; } }

.door-card {
  display: grid; grid-template-rows: auto 1fr;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--d-hover) ease, border-color var(--d-hover) ease;
  min-height: 520px;
}
.door-copy { padding: var(--s8) var(--s8) 0; }
@media (hover: hover) and (pointer: fine) {
  .door-card:hover { box-shadow: var(--shadow-lift); border-color: var(--accent-line); }
}
/* the card is the link its hover already promises */
.door-card { isolation: isolate; }
.door-copy .arrow::after { content: ""; position: absolute; inset: 0; z-index: 3;
  border-radius: var(--r-2xl); }
.door-art { z-index: 0; }
.door-card .note-hand, .door-card .pv-app, .door-card .pv-code { pointer-events: none; }
.door-card:has(.arrow:focus-visible) { box-shadow: var(--shadow-lift); border-color: var(--accent-line); }
@media (max-width: 560px) { .door-copy { padding: var(--s6) var(--s6) 0; } .door-card { min-height: 0; } }

.door-copy h2 { font-size: var(--t-card); font-weight: 600; letter-spacing: -0.03em; line-height: 1.16; }
.door-line { margin-top: var(--s4); color: var(--ink-2); font-size: var(--t-small);
  line-height: 1.6; max-width: 42ch; }
.door-copy .arrow { margin-top: var(--s6); }
.door-stat { margin-top: var(--s5); font-size: var(--t-machine); color: var(--graphite); }

/* the art bleeds off its own corner and is cropped by the card */
.door-art { position: relative; min-height: 286px; overflow: hidden; margin-top: var(--s8); }

/* the handwritten margin notes */
.note-hand { display: flex; align-items: flex-end; gap: var(--s2); }
.note-design { position: absolute; left: var(--s8); top: 0; width: 232px; z-index: 2;
  align-items: flex-start; }
.note-design svg { transform: rotate(24deg) translateY(6px); flex: none; }
.note-eng { position: absolute; right: var(--s8); top: 0; width: 206px; z-index: 2;
  justify-content: flex-end; align-items: flex-start; text-align: right; }
.note-eng svg { transform: rotate(-24deg) translateY(6px); flex: none; }
@media (max-width: 1180px) {
  /* the handwriting survives to 390 as a note above its preview */
  .note-design, .note-eng { position: static; width: auto; max-width: 30ch;
    padding-inline: var(--s6); margin-bottom: var(--s3); }
  .note-eng { margin-left: auto; }
}

/* ── the workspace preview ────────────────────────────────────── */
.pv-app {
  position: absolute; left: var(--s8); right: calc(var(--s6) * -1);
  top: 76px; bottom: calc(var(--s6) * -1); width: auto; max-width: none;
  display: grid; grid-template-columns: 104px minmax(0, 1fr);
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r-lg) 0 0 0; border-right: 0; border-bottom: 0;
  box-shadow: var(--shadow-card); overflow: hidden; font-size: 11px;
}
.pv-app-rail { padding: var(--s4) var(--s3); border-right: 1px solid var(--rule-soft);
  background: var(--paper-2); display: grid; gap: 2px; align-content: start; }
.pv-mark { width: 16px; height: 16px; border-radius: 5px; background: var(--accent);
  margin: 0 0 var(--s4) var(--s2); }
.pv-rail-item { display: flex; align-items: center; gap: var(--s2);
  padding: 5px var(--s2); border-radius: var(--r-sm); color: var(--graphite); }
.pv-rail-item svg { width: 13px; height: 13px; flex: none; }
.pv-rail-item b { font-weight: 500; }
.pv-rail-item.is-on { background: var(--accent-soft); color: var(--accent); }

.pv-app-body { padding: var(--s4) var(--s4) 0; min-width: 0; }
.pv-app-head { display: flex; align-items: baseline; gap: var(--s4); }
.pv-app-head strong { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.pv-tabs { display: flex; gap: var(--s3); margin-left: auto; }
.pv-tabs b { font-weight: 500; color: var(--graphite); }
.pv-tabs b.is-on { color: var(--ink); }

.pv-task-list { margin-top: var(--s3); display: grid; }
.pv-task-list li { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto auto;
  gap: var(--s3); align-items: center; padding: 7px 0; border-top: 1px solid var(--rule-soft); }
.pv-tick { width: 15px; height: 15px; border-radius: 50%;
  border: 1.4px solid var(--rule-strong); display: grid; place-items: center; color: #fff; }
.pv-tick svg { width: 9px; height: 9px; }
.is-done .pv-tick { background: var(--accent); border-color: var(--accent); }
.is-done .pv-task-title { color: var(--graphite); }
.pv-task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-task-when { color: var(--graphite); font-size: 10px; }
.pv-faces { display: flex; }
.pv-faces i { width: 15px; height: 15px; border-radius: 50%; background: var(--paper-3);
  color: var(--ink-2); font-size: 8px; font-style: normal; display: grid; place-items: center;
  border: 1.5px solid var(--paper); margin-left: -5px; }

/* ── the code preview ─────────────────────────────────────────── */
.pv-code {
  position: absolute; left: calc(var(--s6) * -1); right: var(--s8);
  top: 76px; bottom: calc(var(--s6) * -1);
  background: var(--paper-ink); border: 1px solid var(--code-line); border-left: 0; border-bottom: 0;
  border-radius: 0 var(--r-lg) 0 0; overflow: hidden; box-shadow: var(--shadow-card);
}
.pv-code-tabs { display: flex; gap: var(--s1); padding: var(--s3) var(--s5) 0;
  border-bottom: 1px solid var(--code-line); }
.pv-code-tabs b { font-size: 11px; font-weight: 500; color: var(--code-tab-off);
  padding: 6px var(--s3); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.pv-code-tabs b.is-on { color: var(--code-tab-on); background: var(--code-tab); }
.pv-code-body {
  padding: var(--s4) var(--s5) var(--s5); margin: 0; overflow-x: auto;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.74; color: var(--code-text);
  white-space: pre;
}
.pv-code-body .pv-line { display: block; }
.pv-code-body i { font-style: normal; }
.pv-code-body .k { color: var(--code-key); }
.pv-code-body .f { color: var(--code-fn); }
.pv-code-body .s { color: var(--code-str); }
.pv-code-body .c { color: var(--code-com); }
.pv-code-body .p { color: var(--code-prop); }

/* ══ featured work ════════════════════════════════════════════════ */
.work-grid { display: grid; gap: var(--s6); margin-top: var(--s8);
  grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }

.work-card a { display: grid; gap: var(--s3); text-decoration: none; align-content: start; }
.work-well {
  display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: var(--s2);
  background: linear-gradient(158deg, var(--paper-3) 0%, var(--paper-2) 100%);
  border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--d-hover) ease;
}
.work-side { margin-bottom: 0; }
.work-title { font-size: var(--t-heading); font-weight: 600; color: var(--ink); letter-spacing: -0.018em; }
.work-line { color: var(--ink-2); font-size: var(--t-small); line-height: 1.55; }
.work-card .arrow { margin-top: var(--s1); }
@media (hover: hover) and (pointer: fine) {
  .work-card a:hover .work-well { border-color: var(--accent-line); }
  .work-card a:hover .work-title { color: var(--accent); }
  .work-card a:hover .arrow svg { transform: translateX(3px); }
}

/* the thumbnails */
.thumb { display: grid; place-items: center; width: 86%; height: 64%; }
.work-meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.th-app { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; width: 100%;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 11px; box-shadow: var(--shadow-card); }
.th-rail { border-radius: 5px; background: var(--accent-soft); min-height: 92px; }
.th-main { display: grid; gap: 7px; align-content: start; padding: 4px 3px; }
.th-bar { height: 8px; border-radius: 4px; background: var(--paper-3); }
.th-bar.w90 { width: 90%; } .th-bar.w75 { width: 75%; }
.th-bar.w60 { width: 60%; background: var(--accent); opacity: .75; }
.th-bar.w40 { width: 40%; }

.th-flow { display: flex; align-items: center; gap: 9px; justify-content: center; height: 100%; }
.th-node { width: 46px; height: 46px; border-radius: 12px; background: var(--paper);
  border: 1px solid var(--rule); display: grid; place-items: center; box-shadow: var(--shadow-card); }
.th-node svg { width: 23px; height: 23px; color: var(--accent); }
.th-doc::after { content: ""; width: 13px; height: 16px; border-radius: 2px;
  background: var(--paper-3); box-shadow: inset 0 0 0 1px var(--rule); }
.th-proj::after { content: ""; width: 15px; height: 15px; border-radius: 4px;
  background: var(--accent); opacity: .85; }
.th-wire { width: 14px; height: 1.5px; background: var(--rule-strong); border-radius: 1px; }

.th-components { display: grid; grid-template-columns: repeat(3, auto); gap: 10px;
  justify-content: center; align-content: center; align-items: center; height: 100%; }
.th-btn { padding: 5px 11px; border-radius: 7px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 500; }
.th-chip { padding: 4px 9px; border-radius: var(--r-pill); background: var(--paper);
  border: 1px solid var(--rule); font-size: 10px; color: var(--ink-2); }
.th-sq { width: 34px; height: 34px; border-radius: 9px; background: var(--paper);
  border: 1px solid var(--rule); }
.th-circle { width: 34px; height: 34px; border-radius: 50%; background: var(--paper);
  border: 1px solid var(--rule); }

.th-nudge { display: grid; place-items: center; height: 100%; }
.th-card { display: flex; align-items: center; gap: var(--s5); padding: 15px 18px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: var(--shadow-card); }
.th-faces { display: flex; }
.th-faces i { width: 20px; height: 20px; border-radius: 50%; background: var(--paper-3);
  color: var(--ink-2); font-size: 9px; font-style: normal; display: grid; place-items: center;
  border: 2px solid var(--paper); margin-left: -7px; }
.th-faces i:first-child { margin-left: 0; }
.th-pill { padding: 4px 10px; border-radius: 7px; border: 1px solid var(--accent-line);
  background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 500; }

/* ══ the approach band ════════════════════════════════════════════ */
.approach { padding-bottom: var(--s11); }
.approach-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto;
  gap: var(--s9); align-items: center; padding: var(--s10); box-shadow: var(--shadow-card); }
.approach-copy h2 { font-size: var(--t-card); letter-spacing: -0.03em; line-height: 1.16; }
.approach-body p { color: var(--ink-2); font-size: var(--t-small); line-height: 1.65; max-width: 46ch; }
.approach-body .arrow { margin-top: var(--s5); }
.note-approach { width: 176px; flex-direction: column; align-items: flex-start; gap: 0; }
.note-approach svg { transform: rotate(-18deg); margin-left: var(--s7); }
@media (max-width: 1000px) {
  .approach-card { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding: var(--s8); }
  .note-approach { width: auto; max-width: 30ch; }
}

/* ══ the proof row ════════════════════════════════════════════════ */
.proof { padding-block: 0 var(--s11); border-top: 0; }
.proof-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6);
  border-top: 1px solid var(--rule-soft); padding-top: var(--s7); }
.proof-row li { display: grid; gap: var(--s2); align-content: start; }
.proof-row b { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }
.proof-row span { color: var(--ink-2); font-size: var(--t-caption); line-height: 1.5; }
@media (max-width: 860px) { .proof-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .proof-row { grid-template-columns: minmax(0, 1fr); } }

}
