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

:root {
  --ink:      #0f172a;
  --body:     #374151;
  --muted:    #6b7280;
  --rule:     #e5e7eb;
  --accent:   #1d4ed8;
  --bg:       #ffffff;
  --bg-soft:  #f9fafb;
  --max:      760px;
  --gap:      2rem;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body);
  background: var(--bg);
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ── Sections ── */
section {
  padding: 5rem var(--gap);
}

.inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

h1, h2 {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  line-height: 1.2;
}

h2 { font-size: 2rem; margin-bottom: 1.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

hr.divider {
  border: none;
  border-top: 1px solid var(--rule);
}

a { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1e3a8a; }
.btn-secondary { border: 1px solid var(--rule); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }

/* ── Hero ── */
#hero {
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
}

.hero-layout {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-photo {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--rule);
}

.hero-photo-placeholder {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px dashed var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.25rem);
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--body);
  max-width: 520px;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.hero-tagline strong { font-weight: 500; color: var(--ink); }

.cta-group { display: flex; gap: 0.875rem; flex-wrap: wrap; }

/* ── About ── */
#about { background: var(--bg-soft); }

.about-meta {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
}

.meta-item { font-size: 0.82rem; color: var(--muted); }
.meta-item strong { color: var(--ink); font-weight: 500; }

/* ── Expertise ── */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.expertise-card {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.4rem;
}

.expertise-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.expertise-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Experience ── */
#experience { background: var(--bg-soft); }

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 1px;
  background: var(--rule);
}

.timeline-item {
  position: relative;
  padding: 1.75rem 0 1.75rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 2.25rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--rule);
  transition: border-color 0.15s;
}

.timeline-item:first-child::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}

.tl-meta { font-size: 0.76rem; color: var(--muted); font-weight: 500; margin-bottom: 0.25rem; }
.tl-title { font-size: 0.975rem; font-weight: 600; color: var(--ink); margin-bottom: 0.1rem; }
.tl-company { font-size: 0.85rem; color: var(--accent); font-weight: 500; margin-bottom: 0.65rem; }
.tl-desc { font-size: 0.875rem; color: var(--body); line-height: 1.65; margin: 0; }

/* ── Contact ── */
#contact { text-align: center; }
#contact h2 { margin-bottom: 0.75rem; }

.contact-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.contact-avail { font-size: 0.78rem; color: var(--muted); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem var(--gap);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Writing page ── */
.page-hero {
  padding: 4rem var(--gap) 3rem;
  border-bottom: 1px solid var(--rule);
}

.page-hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.page-hero p { color: var(--muted); font-size: 0.95rem; }

.writing-section {
  padding: 3.5rem var(--gap);
}

.writing-section + .writing-section {
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
}

.article-list { margin-top: 1.5rem; display: flex; flex-direction: column; }

.article-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.article-item:last-child { border-bottom: none; }
.article-item:hover { opacity: 0.75; }

.article-date {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  padding-top: 0.2rem;
  line-height: 1.3;
}

.article-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.article-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.ext-list { margin-top: 1.5rem; display: flex; flex-direction: column; }

.ext-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.ext-item:last-child { border-bottom: none; }
.ext-item:hover { opacity: 0.75; }

.ext-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.ext-title { font-size: 0.9rem; color: var(--ink); font-weight: 500; line-height: 1.5; }

/* ── Article page ── */
.article-header {
  padding: 4rem var(--gap) 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.article-byline {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.article-body {
  max-width: var(--max);
  margin: 3rem auto;
  padding: 0 var(--gap);
  font-size: 1.0125rem;
  line-height: 1.8;
  color: var(--body);
}

.article-body h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.5rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--ink);
  font-style: italic;
}

.article-back {
  padding: 2rem var(--gap);
  border-top: 1px solid var(--rule);
  max-width: var(--max);
  margin: 0 auto;
}

.article-back a { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.article-back a:hover { color: var(--accent); }

/* ── Projects page ── */
.projects-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(29,78,216,0.08);
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.project-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  background: #eff6ff;
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
}

.project-link {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  section, .writing-section { padding: 3rem var(--gap); }
  #hero { padding-top: 3.5rem; padding-bottom: 3.5rem; }

  .hero-layout { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .hero-photo, .hero-photo-placeholder { width: 100px; height: 100px; }

  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.72rem; }

  .article-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .article-date { font-size: 0.72rem; }
}
