/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@900&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text: rgb(55, 53, 47);
  --border: 2px solid black;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --padding-layout: calc(50px + (150 - 50) * ((100vw - 300px) / (1600 - 300)));
  --sidebar-width: min(150px, calc(40px + (150 - 40) * ((100vw - 300px) / (1600 - 300))));
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* === NAVBAR — Split Grid Cells === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 64px;
  background: #fff;
  border-bottom: var(--border);
}

.navbar-brand-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: var(--border);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: background 0.2s ease, color 0.2s ease;
}

.navbar-brand-cell:hover {
  background: black;
  color: white;
}

.navbar-links-cell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 2rem;
}

.navbar-links-cell a {
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
  letter-spacing: 0.02em;
}

.navbar-links-cell a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--text);
  transition: width 0.3s ease;
}

.navbar-links-cell a:hover::after { width: 100%; }
.navbar-links-cell a.active::after { width: 100%; }

/* === SECTIONS === */
.section {
  display: flex;
  border-bottom: var(--border);
}

.section-label {
  position: sticky;
  top: 64px;
  align-self: flex-start;
  width: var(--sidebar-width);
  min-width: 60px;
  max-width: 150px;
  height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.section-label span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: calc(22px + (44 - 22) * ((100vw - 300px) / (1600 - 300)));
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.section-content {
  flex: 1;
  padding: 2rem var(--padding-layout) 2rem 3rem;
  min-width: 0;
}

/* === HERO === */
.hero-section .hero-content {
  padding: 0;
}

.hero-image-wrapper {
  overflow: hidden;
  border-bottom: var(--border);
}

.hero-image {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
  will-change: transform;
  animation: heroZoom 1.5s ease-out forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}

.hero-text {
  padding: 1.5rem 3rem;
  font-size: calc(1.3rem + (2.2 - 1.3) * ((100vw - 300px) / (1600 - 300)));
  font-weight: 600;
  line-height: 1.3;
}

.hero-section .section-label {
  height: auto;
  align-self: stretch;
}

/* === CARD GRID === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  border: var(--border);
  overflow: hidden;
  display: block;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  /* Stagger animation base */
  opacity: 0;
  transform: translateY(20px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  background: black;
  color: white;
  box-shadow: rgba(0, 0, 0, 0.3) 0 9px 20px;
}

.card-image-wrapper {
  overflow: hidden;
  border-bottom: var(--border);
}

.card-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border: 1.5px solid currentColor;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

/* Tag shimmer on card hover */
.card:hover .tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: tagShimmer 0.6s ease forwards;
}

@keyframes tagShimmer {
  to { left: 100%; }
}

/* === FEATURED FIRST CARD === */
.card-grid .card:first-child {
  grid-column: span 2;
}

.card-grid .card:first-child .card-image {
  height: 400px;
}

.card-grid .card:first-child .card-title {
  font-size: 1.4rem;
}

@media (max-width: 680px) {
  .card-grid .card:first-child {
    grid-column: span 1;
  }
  .card-grid .card:first-child .card-image {
    height: 300px;
  }
  .card-grid .card:first-child .card-title {
    font-size: 1.15rem;
  }
}

/* === HERO ROLE LINKS & CLIP-REVEAL === */
@keyframes clipReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

