/* ─── Imports ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@300;400;500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ─── Variables ───────────────────────────────────────────── */
:root {
  --bg:         #f9f8f6;
  --surface:    #ffffff;
  --border:     #e5e2dc;
  --text:       #1a1917;
  --muted:      #8c8880;
  --accent:     #1a1917;
  --accent-dim: #3d3b38;
  --tag-bg:     #eeecea;
  --gap:        clamp(1.5rem, 4vw, 3rem);
  --max-w:      1100px;
  --nav-h:      64px;
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Typography ──────────────────────────────────────────── */
h1, h2, h3 { font-family: 'DM Serif Display', serif; font-weight: 400; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

.mono {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Nav ─────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(249, 248, 246, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

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

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--text);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ─── Layout ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section { padding: clamp(4rem, 10vw, 8rem) 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(4rem, 8vw, 7rem);
}

.hero-label {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--muted);
}

.hero h1 { margin-bottom: 1.5rem; }
.hero h1 em { font-style: italic; color: var(--accent-dim); }

.hero-bio {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  font-weight: 300;
  margin-bottom: 2.5rem;
}

.hero-photo-wrap {
  width: clamp(160px, 20vw, 240px);
  flex-shrink: 0;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  filter: grayscale(15%);
}

.hero-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 4px;
  background: var(--tag-bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem;
}

/* ─── Skills ──────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 3rem;
}

.skill-cell {
  background: var(--surface);
  padding: 1.75rem;
}

.skill-cell-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--tag-bg);
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--accent-dim);
}

/* ─── Section header ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3rem;
  gap: 1rem;
}

.section-header h2 { }

.section-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
  white-space: nowrap;
}
.section-link:hover { color: var(--text); }

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.project-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card-meta {
  margin-bottom: 0.6rem;
}

.project-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.1rem;
}

/* ─── My Work subsections ─────────────────────────────────── */
.work-subsection {
  margin-top: 3.5rem;
}

.work-subsection h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.work-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.work-entry {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--surface);
  padding: 1.75rem;
  transition: background 0.2s;
}

a.work-entry:hover { background: var(--tag-bg); }
.work-entry.no-link { cursor: default; }

.work-entry-left {
  padding-top: 2px;
}

.work-entry-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--tag-bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
}

.work-entry-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 4px;
}

.work-entry-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.work-dot { opacity: 0.4; }

.work-entry-body h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.work-entry-body p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* subsection Projects grid gets a little top breathing room */
.work-subsection .projects-grid {
  margin-top: 0;
}


.project-hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
}

.project-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.project-hero .back-link:hover { color: var(--text); }
.project-hero .back-link svg { width: 14px; height: 14px; }

.project-meta-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 5rem;
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.project-content h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
}
.project-content h2:first-child { margin-top: 0; }
.project-content p {
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.project-sidebar {}
.project-sidebar-section { margin-bottom: 2.5rem; }
.project-sidebar-section .mono { margin-bottom: 0.75rem; display: block; }
.project-sidebar-section p { font-size: 0.9rem; color: var(--muted); }
.project-sidebar-section .tag { margin: 0.2rem 0.2rem 0 0; }

/* ─── Image Gallery ───────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2.5rem 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.gallery img:first-child:nth-last-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 16/7;
}

/* ─── YouTube Embed ───────────────────────────────────────── */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 2.5rem 0;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

/* ─── Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.15s; }
.fade-up:nth-child(3) { animation-delay: 0.25s; }
.fade-up:nth-child(4) { animation-delay: 0.35s; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-photo-wrap {
    width: 140px;
  }

  .project-body {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
  .gallery img:first-child:nth-last-child(odd) {
    grid-column: auto;
    aspect-ratio: 4/3;
  }
}
/* ─── Workspace ──────────────────────────────────────────── */
.workspace-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.workspace-photo {
  width: 100%;
  height: clamp(280px, 45vw, 520px);
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  filter: grayscale(30%) sepia(20%);  /* ← add this */
}

.workspace-photo-placeholder {
  width: 100%;
  height: clamp(280px, 45vw, 520px);
  border-radius: 6px;
  background: var(--tag-bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
}

.workspace-caption {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 480px;
}
/* ─── Academics ──────────────────────────────────────────── */
.academics-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 2rem;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.academics-left p {
  color: var(--muted);
  font-size: 0.9rem;
}

.academics-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #000000 !important;
}
.course-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.course-row:first-child { border-top: 1px solid var(--border); }

.course-grade {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.course-grade.ongoing {
  color: var(--muted);
}
.project-content ul {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 1.25rem;
  line-height: 2;
}
/* ─── Report Callout ─────────────────────────────────────── */
.report-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  margin-top: 2.5rem;
}

.report-callout-title {
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.report-callout p {
  font-size: 0.875rem;
  color: var(--muted);
}

.report-callout-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text);
  transition: opacity 0.2s;
}

.report-callout-link:hover { opacity: 0.6; }
.workspace-label {
  font-size: 2rem;
  font-weight: 500;
  color: var(--text);
}
/* ─── Lightbox ───────────────────────────────────────────── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  cursor: pointer;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
  text-align: center;
}