:root {
  --bg: #ffffff;
  --text: #1a1c20;
  --text-muted: #6b7078;
  --accent: #b5651d;
  --border: #e2e4e8;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 720px;
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --text: #e8e9ec;
  --text-muted: #8b8f98;
  --accent: #e0a56f;
  --border: #2a2d33;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --text: #e8e9ec;
    --text-muted: #8b8f98;
    --accent: #e0a56f;
    --border: #2a2d33;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  z-index: 10;
}

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* Intro */
.intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  font-size: 1.9rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

.intro h1 .thin { font-weight: 400; color: var(--text-muted); }

.tagline {
  margin: 0 0 1.25rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--text-muted);
}

.intro-text p {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.links-line {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.links-line span { color: var(--text-muted); margin: 0 0.4rem; }

.intro-photo {
  margin: 0;
  text-align: center;
}

.intro-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
}

.intro-photo figcaption {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Sections */
section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

h2 {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 1.5rem;
  text-transform: lowercase;
}

/* Projects */
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.project-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.75rem;
}

.row-index {
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 0.15rem;
}

.row-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.row-body p {
  margin: 0 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.row-tags {
  font-family: var(--mono);
  font-size: 0.8rem !important;
  color: var(--text-muted);
}

.row-links {
  font-family: var(--mono);
  font-size: 0.8rem !important;
  margin-top: 0.4rem !important;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 560px) {
  .intro {
    grid-template-columns: 1fr;
  }
  .intro-photo { order: -1; }
  .intro-photo img { width: 120px; height: 120px; }
}
