/* ─────────────────────────────────────────────────────────────────────────
   Design tokens
───────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #0b0f14;
  --bg-raised: #10151c;
  --line: #1f2733;
  --text: #e7e5dd;
  --text-dim: #8a93a3;
  --accent: #e8a33d;
  --accent-dim: #a8763a;
  --danger: #d97757;
  --ok: #7fb88f;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --max-width: 760px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2vw + 1rem, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; color: var(--text); max-width: 68ch; }

code, .mono { font-family: var(--font-mono); }

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

/* ─────────────────────────────────────────────────────────────────────────
   Layout shell
───────────────────────────────────────────────────────────────────────── */
.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose { max-width: var(--max-width); }

/* ─────────────────────────────────────────────────────────────────────────
   Nav
───────────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 20, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-nav .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 920px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.nav-links a { color: var(--text-dim); text-decoration: none; }
.nav-links a:hover { color: var(--accent); }

.nav-toggle { display: none; }

.nav-link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.nav-link-btn:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav-links { gap: 1rem; font-size: 0.82rem; flex-wrap: wrap; justify-content: flex-end; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Buttons / tags
───────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65em 1.1em;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1305;
  font-weight: 600;
}
.btn-primary:hover { background: #f0b25c; border-color: #f0b25c; color: #1a1305; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25em 0.6em;
  margin: 0 0.4em 0.4em 0;
}

.status-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(127, 184, 143, 0.15);
}

.cursor-blink {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  margin-left: 0.15em;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ─────────────────────────────────────────────────────────────────────────
   Sections / panels
───────────────────────────────────────────────────────────────────────── */
.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}
.section:last-child { border-bottom: none; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-raised);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   Home hero
───────────────────────────────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 3.5rem;
}
.hero-status {
  margin-bottom: 1.5rem;
}
.hero h1 { margin-bottom: 0.4em; }
.hero-role {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 1.8rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.2rem;
}
.hero-links {
  display: flex;
  gap: 1.1rem;
  align-items: center;
}
.hero-links a { color: var(--text-dim); font-size: 1.15rem; }
.hero-links a:hover { color: var(--accent); }
.hero-tags { margin-top: 2.4rem; }

/* ─────────────────────────────────────────────────────────────────────────
   About
───────────────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about-photo {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  filter: grayscale(0.3);
}
@media (max-width: 600px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { width: 140px; }
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.skill-group .icons i { font-size: 1.6rem; margin-right: 0.5rem; color: var(--text-dim); }

/* ─────────────────────────────────────────────────────────────────────────
   Projects
───────────────────────────────────────────────────────────────────────── */
.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}
.project:last-child { border-bottom: none; }
.project img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}
.project .stack { margin: 0.8rem 0 1rem; }
.project-link { font-family: var(--font-mono); font-size: 0.85rem; }
@media (max-width: 700px) {
  .project { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Resume / timeline
───────────────────────────────────────────────────────────────────────── */
.timeline {
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
  margin-left: 0.25rem;
}
.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.56rem;
  top: 0.35rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.timeline-item h3 { margin-bottom: 0.2rem; }
.timeline-item .org { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 0.6rem; }
.timeline-item ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--text-dim); }
.timeline-item li { margin-bottom: 0.3rem; }

.resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.resume-grid .panel h3 { font-size: 0.9rem; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 0.8rem; }
.resume-grid ul { margin: 0; padding-left: 1.1rem; }
.resume-grid li { margin-bottom: 0.35rem; }

/* ─────────────────────────────────────────────────────────────────────────
   Blog
───────────────────────────────────────────────────────────────────────── */
.post-list-item {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line);
}
.post-list-item:first-child { padding-top: 0; }
.post-list-item h2 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.post-list-item h2 a { text-decoration: none; }
.post-excerpt { color: var(--text-dim); margin-bottom: 0.5rem; }
.post-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); }

.pagination { display: flex; justify-content: space-between; margin-top: 2rem; }

article .post-body { margin-bottom: 2rem; }
article .post-body img { max-width: 100%; border-radius: var(--radius); }

.comment { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment .author { font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────────────
   Forms
───────────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 0.7em 0.85em;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field-checkbox { display: flex; align-items: center; gap: 0.6em; font-size: 0.9rem; color: var(--text-dim); }
.field-checkbox input { width: auto; }

.alert {
  border-radius: var(--radius);
  padding: 0.9em 1.1em;
  margin-bottom: 1.2rem;
  font-size: 0.92rem;
  border: 1px solid;
}
.alert-danger { border-color: var(--danger); color: var(--danger); }
.alert-success { border-color: var(--ok); color: var(--ok); }

/* ─────────────────────────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 2.5rem 0 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
