/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --bg-hover: #1a1a1a;
  --border: #262626;
  --border-focus: #404040;
  --text: #e5e5e5;
  --text-dim: #737373;
  --text-bright: #f5f5f5;
  --accent: #f59e0b;
  --accent-dim: #78350f;
  --blue: #60a5fa;
  --purple: #c084fc;
  --green: #22c55e;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max-w: 720px;
}

.light-theme {
  --bg: #fafaf9;
  --bg-surface: #f4f4f2;
  --bg-hover: #eeeeec;
  --border: #d4d4d0;
  --border-focus: #a3a3a0;
  --text: #1a1a1a;
  --text-dim: #737373;
  --text-bright: #000;
  --accent: #b45309;
  --accent-dim: #fde68a;
  --blue: #2563eb;
  --purple: #7c3aed;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
  min-height: 100vh;
  font-feature-settings: "calt" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.15s ease, color 0.15s ease;
}
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.1s ease, color 0.1s ease;
}
a:hover { border-bottom-color: var(--accent); }
ul { list-style: none; }
button { font-family: inherit; }

::selection { background: var(--accent); color: var(--bg); }

/* ── Layout ────────────────────────────────────────────────── */
#app {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-bright);
  font-weight: 600;
  font-size: 14px;
  border-bottom: none;
}
.brand:hover { border-bottom: none; color: var(--accent); }

.brand-mark { color: var(--accent); font-size: 10px; }
.brand-name { letter-spacing: 0.5px; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-nav a {
  color: var(--text-dim);
  font-size: 13px;
  border-bottom: none;
}
.header-nav a:hover { color: var(--accent); border-bottom: none; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(180deg);
}

main { flex: 1; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { padding: 40px 0 12px; }

.prompt {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
}
.prompt-user { color: var(--accent); }
.prompt-host { color: var(--blue); }
.prompt-path { color: var(--purple); }
.prompt-sep { color: var(--text-dim); margin: 0 1px; }
.prompt-char { color: var(--text-bright); margin-left: 8px; }

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  margin-left: 6px;
  animation: blink 1.1s steps(2) infinite;
  vertical-align: -2px;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.hero-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
  letter-spacing: 0.2px;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}
.hero-links a { color: var(--text); border-bottom: 1px solid var(--border); }
.hero-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.sep { color: var(--text-dim); user-select: none; }

/* ── Currently building ────────────────────────────────────── */
.now-building {
  display: block;
  padding: 12px 14px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.now-building:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.now-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.now-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.now-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.now-sep { color: var(--border-focus); }
.now-name {
  color: var(--text-bright);
  font-weight: 600;
}
.now-desc {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 10px;
  padding-left: 17px; /* align under text, past the dot */
  max-width: 62ch;
}
.now-arrow {
  margin-left: auto;
  color: var(--text-dim);
  transition: transform 0.15s ease, color 0.15s ease;
}
.now-building:hover .now-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .now-dot { animation: none; }
}

/* ── Sections ──────────────────────────────────────────────── */
.section { padding: 48px 0; }

.section-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
  overflow: hidden;
  white-space: nowrap;
}

.prose p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 62ch;
}
.prose p:last-child { margin-bottom: 0; }
.prose a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
}
.prose a:hover { border-bottom-color: var(--accent); }

/* ── Projects ──────────────────────────────────────────────── */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.project:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.project-media {
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: saturate(0.9);
}
.project:hover .project-media img {
  transform: scale(1.03);
  filter: saturate(1);
}

/* Zoomed-out variant: show full image, letterbox against the media bg */
.project-media--contain img {
  object-fit: contain;
  transform: scale(0.88);
}
.project:hover .project-media--contain img {
  transform: scale(0.91);
}

.project-body { padding: 16px 18px 18px; }

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.project-name {
  font-size: 15px;
  font-weight: 600;
}
.project-name a {
  color: var(--text-bright);
  border-bottom: none;
}
.project-name a:hover { color: var(--accent); border-bottom: none; }

.project-status {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green);
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  flex-shrink: 0;
}
.project-status[data-status="client"] { color: var(--purple); }
.project-status[data-status="wip"] { color: var(--accent); }

.project-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 14px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tags li {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.footer-left { display: flex; align-items: center; gap: 8px; }
.footer-right { display: flex; align-items: center; gap: 10px; }
.footer-right a { color: var(--text-dim); border-bottom: none; }
.footer-right a:hover { color: var(--accent); border-bottom: none; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  html { font-size: 13px; }
  #app { padding: 0 18px; }
  header { padding: 16px 0; margin-bottom: 36px; }
  .header-nav { gap: 14px; }
  .header-nav a { font-size: 12px; }
  .hero { padding: 24px 0 56px; }
  .hero-links { gap: 8px; font-size: 12px; }
  .section { padding: 36px 0; }
  .projects { grid-template-columns: 1fr; }
  .footer-right .sep:last-of-type,
  .hero-links .sep { display: inline; }
}

@media (max-width: 420px) {
  .header-nav a:not(:last-child) { display: none; }
  .section-label { font-size: 10px; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor { animation: none; opacity: 1; }
}
