:root{
  --bg: #12151B;
  --surface: #1B1F27;
  --border: #313744;
  --text: #E8E6DF;
  --text-dim: #9BA1AE;
  --text-faint: #656B78;
  --amber: #E8A33D;
  --teal: #4FB0A5;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.display{ font-family: 'Space Grotesk', sans-serif; }
.mono{ font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.02em; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.wrap{ max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* ---------- NAV ---------- */
nav{
  position: sticky; top: 0; z-index: 50;
  background: rgba(18,21,27,0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
nav .wrap{ display:flex; align-items:center; justify-content:space-between; height:64px; }
.mark{ font-family:'Space Grotesk'; font-weight:600; font-size:17px; display:flex; align-items:center; gap:8px; }
.mark .dot{ width:7px; height:7px; border-radius:50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(232,163,61,0.15); }
.navlinks{ display:flex; gap:32px; font-size:14px; color: var(--text-dim); align-items:center; }
.navlinks a{ transition: color .15s ease; padding: 4px 0; border-bottom: 1px solid transparent; }
.navlinks a:hover, .navlinks a.active{ color: var(--text); border-color: var(--amber); }
.navlinks .resume{ color: var(--text); border: 1px solid var(--border); padding: 6px 14px; border-radius: var(--radius); }
.navlinks .resume:hover{ border-color: var(--amber); }

/* ---------- HERO ---------- */
header.hero{ padding: 96px 0 72px; border-bottom: 1px solid var(--border); }
.eyebrow{ font-size: 12.5px; color: var(--teal); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 20px; display:flex; align-items:center; gap:10px; }
.eyebrow::before{ content:''; width:16px; height:1px; background: var(--teal); }
h1.headline{
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.12;
  max-width: 760px;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}
h1.headline .accent{ color: var(--amber); }
.sub{ font-size: 17px; color: var(--text-dim); max-width: 540px; margin: 0 0 36px; }

.now-strip{
  display:inline-flex; align-items:center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
}
.pulse{ width:8px; height:8px; border-radius:50%; background: var(--amber); position:relative; flex-shrink:0; }
.pulse::after{
  content:''; position:absolute; inset:-5px; border-radius:50%;
  border: 1px solid var(--amber); opacity: 0.6;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse{ 0%{ transform:scale(0.6); opacity:0.7;} 100%{ transform:scale(2.1); opacity:0;} }
.now-strip .label{ color: var(--text-faint); }
.now-strip .val{ color: var(--text); }

/* ---------- PAGE HEADER (work.html / writing.html) ---------- */
.page-header{ padding: 64px 0 48px; border-bottom: 1px solid var(--border); }
.page-header h1{ font-family:'Space Grotesk'; font-size: clamp(30px,4vw,42px); margin: 0 0 14px; }
.page-header p{ color: var(--text-dim); max-width: 560px; margin:0; font-size:15.5px; }
.back-link{ font-size: 13px; color: var(--text-dim); display:inline-flex; align-items:center; gap:6px; margin-bottom: 20px; }
.back-link:hover{ color: var(--amber); }

/* ---------- THREE DOORS ---------- */
.doors{ display:grid; grid-template-columns: repeat(3,1fr); gap:1px; background: var(--border); border: 1px solid var(--border); margin: 0 0 -1px; }
.door{ background: var(--bg); padding: 36px 30px; transition: background .18s ease; }
.door:hover{ background: var(--surface); }
.door .num{ font-family:'IBM Plex Mono'; font-size:12px; color: var(--text-faint); margin-bottom:18px; display:block; }
.door h3{ font-family:'Space Grotesk'; font-size: 20px; margin: 0 0 10px; }
.door p{ font-size: 14px; color: var(--text-dim); margin: 0 0 20px; }
.door .go{ font-size: 13px; color: var(--amber); display:flex; align-items:center; gap:6px; }
.door:hover .go{ gap:10px; }
.door .go span{ transition: gap .15s ease; }

section{ padding: 88px 0; border-bottom: 1px solid var(--border); }
.sec-head{ display:flex; justify-content:space-between; align-items:flex-end; margin-bottom: 44px; gap: 20px; flex-wrap: wrap; }
.sec-head h2{ font-family:'Space Grotesk'; font-size: 28px; margin:0; }
.sec-head .see-all{ font-size: 13px; color: var(--text-dim); border-bottom: 1px solid var(--border); padding-bottom:2px; }
.sec-head .see-all:hover{ color: var(--amber); border-color: var(--amber); }

/* ---------- WORK ---------- */
.cases{ display:flex; flex-direction:column; gap:1px; background: var(--border); border:1px solid var(--border); }
.case{ background: var(--bg); padding: 26px 28px; display:grid; grid-template-columns: 200px 1fr auto; gap: 24px; align-items:center; }
.case:hover{ background: var(--surface); }
.case .title{ font-family:'Space Grotesk'; font-weight:600; font-size: 16px; }
.case .flow{ font-size: 14px; color: var(--text-dim); }
.case .flow b{ color: var(--text); font-weight:500; }
.case .tags{ display:flex; gap:8px; flex-wrap: wrap; justify-content: flex-end; }
.tag{ font-family:'IBM Plex Mono'; font-size: 11px; color: var(--teal); border: 1px solid rgba(79,176,165,0.35); padding: 3px 8px; border-radius: 20px; white-space:nowrap; background:none; cursor:pointer; }
.tag.active{ color: var(--bg); background: var(--teal); }

/* full case study card (work.html) */
.case-full{ background: var(--bg); border:1px solid var(--border); padding: 30px 32px; margin-bottom: 1px; }
.case-full .title{ font-family:'Space Grotesk'; font-weight:600; font-size: 19px; margin-bottom:16px; }
.case-full dl{ display:grid; grid-template-columns: 110px 1fr; gap: 10px 20px; margin: 0 0 18px; font-size: 14px; }
.case-full dt{ font-family:'IBM Plex Mono'; font-size:11.5px; color: var(--amber); padding-top:2px; }
.case-full dd{ margin:0; color: var(--text-dim); }
.stack-row{ display:flex; gap:8px; flex-wrap:wrap; }

@media (max-width: 720px){
  .case{ grid-template-columns: 1fr; }
  .case .tags{ justify-content:flex-start; }
  .doors{ grid-template-columns: 1fr; }
  .case-full dl{ grid-template-columns: 1fr; }
}

/* ---------- WRITING / GRAPH ---------- */
.writing-layout{ display:grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items:center; }
@media (max-width: 860px){ .writing-layout{ grid-template-columns: 1fr; } }

.graph-box{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.graph-caption{ font-size: 12px; color: var(--text-faint); margin-top: 12px; font-family:'IBM Plex Mono'; }
.graph-caption b{ color: var(--amber); font-weight: 500; }
.graph-legend{ display:flex; gap:18px; margin-top:10px; font-family:'IBM Plex Mono'; font-size:11px; color:var(--text-faint); }
.graph-legend span{ display:inline-flex; align-items:center; gap:6px; }
.legend-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; }
.node-post-svg{ cursor:pointer; }
.node-post-svg text{ pointer-events:none; }

.posts{ display:flex; flex-direction:column; }
.post{ padding: 18px 0; border-bottom: 1px solid var(--border); }
.post:first-child{ padding-top:0; }
.post-meta{ font-family:'IBM Plex Mono'; font-size: 11.5px; color: var(--text-faint); margin-bottom: 8px; display:flex; gap:14px; }
.post-meta .t{ color: var(--teal); cursor:pointer; }
.post h4{ font-family:'Space Grotesk'; font-size: 17px; margin: 0 0 6px; font-weight: 600; }
.post h4 a:hover{ color: var(--amber); }
.post p{ font-size: 13.5px; color: var(--text-dim); margin:0; }

.tag-filter{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 32px; }

/* ---------- POST DETAIL ---------- */
.post-detail .post-meta{ margin-bottom: 18px; }
.post-detail h1{ font-family:'Space Grotesk'; font-size: clamp(26px,4vw,36px); margin: 0 0 28px; line-height:1.2; }
.post-detail .body p{ font-size: 16px; color: var(--text-dim); max-width: 680px; margin: 0 0 20px; }
.post-detail .body p:first-of-type{ color: var(--text); }

/* ---------- NOW ---------- */
.now-panel{ background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; }
.now-panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 26px; }
.now-panel-head .live{ display:flex; align-items:center; gap:8px; font-family:'IBM Plex Mono'; font-size:12px; color: var(--text-faint); }
.status-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 18px; }
.status-list li{ display:grid; grid-template-columns: 100px 1fr; gap: 18px; font-size: 14.5px; }
.status-list .k{ font-family:'IBM Plex Mono'; font-size: 12px; color: var(--amber); padding-top:2px; }
.status-list .v{ color: var(--text); }
.status-list .v span{ color: var(--text-dim); }

/* ---------- ABOUT / FOOTER ---------- */
.about-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 60px; }
@media (max-width: 720px){ .about-grid{ grid-template-columns: 1fr; } }
.about-grid p{ font-size: 15px; color: var(--text-dim); margin: 0 0 16px; }
.links-col{ display:flex; flex-direction:column; gap: 10px; }
.links-col a{ font-size: 14px; display:flex; justify-content:space-between; border-bottom:1px solid var(--border); padding-bottom:10px; color: var(--text-dim); }
.links-col a:hover{ color: var(--amber); }

footer{ padding: 28px 0; }
footer .wrap{ display:flex; justify-content:space-between; font-size:12px; color: var(--text-faint); font-family:'IBM Plex Mono'; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .pulse::after{ animation:none; opacity:0.4; }
}
