:root {
  --bg: #0B0B0D;
  --surface: #0F0F12;
  --hover: #131316;
  --line: #1E1E23;
  --line-2: #26262C;
  --border: #2A2A30;
  --guide: #3A3A42;
  --text: #E8E8E3;
  --soft: #C9C9C4;
  --out: #A3A3AA;
  --muted: #9C9CA3;
  --dim: #85858D;
  --num: #7E7E86;
  --accent: #C8F560;
  --accent-hover: #D9FA8C;
  --code-dim: #1D1D22;
  --code-lit: #8C8C95;
  --code-comment: #5A5A62;
  --gutter: clamp(20px, 4vw, 56px);
  --font: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a.inline { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  font: 500 13px var(--font);
  cursor: pointer;
}
.pill:hover { border-color: var(--accent); color: var(--text); }

/* hero */

.hero {
  --lx: 60%;
  --ly: 50%;
  --light-r: 260px;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.code-layer {
  position: absolute;
  inset: 0;
  padding: 104px 56px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  font-size: 14px;
  line-height: 24px;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}
.code-col { display: flex; flex-direction: column; min-width: 0; }
.code-line { display: block; height: 24px; white-space: pre; }
.code-dim { color: var(--code-dim); }
.code-lit {
  color: var(--code-lit);
  -webkit-mask-image: radial-gradient(circle var(--light-r) at var(--lx) var(--ly), #000 0%, rgba(0, 0, 0, 0.75) 40%, transparent 100%);
  mask-image: radial-gradient(circle var(--light-r) at var(--lx) var(--ly), #000 0%, rgba(0, 0, 0, 0.75) 40%, transparent 100%);
}
.tk-kw { color: var(--accent); }
.tk-str { color: var(--text); }
.tk-com { color: var(--code-comment); }

.hero-inner { position: relative; flex: 1; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 28px 0;
  font-size: 14px;
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }

.hero-main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  padding: 24px 0 64px;
}
.hero-text {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-shadow: 0 0 12px var(--bg), 0 0 4px var(--bg);
}
.status { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.92;
  font-weight: 500;
  letter-spacing: -0.05em;
}
.role { margin: 0; display: flex; align-items: center; gap: 8px; font-size: clamp(18px, 1.8vw, 24px); color: var(--muted); }
.lede { margin: 0; max-width: 440px; font-size: 15px; line-height: 1.7; color: var(--muted); text-wrap: pretty; }

.terminal-wrap { flex: 1 1 520px; max-width: 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.terminal {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 48px 96px -24px rgba(0, 0, 0, 0.7);
}
.terminal:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.term-bar > span { width: 11px; height: 11px; border-radius: 50%; background: #2C2C33; }
.term-bar p { flex: 1; margin: 0 49px 0 0; text-align: center; font-size: 12px; color: var(--dim); }
.term-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  height: 340px;
  padding: 18px 20px 20px;
  font-size: 14px;
  line-height: 1.65;
  overflow: hidden;
  cursor: text;
}
.term-lines { display: flex; flex-direction: column; gap: 2px; }
.tl { display: flex; gap: 10px; min-width: 0; }
.tl-text { white-space: pre-wrap; word-break: break-word; }
.tl-cmd .tl-text { color: var(--text); }
.tl-out .tl-text { color: var(--out); }
.tl-hi .tl-text { color: var(--accent); }
.ps1 { flex: none; color: var(--accent); }
.prompt-line { display: flex; align-items: center; gap: 10px; }
.typed { white-space: pre; }
.prompt-line .caret { flex: none; width: 8px; height: 17px; }
.terminal.is-focused .prompt-line .caret { display: none; }
#term-input {
  flex: 1;
  min-width: 40px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--accent);
}
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips > span { margin-right: 4px; font-size: 13px; color: var(--dim); }

/* tmux status line */

.tmux { border-block: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.tmux .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 32px;
  padding-block: 12px;
}
.tmux-tabs { display: flex; flex-wrap: wrap; }
.tmux-tabs span { padding: 3px 10px; color: var(--muted); }
.tmux-tabs .session { background: var(--accent); color: var(--bg); font-weight: 600; }
.tmux-tabs .active { background: #1C1C21; color: var(--text); }
.tmux-stats { color: var(--muted); }

/* sections */

.section { padding-block: clamp(80px, 10vw, 140px); }
.bordered { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 16px; }
.kicker { margin: 0; font-size: 13px; color: var(--dim); }
.section-head h2 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.ps { color: var(--accent); }
.sub { margin: 0; max-width: 520px; font-size: 15px; line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.split { display: flex; flex-wrap: wrap; gap: 48px 64px; }
.split > .section-head { flex: 1 1 460px; min-width: 0; }
.split > .section-body { flex: 2 1 560px; min-width: 0; }

/* work: tree */

.work { display: flex; flex-direction: column; gap: 48px; }
.tree {
  --dir-size: clamp(20px, 2.2vw, 28px);
  --name-size: clamp(18px, 2vw, 24px);
  --dir-mid: calc(24px + var(--dir-size) * 0.6);
  --name-mid: calc(18px + var(--name-size) * 0.65);
  --guide-1: 8px;
  --guide-2: 40px;
  --dir-indent: 32px;
  --node-indent: 64px;
  display: flex;
  flex-direction: column;
}
.tree-root { margin: 0; font-size: 15px; }
.tree-group { position: relative; }
.tree-group::before {
  content: "";
  position: absolute;
  left: var(--guide-1);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--guide);
}
.tree-group:last-child::before { bottom: auto; height: calc(var(--dir-mid) + 1px); }
.tree-dir {
  position: relative;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
  padding: 24px 0 10px var(--dir-indent);
  font-size: var(--dir-size);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.tree-dir::before {
  content: "";
  position: absolute;
  left: var(--guide-1);
  top: var(--dir-mid);
  width: calc(var(--dir-indent) - var(--guide-1) - 6px);
  height: 1px;
  background: var(--guide);
}
.tree-dir::after {
  content: "";
  position: absolute;
  left: var(--guide-2);
  bottom: 0;
  width: 1px;
  height: 10px;
  background: var(--guide);
}
.tree-dir small { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }

.node { position: relative; padding-left: var(--node-indent); }
.node::before {
  content: "";
  position: absolute;
  left: var(--guide-2);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--guide);
}
.node:last-child::before { bottom: auto; height: calc(var(--name-mid) + 1px); }
.node::after {
  content: "";
  position: absolute;
  left: var(--guide-2);
  top: var(--name-mid);
  width: calc(var(--node-indent) - var(--guide-2) - 6px);
  height: 1px;
  background: var(--guide);
}
.node summary {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 28px;
  min-height: 44px;
  padding: 18px 40px 18px 8px;
  border-radius: 10px;
  list-style: none;
  cursor: pointer;
}
.node summary::-webkit-details-marker { display: none; }
.node summary:hover { background: var(--hover); }
.name { flex: 0 1 240px; font-size: var(--name-size); line-height: 1.3; letter-spacing: -0.02em; }
.meta { flex: 0 0 170px; font-size: 13px; color: var(--muted); }
.line { flex: 1 1 240px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.sign { position: absolute; top: 18px; right: 12px; font-size: var(--name-size); line-height: 1.3; color: var(--accent); }
.sign::before { content: "+"; }
details[open] .name { color: var(--accent); }
details[open] .sign::before { content: "−"; }

.readme { display: flex; flex-direction: column; gap: 16px; padding: 0 8px 28px; font-size: 14px; line-height: 1.7; }
.readme p { margin: 0; max-width: 680px; color: var(--soft); text-wrap: pretty; }
.readme .cmd { color: var(--dim); }
.readme .note { color: var(--accent); }
.readme .pill { align-self: flex-start; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--out); }

/* log */

.log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.commit {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 0 0 28px 33px;
  font-size: 14px;
  line-height: 1.6;
}
.commit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.commit.head::before { background: var(--accent); }
.commit::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--line-2);
}
.commit:last-child::after, .commit:has(+ [hidden])::after { display: none; }
.hash { color: var(--accent); }
.ref { font-weight: 600; }
.year { color: var(--dim); }
.msg { flex: 1 1 100%; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.5; color: var(--soft); text-wrap: pretty; }
#log-toggle { margin-left: 33px; }

/* readme file */

.file-view { border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); overflow: hidden; align-self: flex-start; }
.file-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
}
.file { margin: 0; padding: 20px 20px 24px; list-style: none; counter-reset: ln; font-size: 15px; line-height: 1.75; }
.file li { counter-increment: ln; display: flex; gap: 20px; min-height: 1.75em; white-space: pre-wrap; color: var(--soft); }
.file li::before { content: counter(ln); flex: 0 0 22px; text-align: right; color: var(--num); }
.file .h { color: var(--accent); }
.file .p { color: var(--text); }

