:root {
  --bg: #FAFAF7;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --ink-faint: #8A8A8A;
  --accent: #B8763D;
  --rule: #E6E4DD;
  --max: 640px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 28px 160px;
}

/* ======= HEADER (shared, with back-link variant) ======= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 96px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a.header-name:hover { color: var(--accent); border-bottom-color: var(--accent); }

.header-location {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0;
}

.header-location .arrow {
  display: inline-block;
  margin: 0 6px;
  color: var(--ink-faint);
  opacity: 0.6;
}

.header-back {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}
.header-back:hover { color: var(--accent); }

/* ======= HERO ======= */
.hero {
  margin-bottom: 80px;
}

.hero h1 {
  font-size: 34px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 32px;
}

.hero p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.hero p:last-child {
  margin-bottom: 0;
}

.hero p em { font-style: italic; color: var(--ink); }

.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-top: -8px;
}

.hero-sub a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
  margin-left: 6px;
}

.hero-sub a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ======= PROJECT-PAGE HERO (smaller H1) ======= */
.page-hero { margin-bottom: 56px; }

.page-hero .eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 16px;
  display: block;
}

.page-hero h1 {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
}

.page-hero .tagline {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ======= SECTION ======= */
section { margin-bottom: 80px; }

.section-label {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 28px;
  display: block;
}

/* ======= PROSE BODY ======= */
.prose p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose em { font-style: italic; color: var(--ink); }
.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease, color 0.15s ease;
  padding-bottom: 1px;
}
.prose a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ======= META ROW (stack/links under project hero) ======= */
.meta-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 56px;
}

.meta-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
  font-size: 15px;
}

.meta-label {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  min-width: 60px;
  flex-shrink: 0;
}

.meta-value { color: var(--ink); }
.meta-value a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease, color 0.15s ease;
  padding-bottom: 1px;
  margin-right: 16px;
  display: inline-block;
}
.meta-value a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.meta-value .ext::after { content: " ↗"; font-size: 0.85em; color: var(--ink-faint); margin-left: 2px; }

/* ======= NOW ======= */
.now-text { font-size: 17px; line-height: 1.7; color: var(--ink-soft); }
.now-text strong { color: var(--ink); font-weight: 500; }

/* ======= PROJECTS LIST (home) ======= */
.project-list { list-style: none; }

.project-item {
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.project-item:last-child { border-bottom: 1px solid var(--rule); }

.project-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 6px;
}

.project-name { font-size: 17px; font-weight: 500; color: var(--ink); }
.project-name a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.project-name a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.project-year {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.project-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 540px;
}

/* ======= BACKGROUND ======= */
.bg-list { list-style: none; }

.bg-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  gap: 20px;
}
.bg-item:not(:last-child) { border-bottom: 1px solid var(--rule); }

.bg-role { font-size: 16px; color: var(--ink); }
.bg-role-title { font-weight: 500; }
.bg-role-company { color: var(--ink-soft); }
.bg-dates {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ======= ARTICLE LIST (writing page) ======= */
.article-list { list-style: none; }

.article-item {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.article-item:last-child { border-bottom: 1px solid var(--rule); }

.article-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 8px;
  display: block;
}

.article-title a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.article-title a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.article-title a.placeholder {
  color: var(--ink-faint);
  cursor: default;
  pointer-events: none;
}

.article-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 10px;
  display: block;
}

.article-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 540px;
}

/* ======= READING LIST ======= */
.reading-list {
  list-style: none;
}

.reading-list li {
  padding: 10px 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

.reading-list li:last-child {
  border-bottom: none;
}

.reading-title {
  color: var(--ink);
  font-style: italic;
}

.reading-title-link {
  color: var(--ink);
  text-decoration: none;
  font-style: italic;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease, color 0.15s ease;
  padding-bottom: 1px;
}

.reading-title-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ======= CONTACT ======= */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease, color 0.15s ease;
  display: inline-block;
  padding-bottom: 2px;
}
.contact-list a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact-list .ext::after {
  content: " ↗";
  font-size: 0.85em;
  color: var(--ink-faint);
  margin-left: 2px;
}

/* ======= FOOTER ======= */
footer {
  margin-top: 120px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

footer a {
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}
footer a:hover { color: var(--accent); }

/* ======= RESPONSIVE ======= */
@media (max-width: 640px) {
  .wrap { padding: 48px 24px 120px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 16px; }
  .page-hero h1 { font-size: 24px; }
  .header { margin-bottom: 64px; }
  .project-row { flex-direction: column; gap: 4px; align-items: flex-start; }
  .bg-item { flex-direction: column; gap: 4px; align-items: flex-start; padding: 16px 0; }
  .meta-item { flex-direction: column; gap: 4px; align-items: flex-start; }
  .meta-label { min-width: auto; }
}

/* ======= ENTRANCE ======= */
.wrap > * {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.6s ease forwards;
}
.wrap > *:nth-child(1) { animation-delay: 0.05s; }
.wrap > *:nth-child(2) { animation-delay: 0.15s; }
.wrap > *:nth-child(3) { animation-delay: 0.25s; }
.wrap > *:nth-child(4) { animation-delay: 0.35s; }
.wrap > *:nth-child(5) { animation-delay: 0.45s; }
.wrap > *:nth-child(6) { animation-delay: 0.55s; }
.wrap > *:nth-child(7) { animation-delay: 0.65s; }
.wrap > *:nth-child(8) { animation-delay: 0.75s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .wrap > * { opacity: 1; transform: none; animation: none; }
}
