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

:root {
  --bg:       #f9f9f9;
  --white:    #ffffff;
  --navy:     #0f2154;
  --accent:   #2a52a8;
  --text:     #0d0d0d;
  --muted:    #6b7280;
  --subtle:   #e5e7eb;
  --radius:   8px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: rgba(249,249,249,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 200;
}

.nav-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-links { display: flex; gap: 28px; }

.nav-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* ── MAIN ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 112px 48px 96px;
}

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

/* ── ABOUT ── */
.about-section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  align-items: center;
  padding: 0 0 72px;
}

.about-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

.about-right { display: flex; flex-direction: column; gap: 8px; }

.about-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.about-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.about-body {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 520px;
  margin-top: 2px;
}

.about-links {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.about-links a {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s;
}
.about-links a:hover { opacity: 0.7; }

/* ── PREVIEW SECTIONS ── */
.preview-section { padding: 56px 0; }

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.preview-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.preview-title:hover { color: var(--muted); }

.view-all {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.15s;
}
.view-all:hover { color: var(--text); }

/* ── PROJECT CARDS ── */
.proj-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.proj-card {
  background: var(--white);
  border: 1px solid var(--subtle);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.proj-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.proj-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.proj-card-stack {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proj-card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.proj-card-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
}

.proj-card-empty {
  background: transparent;
  border-style: dashed;
  cursor: default;
  justify-content: center;
  align-items: center;
}
.proj-card-empty:hover { box-shadow: none; border-color: var(--subtle); }

.proj-card-soon {
  font-size: 0.75rem;
  color: #c4c9d6;
}

/* ── DEBATE THUMBNAILS ── */
.thumb-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.thumb-card { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }

.thumb-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--subtle);
  background: #e5e7eb;
  transition: box-shadow 0.15s;
}
.thumb-card:hover .thumb-img-wrap {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.thumb-img-wrap img { width:100%; height:100%; object-fit:cover; display:block; }

.thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
  background: rgba(0,0,0,0.18);
  transition: background 0.15s;
}
.thumb-card:hover .thumb-play { background: rgba(0,0,0,0.32); }

.thumb-label {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── WRITING GRID (same pattern as proj-preview-grid) ── */
.writing-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.writing-card {
  background: #fff;
  border: 1px solid var(--subtle);
  border-radius: 10px;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.writing-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
  border-color: #d4d8e2;
}

.writing-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.writing-card-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.writing-card-link {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
}

.writing-card-empty {
  border-style: dashed;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  pointer-events: none;
}

.writing-soon {
  font-size: 0.78rem;
  color: #c4c9d6;
  font-style: italic;
}

/* ── SUBNAV ── */
.subnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: rgba(249,249,249,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 200;
}

.subnav-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.subnav-links { display: flex; gap: 28px; }

.subnav-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.subnav-links a:hover,
.subnav-links a.active { color: var(--text); font-weight: 600; }

/* ── SUBPAGE ── */
.subpage-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 96px 48px 96px;
}

.subpage-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.subpage-sub {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 48px;
}

.back {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 36px;
  font-weight: 500;
  transition: color 0.15s;
}
.back:hover { color: var(--text); }

/* ── PROJECT LIST (subpage) ── */
.project-list { border-top: 1px solid var(--subtle); }

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--subtle);
  gap: 24px;
}

.project-info { display: flex; flex-direction: column; gap: 4px; }

.project-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.project-name:hover { color: var(--accent); }

.project-stack {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.project-blurb {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 2px;
}

.github-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--subtle);
  border-radius: 6px;
  padding: 6px 14px;
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.github-btn:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* ── PROSE ── */
.prose { display: flex; flex-direction: column; gap: 20px; max-width: 680px; }
.prose p { font-size: 0.93rem; color: var(--muted); line-height: 1.85; }

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--subtle);
  border-radius: 6px;
  padding: 6px 16px;
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pill:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* ── DEBATE ── */
.debate-block { margin-bottom: 52px; }

.label {
  display: inline-block;
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.debate-block > p,
.debate-content > p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.85;
  max-width: 680px;
}

.inline-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.inline-link:hover { opacity: 0.75; }

.debate-content { display: flex; flex-direction: column; gap: 20px; }

.debate-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.debate-photos-3 { grid-template-columns: repeat(3, 1fr); }

.debate-photo-slot {
  aspect-ratio: 4/3;
  background: #f0f1f3;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  color: #c4c9d6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow: hidden;
}
.debate-photo-slot img { width:100%; height:100%; object-fit:cover; border-radius:var(--radius); }

/* ── VIDEO GRID ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 12px;
}

.video-item { display: flex; flex-direction: column; gap: 8px; }

.yt-thumb {
  position: relative; display: block;
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--subtle);
  background: #e5e7eb;
  text-decoration: none;
  transition: box-shadow 0.15s;
}
.yt-thumb:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.yt-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  background: rgba(0,0,0,0.18);
  transition: background 0.15s;
}
.yt-thumb:hover .play-overlay { background: rgba(0,0,0,0.3); }

.dropbox-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: #f5f5f5;
}
.dropbox-logo { width: 32px; height: 32px; }
.dropbox-tag { font-size: 0.72rem; color: var(--muted); font-weight: 500; }

.video-title { font-size: 0.75rem; color: var(--muted); line-height: 1.45; font-weight: 500; }

/* ── CAROUSEL ── */
.carousel { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 680px; }
.carousel-track-wrap { flex: 1; overflow: hidden; border-radius: var(--radius); }
.carousel-track { display: flex; transition: transform 0.35s ease; }
.carousel-slide { min-width: 100%; }

.carousel-photo {
  width: 100%; aspect-ratio: 4/3;
  background: #f0f1f3;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: #c4c9d6;
  letter-spacing: 0.08em; text-transform: uppercase;
  overflow: hidden;
}
.carousel-photo img { width:100%; height:100%; object-fit:cover; border-radius:var(--radius); }

.carousel-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--subtle);
  background: var(--white);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.carousel-btn:hover { background: var(--text); color: #fff; border-color: var(--text); }

.more-to-come {
  font-size: 0.9rem;
  color: #c4c9d6;
  font-style: italic;
  margin-top: 8px;
}

/* ── FOOTER ── */
footer {
  padding: 28px 48px;
  font-size: 0.72rem;
  color: #c4c9d6;
  text-align: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav, .subnav { padding: 0 20px; }
  main { padding: 80px 20px 48px; }
  .about-section { grid-template-columns: 1fr; gap: 20px; }
  .proj-preview-grid, .thumb-preview-grid { grid-template-columns: 1fr; }
  .subpage-wrap { padding: 80px 20px 48px; }
  .video-grid { grid-template-columns: 1fr; }
}