/* contact */

.contact { padding-bottom: clamp(64px, 8vw, 100px); }
.contact .wrap { display: flex; flex-direction: column; gap: 40px; }
.say {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.12em;
  font-size: clamp(64px, 13vw, 200px);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: -0.06em;
}
.say .caret { width: 0.5em; height: 0.85em; }
.contact .sub { font-size: 16px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mail {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 600;
  word-break: break-all;
}
.mail:hover { background: var(--accent-hover); color: var(--bg); }
.contact-actions .pill { min-height: 56px; padding: 0 22px; font-size: 14px; }
.elsewhere { display: flex; flex-wrap: wrap; gap: 12px 36px; font-size: 16px; }

.footer { border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-block: 24px;
}
.footer a { color: var(--dim); }
.footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .hero { --light-r: 150px; }
  .tree { --guide-1: 4px; --guide-2: 20px; --dir-indent: 18px; --node-indent: 34px; }
  .readme { padding-inline: 8px 0; }
  .code-layer { padding: 96px 20px 0; grid-template-columns: minmax(0, 1fr); font-size: 12px; line-height: 20px; }
  .code-line { height: 20px; }
  .hero-main { gap: 40px; padding-bottom: 48px; }
  .term-body { height: 300px; padding: 14px 14px 16px; font-size: 13px; }
  /* iOS zooms into inputs smaller than 16px */
  #term-input { font-size: 16px; }
}

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