@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --navy:      #1e3a5f;
  --blue:      #2563eb;
  --blue-dark: #1e40af;
  --text:      #1f2937;
  --muted:     #64748b;
  --bg:        #ffffff;
  --bg-alt:    #f8fafc;
  --border:    #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 6px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
  --radius:    6px;
  --max-w:     1100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--navy);
  line-height: 1.3;
}

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

/* ── Navigation ──────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 700; color: var(--navy); text-decoration: none;
}
.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a {
  color: var(--text); font-weight: 500; font-size: 0.875rem;
  text-decoration: none; letter-spacing: .04em; text-transform: uppercase;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--blue); }
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: .5rem; color: var(--text);
}

/* ── Page Header ─────────────────────────────────────── */
.page-header {
  background: var(--navy); color: white;
  padding: 4.5rem 0 3.5rem; text-align: center;
}
.page-header h1 { color: white; font-size: clamp(2rem,5vw,3rem); margin-bottom: .75rem; }
.page-header p { color: rgba(255,255,255,.72); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }

/* ── Hero ────────────────────────────────────────────── */
.hero { background: var(--navy); color: white; padding: 6rem 0 5rem; }
.hero-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.hero-eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #93c5fd; margin-bottom: 1rem;
}
.hero h1 { color: white; font-size: clamp(2.5rem,5vw,3.5rem); margin-bottom: 1rem; line-height: 1.2; }
.hero-subtitle { color: rgba(255,255,255,.8); font-size: 1.1rem; margin-bottom: 1.25rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.hero-tag {
  display: inline-block; padding: .25rem .75rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; font-size: .75rem; font-weight: 600;
  letter-spacing: .04em; color: rgba(255,255,255,.9); text-transform: uppercase;
}
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-image { display: flex; justify-content: center; }
.avatar-placeholder {
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 3px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 5.5rem; color: rgba(255,255,255,.5);
  font-family: 'Playfair Display', serif;
}
.avatar-photo {
  width: 280px; height: 280px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 4px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block; padding: .75rem 1.75rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; text-decoration: none;
  transition: all .2s; cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn-outline { background: transparent; color: white; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,.1); text-decoration: none; }
.btn-outline-dark { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-dark:hover { background: var(--navy); color: white; text-decoration: none; }

/* ── Sections ────────────────────────────────────────── */
section { padding: 5rem 0; }
section.alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-label {
  font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--blue); margin-bottom: .5rem;
}
.section-header h2 { font-size: clamp(1.75rem,4vw,2.25rem); margin-bottom: .75rem; }
.section-header p { color: var(--muted); max-width: 550px; margin: 0 auto; }
.section-footer { text-align: center; margin-top: 3rem; }

/* ── Project Cards ───────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px,1fr)); gap: 1.75rem; }
.project-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.project-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--navy) 0%, #2d5986 100%);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.project-card-body { padding: 1.5rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.tag {
  background: #eff6ff; color: var(--blue);
  padding: .2rem .6rem; border-radius: 3px; font-size: .73rem; font-weight: 600;
}
.project-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.project-card p { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.project-links { display: flex; gap: 1rem; font-size: .875rem; font-weight: 500; }

/* ── Publication List ────────────────────────────────── */
.section-header-slim { margin-bottom: 2rem; }
.section-header-slim h2 { font-size: clamp(1.75rem,4vw,2.25rem); margin-top: .4rem; }
.pub-list { border-top: 1px solid var(--border); }
.pub-item {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: background .15s;
}
.pub-item:hover { text-decoration: none; }
.pub-item:hover .pub-title { color: var(--blue); }
.pub-year {
  flex-shrink: 0; width: 3rem;
  font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .04em;
}
.pub-body { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.pub-title { font-size: .95rem; font-weight: 600; color: var(--navy); transition: color .15s; }
.pub-venue { font-size: .8rem; color: var(--muted); }
.pub-arrow { flex-shrink: 0; color: var(--blue); font-size: 1rem; opacity: 0; transition: opacity .15s; }
.pub-item:hover .pub-arrow { opacity: 1; }

/* ── Blog Cards ──────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px,1fr)); gap: 1.75rem; }
.blog-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.blog-card-img {
  height: 150px;
  background: linear-gradient(135deg, #1e3a5f 0%, var(--blue) 100%);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
}
.blog-card-body { padding: 1.5rem; }
.blog-meta { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.blog-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.blog-card h3 a { color: var(--navy); }
.blog-card h3 a:hover { color: var(--blue); text-decoration: none; }
.blog-card p { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.read-more { font-size: .875rem; font-weight: 600; color: var(--blue); }

/* ── Timeline Logo ───────────────────────────────────── */
.timeline-header { display: flex; align-items: flex-start; gap: .85rem; }
.tl-logo-wrap {
  flex-shrink: 0; width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 8px;
  background: white; display: flex; align-items: center;
  justify-content: center; overflow: hidden; margin-top: .15rem;
  box-shadow: var(--shadow-sm);
}
.tl-logo { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.tl-initial {
  width: 100%; height: 100%; background: var(--navy);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; font-family: 'Playfair Display', serif;
}

/* ── About Page ──────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 4rem; align-items: start; }
.about-photo { position: sticky; top: 88px; }
.photo-placeholder {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy), #2d5986);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; color: rgba(255,255,255,.4);
  font-family: 'Playfair Display', serif; margin-bottom: 1.5rem;
}
.profile-photo {
  width: 100%; border-radius: var(--radius);
  object-fit: cover; object-position: center top;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.about-content h2 { font-size: 1.75rem; margin-bottom: 1rem; }
.about-content p { color: var(--muted); margin-bottom: 1rem; }
.about-content h3 { font-size: 1.25rem; margin: 2rem 0 1rem; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .6rem; }
.skill-item {
  background: var(--bg-alt); border: 1px solid var(--border);
  padding: .55rem .9rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 500; text-align: center;
}
.timeline { margin-top: 1rem; }
.timeline-item {
  padding: 1.5rem 0 1.5rem 2rem;
  border-left: 2px solid var(--border);
  position: relative; margin-left: .5rem;
}
.timeline-item::before {
  content: ''; position: absolute; left: -6px; top: 1.8rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue); border: 2px solid white;
  box-shadow: 0 0 0 2px var(--blue);
}
.timeline-date {
  font-size: .78rem; color: var(--blue); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem;
}
.timeline-item h4 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.timeline-item .org { font-size: .875rem; color: var(--muted); margin-bottom: .4rem; }
.timeline-item p { font-size: .875rem; color: var(--muted); }

/* ── Reading Progress ────────────────────────────────── */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 3px; width: 0%; background: var(--blue);
  transition: width .1s linear;
  pointer-events: none;
}

/* ── Blog Post ───────────────────────────────────────── */
.post-header { background: var(--navy); color: white; padding: 5rem 0 3rem; }
.post-category {
  font-size: .78rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: #93c5fd; margin-bottom: 1rem;
}
.post-header h1 { color: white; font-size: clamp(1.75rem,4vw,2.75rem); max-width: 750px; margin-bottom: 1.5rem; }
.post-meta { color: rgba(255,255,255,.65); font-size: .875rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.post-content { max-width: 720px; margin: 0 auto; padding: 4rem 2rem; }
.post-content h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
.post-content h3 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
.post-content p { margin-bottom: 1.25rem; color: #374151; }
.post-content ul, .post-content ol { margin: 1rem 0 1.5rem 1.5rem; color: #374151; }
.post-content li { margin-bottom: .4rem; }
.post-content blockquote {
  border-left: 4px solid var(--blue); padding: 1rem 1.5rem;
  background: var(--bg-alt); margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-content blockquote p { margin: 0; font-style: italic; color: var(--muted); }
.post-content code {
  background: var(--bg-alt); padding: .15em .4em;
  border-radius: 3px; font-size: .875em; font-family: 'Courier New', monospace;
}
.post-nav { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 2rem; }
.post-nav a { font-weight: 600; }

/* ── Contact ─────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; }
.contact-info h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.contact-info p { color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }
.contact-item { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; font-size: .9rem; }
.contact-icon {
  width: 36px; height: 36px; background: #eff6ff; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .5rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: .75rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; font-family: inherit;
  color: var(--text); background: white; transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Language Switch ─────────────────────────────────── */
.lang-switch {
  display: flex; align-items: center; gap: .15rem;
  margin-left: 1rem; border-left: 1px solid var(--border);
  padding-left: 1rem; flex-shrink: 0;
}
.lang-btn {
  padding: .2rem .45rem; font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border-radius: 3px;
  transition: color .15s, background .15s; cursor: pointer;
}
.lang-btn:hover { color: var(--blue); text-decoration: none; }
.lang-btn.active { color: var(--blue); background: #eff6ff; }
@media (max-width: 768px) {
  .lang-switch { border-left: none; padding-left: .5rem; margin-left: auto; }
}

/* ── Newsletter ──────────────────────────────────────── */
.newsletter {
  background: var(--navy); color: white;
  padding: 5rem 0; text-align: center;
}
.newsletter-inner { max-width: 560px; margin: 0 auto; padding: 0 2rem; }
.newsletter-tags {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1.5rem;
}
.newsletter-tag {
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.85);
  padding: .25rem .75rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.newsletter h2 { color: white; font-size: clamp(1.6rem,4vw,2.2rem); margin-bottom: .75rem; }
.newsletter p { color: rgba(255,255,255,.7); font-size: .95rem; margin-bottom: 2rem; }
.newsletter-form { display: flex; gap: .75rem; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  flex: 1; min-width: 0; padding: .8rem 1.1rem;
  border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius);
  background: rgba(255,255,255,.08); color: white;
  font-size: .9rem; font-family: inherit;
  transition: border-color .2s;
}
.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,.4); }
.newsletter-form input[type="email"]:focus {
  outline: none; border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.12);
}
.newsletter-form button {
  padding: .8rem 1.6rem; background: var(--blue);
  color: white; border: none; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: background .2s;
}
.newsletter-form button:hover { background: var(--blue-dark); }
.newsletter-note { margin-top: 1rem; font-size: .75rem; color: rgba(255,255,255,.4); }

/* ── Footer ──────────────────────────────────────────── */
footer { background: var(--navy); color: rgba(255,255,255,.7); padding: 2.5rem 0; }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.footer-logo { font-family: 'Playfair Display', serif; color: white; font-size: 1rem; font-weight: 700; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .875rem; text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: white; }
.footer-copy {
  font-size: .78rem; width: 100%; text-align: center;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; margin-top: .5rem;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-buttons { justify-content: center; }
  .hero-image { order: -1; }
  .avatar-placeholder { width: 180px; height: 180px; font-size: 4rem; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo { position: static; }
  .photo-placeholder { max-width: 200px; margin: 0 auto 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: white; flex-direction: column;
    padding: 1rem 2rem; border-bottom: 1px solid var(--border); gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
  .post-meta { gap: .75rem; }
}