.hero-word {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  animation: clipReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-role {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.hero-role::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

.hero-role:hover::after {
  width: 100%;
}

/* === PRESS SECTION === */
.press-categories {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.press-category {
  text-align: center;
}

.press-heading {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

.press-composite-img {
  width: 100%;
  max-width: 700px;
  display: block;
  margin: 0 auto;
}

/* === FOOTER === */
.footer {
  border-top: var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.footer-cell {
  padding: 2.5rem;
  border-right: var(--border);
}

.footer-cell:last-child {
  border-right: none;
}

.footer-cell h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.4;
  margin-bottom: 1rem;
}

.footer-cell p {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.7;
}

.footer-cell ul {
  list-style: none;
}

.footer-cell ul li {
  margin-bottom: 0.5rem;
}

.footer-cell a {
  font-size: 0.9rem;
  position: relative;
  display: inline-block;
}

.footer-cell a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.3s ease;
}

.footer-cell a:hover::after {
  width: 100%;
}

.footer-bottom {
  border-top: var(--border);
  padding: 1.25rem 2.5rem;
  font-size: 0.75rem;
  opacity: 0.35;
}

/* === PROJECT PAGE === */
.project-hero {
  border-bottom: var(--border);
}

.project-hero img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.project-header {
  display: none;
}

.project-body {
  padding: 3rem var(--padding-layout);
}

.project-body h2, .project-body h3, .project-body p,
.project-body blockquote, .project-body ul, .project-body hr,
.project-body .press-links, .project-body .press-quote,
.project-body .img-caption {
  max-width: 900px;
}

.project-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}

.project-body h2:first-child { margin-top: 0; }

.project-body h3 {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-body p, .project-body li {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.project-body blockquote {
  border-left: 3px solid black;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
  margin: 1.5rem 0;
}

.project-body hr {
  border: none;
  border-top: var(--border);
  margin: 3rem 0;
}

.project-body img {
  border: var(--border);
  margin: 1rem 0;
}

.project-body .img-caption {
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.6;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* Gallery grid for project pages */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border: var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
}

.gallery img:hover { opacity: 0.85; }

/* Video gallery cards (e.g. MUNA Visual Album) */
.gallery-video-card {
  position: relative;
  display: block;
  border: var(--border);
  overflow: hidden;
  transition: box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.gallery-video-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border: none;
  cursor: pointer;
}

.gallery-video-card:hover {
  background: black;
  color: white;
  box-shadow: rgba(0,0,0,0.3) 0 6px 16px;
}

.gallery-video-title {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-top: var(--border);
}

/* Video embed */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: var(--border);
  margin: 1.5rem 0;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Press links row (project pages) */
.press-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.press-links a {
  font-weight: 600;
  text-decoration: underline;
}

.press-links a:hover { opacity: 0.6; }

/* Press quote (project pages) */
.press-quote {
  padding: 1.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.press-quote:first-child { border-top: 1px solid #e0e0e0; }

.press-quote blockquote {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.press-source {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Contact footer on project pages */
.project-contact {
  border-top: var(--border);
  padding: 3rem var(--padding-layout);
}

.project-contact .contact-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-contact .contact-links a {
  font-size: 1.15rem;
  font-weight: 600;
  position: relative;
  display: inline-block;
}

.project-contact .contact-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--text);
  transition: width 0.3s ease;
}

.project-contact .contact-links a:hover::after { width: 100%; }

/* Project page section — sidebar wraps full page content */
.project-section .section-content {
  padding: 0;
}

/* === ANIMATIONS === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === ROLE NAV === */
.role-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: var(--border);
}

.role-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border: 1.5px solid currentColor;
  border-radius: 0;
}

.role-nav a:hover {
  background: black;
  color: white;
}

/* === RESPONSIVE === */
@media (max-width: 950px) {
  :root {
    /* Re-cap sidebar width to match section-label max-width at this breakpoint */
    --sidebar-width: min(80px, calc(40px + (80 - 40) * ((100vw - 300px) / (950 - 300))));
  }

  /* Section label stays on left — just shrinks */
  .section-label {
    min-width: 40px;
    max-width: 80px;
  }

  .section-label span {
    font-size: calc(16px + (24 - 16) * ((100vw - 300px) / (950 - 300)));
  }

  .section-content {
    padding: 2rem var(--padding-layout);
  }

  .hero-text {
    padding: 1.5rem var(--padding-layout);
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .navbar {
    grid-template-columns: minmax(40px, 80px) 1fr;
  }

  .navbar-brand-cell {
    font-size: 1rem;
  }

  .navbar-links-cell {
    gap: 1.25rem;
    padding: 0 1.25rem;
    overflow-x: auto;
  }

  .navbar-links-cell a { font-size: 0.8rem; white-space: nowrap; }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-cell {
    border-right: none;
    border-bottom: var(--border);
  }

  .footer-cell:last-child { border-bottom: none; }
}

@media (max-width: 680px) {
  /* Navbar — slimmer on mobile to recover vertical space */
  .navbar { grid-template-columns: minmax(32px, 60px) 1fr; height: 52px; }
  .navbar-brand-cell { font-size: 0; }
  .navbar-brand-cell::before {
    content: '';
    width: 28px;
    height: 28px;
    background: url('assets/favicon.svg') center / contain no-repeat;
  }
  .navbar-links-cell { gap: 1rem; padding: 0 1rem; }
  .hero-image { height: 70vh; max-height: none; object-position: center center; }
  .hero-text { padding: 0.75rem 1.5rem; }

  /* Horizontal section labels on mobile — sticky below the slimmer navbar */
  .section { flex-direction: column; }
  .section-label {
    position: sticky;
    top: 52px;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    border-right: none;
    border-bottom: var(--border);
    padding: 0.5rem 1.25rem;
    justify-content: flex-start;
    align-items: center;
    background: white;
    z-index: 10;
  }
  .section-label span {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .hero-section .section-label { align-self: auto; }

  /* Slightly more breathing room between section label and first card */
  .section-content { padding: 1.75rem 1.5rem 1.5rem; }

  /* Project body lead text — slightly heavier to distinguish from body */
  .project-body h3 { font-weight: 500; }

  .project-body { padding: 2rem 1.5rem; }
  .footer-cell { padding: 1.5rem; }
  .footer-bottom { padding: 1rem 1.5rem; }
}

@media (max-width: 480px) {
  .navbar { grid-template-columns: minmax(28px, 45px) 1fr; }
  .navbar-brand-cell::before { width: 24px; height: 24px; }
  .navbar-links-cell { gap: 0.75rem; }
  .navbar-links-cell a { font-size: 0.75rem; }
  .section-label span { font-size: 0.75rem; }
  .hero-image { height: 70vh; max-height: none; }
  .hero-text { font-size: 1.4rem; line-height: 1.25; }
}

/* === CONTACT SECTION (project pages) === */
.contact-section .section-label {
  height: auto;
  align-self: stretch;
  position: static;
}

.contact-section .section-content {
  padding: 0;
}

/* Footer already has internal cell padding — suppress its top border
   since the section border-top above it handles the divider */
.contact-section .footer {
  border-top: none;
}

/* === NEXT PROJECT NAVIGATION === */
.next-project-btn {
  display: none;
}

.next-project-desktop {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 64px;
  border-top: var(--border);
  border-bottom: var(--border);
  color: var(--text);
  text-decoration: none;
}

.next-project-desktop-label {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.next-project-desktop-label span {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.next-project-desktop-title {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.next-project-desktop-title .arrow {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.next-project-desktop:hover .next-project-desktop-title {
  background: black;
  color: white;
}

.next-project-desktop:hover .next-project-desktop-title .arrow {
  opacity: 1;
  transform: translateX(4px);
}

@media (max-width: 680px) {
  .next-project-desktop { display: none; }
}

@media (max-width: 680px) {
  .next-project-btn {
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
    background: black;
    color: white;
    font-family: var(--font);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
    transition: opacity 0.2s ease;
  }

  .next-project-btn:hover { opacity: 0.7; }
}

/* === LIGHTBOX === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: none;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  color: white;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.85rem;
  opacity: 0.6;
  font-family: var(--font);
}

@media (max-width: 680px) {
  .lightbox-prev,
  .lightbox-next { font-size: 2rem; padding: 0.75rem; }
  .lightbox-close { font-size: 2rem; }
}

/* === ABOUT PAGE === */
.about-page {
  background-color: #fafafa;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.about-main {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 2rem;
}

.about-container {
  max-width: 640px;
  width: 100%;
}

.about-headshot-wrapper {
  margin-bottom: 2.5rem;
}

.about-headshot {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid black;
}

.about-body {
  font-size: 1.05rem;
  line-height: 1.75;
}

.about-body p {
  margin-bottom: 1.25rem;
}

.about-body h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.about-body ul {
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.about-body li {
  margin-bottom: 0.75rem;
  line-height: 1.65;
}

/* Wavy hand-drawn underline links */
.about-body a {
  color: inherit;
  text-decoration: none;
  position: relative;
  display: inline;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6' viewBox='0 0 40 6'%3E%3Cpath d='M0 3 Q5 0.5 10 3 Q15 5.5 20 3 Q25 0.5 30 3 Q35 5.5 40 3' stroke='%234A90D9' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: 40px 6px;
  padding-bottom: 3px;
  transition: background-color 0.1s ease;
}

.about-body a:hover {
  animation: highlighter 0.35s ease forwards;
}

@keyframes highlighter {
  0% {
    background-color: transparent;
    background-size: 40px 6px;
  }
  30% {
    background-color: rgba(74, 144, 217, 0.12);
    background-size: 40px 6px;
  }
  100% {
    background-color: rgba(74, 144, 217, 0.18);
    background-size: 40px 6px;
  }
}

@media (max-width: 680px) {
  .about-main { padding: 2.5rem 1.5rem; }
  .about-body { font-size: 1rem; }
  .about-headshot { width: 110px; height: 110px; }
}

@media (max-width: 480px) {
  .about-main { padding: 2rem 1.25rem; }
  .about-body { font-size: 0.95rem; }
  .about-headshot { width: 90px; height: 90px; }
}
