/* ============================================
   V7 — Brian Lim Style Portfolio Grid
   Light bg, bold name, project grid, orange accent
   ============================================ */

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

:root {
  --bg: #f0ece4;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #e8651a;
  --font-body: 'DM Sans', 'Inter', -apple-system, sans-serif;
  --font-display: 'DM Sans', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --grid-gap: 12px;
  --side-pad: 112px;
}

html {
  scroll-behavior: smooth;
}

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

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

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

/* ---- Top Nav ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 0 var(--side-pad);
  transition: box-shadow 0.3s;
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.topnav-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.topnav-links {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
}

/* ---- Hero Header ---- */
.header {
  padding: 40px var(--side-pad) 32px;
  background: var(--bg);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

.header-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--text);
}

.header-right {
  padding-bottom: 12px;
  max-width: 320px;
  flex-shrink: 0;
}

.header-role {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 4px;
}

.header-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.header-line {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 16px;
}

.header-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.header-accent {
  margin-top: 40px;
}

.nav-link {
  padding: 4px 0;
  margin-left: 12px;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}

.nav-link::before {
  content: '\2022';
  margin-right: 4px;
  color: var(--text);
}

.nav-link:hover {
  color: var(--accent);
}

/* ---- Work Grid ---- */
.work-section {
  padding: 8px var(--side-pad) 40px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--grid-gap);
}

/* Card base */
.project-card {
  display: block;
  grid-column: span 2;
  text-decoration: none;
  color: inherit;
}

/* Wide cards span 3 columns */
.project-wide {
  grid-column: span 3;
}

/* Full-width cards span all 6 columns */
.project-full {
  grid-column: 1 / -1;
}

.project-full .project-thumb {
  aspect-ratio: 21 / 9;
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #d8d3c9;
  position: relative;
}

.project-thumb img,
.project-thumb video {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-thumb img,
.project-card:hover .project-thumb video {
  transform: scale(1.04);
}

/* Video cards */
.video-card {
  cursor: pointer;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  transition: opacity 0.4s, background 0.4s;
  pointer-events: none;
}

.video-card:hover .play-overlay {
  opacity: 0;
}

.video-card.playing .play-overlay {
  opacity: 0;
}

.project-thumb {
  position: relative;
}

.project-meta {
  padding: 8px 0 20px;
}

.project-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project-cat {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Accent line */
.accent-line {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--accent);
  margin: 8px 0;
}

/* ---- About Section ---- */
.about-section {
  padding: 60px var(--side-pad);
  border-top: 1px solid rgba(0,0,0,0.08);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1.5fr;
  gap: 48px;
}

.about-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  color: var(--text);
}

.about-block {
  margin-bottom: 32px;
}

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

.services-list li {
  font-size: 0.82rem;
  color: var(--text);
  padding: 2px 0;
  position: relative;
  padding-left: 12px;
}

.services-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--accent);
}

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

.contact-list li {
  font-size: 0.82rem;
  padding: 2px 0;
}

.contact-list a {
  transition: color 0.2s;
}

.contact-list a:hover {
  color: var(--accent);
}

.about-bio {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--text);
}

.exp-item {
  margin-bottom: 16px;
}

.exp-role {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
}

.exp-detail {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- Footer ---- */
.footer {
  padding: 20px var(--side-pad) 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-bottom: 16px;
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-bar {
  height: 48px;
  background: var(--text);
  margin: 0 calc(var(--side-pad) * -1);
}

/* ---- Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  :root {
    --side-pad: 48px;
  }
}

@media (max-width: 900px) {
  :root {
    --side-pad: 24px;
  }

  .topnav-inner {
    height: 48px;
  }

  .header {
    padding: 40px var(--side-pad) 24px;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .header-right {
    padding-bottom: 0;
  }

  .header-role {
    font-size: 1.2rem;
  }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card,
  .project-wide {
    grid-column: span 1;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-bio {
    font-size: 1.15rem;
  }
}

@media (max-width: 560px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .project-thumb {
    aspect-ratio: 16 / 10;
  }

  .footer-inner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}
