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

:root {
  --text: #0d0d0d;
  --muted: #999;
  --muted-dark: #666;
  --bg: #fff;
  --border: #e8e8e8;
  --tag-bg: #f5f5f5;
  --font: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;       /* never stretch images */
}

video {
  display: block;
  max-width: 100%;
  max-height: 85vh;   /* portrait videos won't overflow the viewport */
  width: auto;        /* shrink width proportionally when height is the constraint */
  margin: 0 auto;     /* keep centered when width is less than container */
}

/* ─── Layout ───────────────────────────────────────────────── */

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ─── Navigation ────────────────────────────────────────────── */

nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 44px 0 0;
  position: relative;
}

.nav-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}

.nav-name:hover {
  opacity: 0.5;
}

.nav-links {
  display: flex;
  align-items: baseline;
  gap: 32px;
}

.nav-links a {
  font-size: 16px;
  color: var(--muted);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
}

/* Dropdown */
.nav-dropdown-wrap {
  position: relative;
}

.nav-dropdown-trigger {
  font-size: 16px;
  color: var(--muted);
  cursor: default;
  transition: color 0.15s;
  user-select: none;
}

.nav-dropdown-wrap:hover .nav-dropdown-trigger {
  color: var(--text);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}

.nav-dropdown-wrap:hover .nav-dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 12px 18px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.nav-dropdown-menu a:last-child {
  border-bottom: none;
}

.nav-dropdown-menu a:hover {
  background: #fafafa;
}

.nav-dropdown-inactive {
  display: block;
  padding: 12px 18px;
  font-size: 16px;
  color: #ccc;
  border-bottom: 1px solid var(--border);
  cursor: default;
}

.nav-dropdown-inactive:last-child {
  border-bottom: none;
}

/* ─── Sections ──────────────────────────────────────────────── */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: none;
  padding-top: 80px;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ─── About ─────────────────────────────────────────────────── */

.about-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.profile-photo {
  width: 340px;
  height: auto;
  display: block;
}

.about-text {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}

.about-text + .about-text {
  margin-top: 16px;
}

/* ─── Project List ──────────────────────────────────────────── */

.project-list {
  list-style: none;
}

.project-row {
  display: grid;
  grid-template-columns: 64px 1fr 360px;
  column-gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: background 0.12s;
}

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

.project-row:hover {
  background: #fafafa;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.project-year {
  font-size: 16px;
  color: var(--muted);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.project-info {
  min-width: 0;
}

.project-name {
  font-size: 16px;
  font-weight: 500;
  display: block;
}

.project-row:hover .project-name:not(.inactive) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-name.inactive {
  color: #bbb;
  cursor: default;
}

.project-desc {
  font-size: 16px;
  color: var(--muted);
  margin-top: 4px;
}

.project-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.tag {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted-dark);
  background: var(--tag-bg);
  padding: 3px 10px;
  border-radius: 2px;
}

.project-thumb {
  width: 360px;
  height: 260px;
  object-fit: cover;
  object-position: center;
}

.project-thumb-placeholder {
  width: 360px;
  height: 260px;
  background: #f0f0f0;
}

/* ─── Contact ───────────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 28px;
  column-gap: 48px;
}

.contact-item-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.contact-item-value {
  font-size: 16px;
}

.contact-item-value a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Footer ────────────────────────────────────────────────── */

footer {
  padding: 36px 0 52px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-name {
  font-size: 16px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a,
.footer-links span {
  font-size: 16px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-sep {
  color: var(--border);
}

/* ─── Project Page ──────────────────────────────────────────── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 16px;
  color: var(--muted);
  margin-top: 36px;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text);
}

.back-link::before {
  content: "←";
}

.project-header {
  padding: 40px 0 0;
}

.project-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.project-subtitle {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text);
  margin-top: 10px;
}

.project-meta {
  font-size: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-meta-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--muted);
  border-radius: 50%;
}

.project-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 0;
}

/* ─── Project Body ──────────────────────────────────────────── */

.body-block {
  padding: 52px 0 0;
}

.body-label {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.body-text {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
}

.body-text + .body-text {
  margin-top: 18px;
}

.body-list {
  list-style: none;
  margin-top: 14px;
}

.body-list li {
  font-size: 16px;
  line-height: 1.9;
  padding-left: 18px;
  position: relative;
}

.body-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.body-list li + li {
  margin-top: 6px;
}

/* ─── Media ─────────────────────────────────────────────────── */

.media-full {
  margin: 52px 0 0;
}

.media-full img,
.media-full video {
  width: 100%;
  height: auto;   /* never stretch */
}

/* Full viewport width bleed — hero images only, no crop */
.media-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: 44px;
  margin-bottom: 0;
}

.media-bleed img {
  width: 100%;
  height: auto;   /* natural ratio — never crop the hero */
}

/* Stacked media — used when assets have mismatched aspect ratios */
.media-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 52px 0 0;
}

.media-stack img,
.media-stack video {
  width: 100%;
  height: auto;
}

/* 2-col grid — only use for assets with similar aspect ratios */
.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 52px 0 0;
  align-items: start;   /* don't stretch cells to equal height */
}

.media-grid img,
.media-grid video {
  width: 100%;
  height: auto;   /* natural ratio, no stretching */
}

.media-item {
  display: flex;
  flex-direction: column;
}

.caption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ─── Secondary Gallery ─────────────────────────────────────── */

.gallery-section {
  padding: 52px 0 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 20px;
}

.gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.15s;
}

.gallery-grid img:hover {
  opacity: 0.85;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 720px) {
  .container {
    padding: 0 24px;
  }

  nav {
    padding-top: 28px;
  }

  .profile-photo {
    width: 100%;
    max-width: 320px;
  }

  .project-row {
    grid-template-columns: 52px 1fr;
  }

  .project-thumb,
  .project-thumb-placeholder {
    display: none;
  }

  .project-row:hover {
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-bleed {
    width: 100%;
    margin-left: 0;
  }

  .project-title {
    font-size: 26px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
  }
}
