:root {
  --bg: #1a1712;
  --surface: #221f18;
  --surface-2: #29251c;
  --text: #f0ead6;
  --text-dim: #a89e87;
  --border: #3d3728;
  --amber: #ffb000;
  --amber-dim: #b57e10;
  --amber-text: #ffb000;
  --rust: #c9553d;
  --green: #8faa76;
  --shadow: rgba(0,0,0,0.6);
  --scanline: rgba(255,255,255,0.012);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f1e4;
  --surface: #eee7d4;
  --surface-2: #e5dcc3;
  --text: #241f14;
  --text-dim: #6e6450;
  --border: #d9cca9;
  --amber: #b5760a;
  --amber-dim: #8f5c07;
  --amber-text: #995f08;
  --rust: #a8402a;
  --green: #55703f;
  --shadow: rgba(120,105,70,0.18);
  --scanline: rgba(0,0,0,0.02);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Work Sans', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > footer { margin-top: auto; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, var(--scanline) 0px, var(--scanline) 1px, transparent 1px, transparent 3px);
  z-index: 1000;
  transition: background 0.2s ease;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */
nav {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
nav .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand .dot { color: var(--amber); }
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--amber); }

.theme-toggle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
}
.theme-toggle:hover { color: var(--amber); border-color: var(--amber-dim); }

/* ---------- hero ---------- */
header.hero {
  padding: 72px 0 56px;
}
header.hero.compact {
  padding-bottom: 28px;
}
header.hero.compact .tagline {
  margin-bottom: 0;
}
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 18px;
}
h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(32px, 6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
}
.tagline {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 34px;
}

/* terminal component */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px -20px var(--shadow);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.terminal-bar .dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  display: block;
}
.terminal-bar .label {
  margin-left: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
@media (max-width: 420px) {
  .terminal-bar .label { display: none; }
}
.terminal-body {
  padding: 22px 20px 26px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px;
  min-height: 172px;
}
.terminal-line { margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
.prompt { color: var(--green); }
.comment { color: var(--text-dim); }
.old-cmd { color: var(--rust); }
.new-cmd { color: var(--amber); font-weight: 600; }
.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--amber);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: var(--amber);
  color: #1a1712;
  border-color: var(--amber);
  font-weight: 600;
}
.btn-primary:hover { background: #ffc229; text-decoration: none; }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { border-color: var(--amber-dim); text-decoration: none; }

/* ---------- sections ---------- */
section { padding: 52px 0; border-top: 1px dashed var(--border); }

.section-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--amber-dim);
  margin-bottom: 10px;
}
h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--text);
}
p { color: var(--text-dim); max-width: 62ch; }
p + p { margin-top: 12px; }

.features {
  list-style: none;
  margin-top: 22px;
  display: grid;
  gap: 14px;
}
.features li {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--text);
  padding-left: 22px;
  position: relative;
}
.features li::before {
  content: "$";
  position: absolute;
  left: 0;
  color: var(--green);
}
.features li .desc {
  display: block;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 3px;
  padding-left: 0;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text);
  overflow-x: auto;
  margin: 14px 0;
  position: relative;
}
.code-block .comment { display: block; margin-bottom: 4px; }

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--amber); border-color: var(--amber-dim); }

h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: var(--text);
  margin: 22px 0 8px;
}

/* ---------- project cards (hub homepage) ---------- */
.project-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
  border-color: var(--amber-dim);
  text-decoration: none;
  transform: translateY(-1px);
}
.project-card.disabled {
  opacity: 0.55;
  cursor: default;
}
.project-card.disabled:hover { border-color: var(--border); transform: none; }
.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.project-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.project-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--amber-dim);
  white-space: nowrap;
}
.project-desc { color: var(--text-dim); font-size: 14px; max-width: 60ch; }
.project-stack {
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-dim);
}

footer {
  border-top: 1px solid var(--border);
  padding: 30px 0 50px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
footer .mono { font-size: 12px; color: var(--text-dim); }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--amber); }

@media (max-width: 560px) {
  .terminal-body { font-size: 12px; }
  footer .wrap { flex-direction: column; align-items: flex-start; }
}

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