/* ========================
   GLOBAL
======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important;
}

html, body {
  height: auto;
  overflow: auto;
}

/* ========================
   BODY
======================== */
body {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  background-color: #f2f1ef;
  color: #1a1a1a;
}

/* ========================
   NAV  (split row, centered brand)
======================== */
nav.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* left group ⟷ right group */
  padding: 20px 40px;
  background-color: #f2f1ef;
}

/* centered name — links back to home */
.nav__brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3d3530;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.nav__brand:hover { opacity: 0.6; }

.nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  column-gap: 24px;
}

.nav__list a {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3d3530;
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.nav__list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #3d3530;
  transition: width 0.3s ease;
}

.nav__list a:hover { opacity: 0.5; }
.nav__list a:hover::after { width: 100%; }

/* ========================
   NAV — PROJECTS DROPDOWN (Client / Personal, staggered reveal)
======================== */
.nav__item--dropdown {
  position: relative;
}

.nav__submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 10px;
  margin-top: 0;              /* touches the nav bar's bottom edge — no gap, no seam */
  padding: 20px 22px 16px;
  background-color: #f2f1ef;   /* opaque, matches the nav bar so the two read as one surface */
  opacity: 0;
  pointer-events: none;
  /* closing: stay visible until the staggered links finish lifting back up, then fade */
  transition: opacity 0.25s ease 0.4s;
  z-index: 10;
}

.nav__item--dropdown:hover .nav__submenu,
.nav__item--dropdown.is-open .nav__submenu {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;   /* opening: appear instantly so the links can stagger in */
}

.nav__submenu li {
  list-style: none;   /* Safari quirk: list-style:none on the parent <ul> alone isn't always enough */
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.nav__item--dropdown:hover .nav__submenu li,
.nav__item--dropdown.is-open .nav__submenu li {
  opacity: 1;
  transform: translateY(0);
}

/* closing (default state): reverse order — last item lifts back up first */
.nav__submenu li:nth-child(1) { transition-delay: 0.15s; }
.nav__submenu li:nth-child(2) { transition-delay: 0.05s; }

/* opening: original order — Client first, Personal second */
.nav__item--dropdown:hover .nav__submenu li:nth-child(1),
.nav__item--dropdown.is-open .nav__submenu li:nth-child(1) { transition-delay: 0.05s; }
.nav__item--dropdown:hover .nav__submenu li:nth-child(2),
.nav__item--dropdown.is-open .nav__submenu li:nth-child(2) { transition-delay: 0.15s; }

.nav__submenu a {
  font-size: 10px;
}

/* ========================
   PORTFOLIO HEADER
======================== */
.portfolio-page {
  padding: 0;
  max-width: 100%;
}

.portfolio-header {
  position: relative;
  width: calc(100% - 40px);
  height: calc(100vh - 120px);
  margin: 60px 20px 80px;
  overflow: hidden;
}

.portfolio-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-header canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.header-poem-row {
  position: absolute;
  left: 40px;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.header-poem {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.header-clock {
  flex: 0 0 auto;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

/* ========================
   PORTFOLIO GRID
======================== */
.grid-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 5% 80px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

.grid {
  display: flex;
  flex-direction: row;
  gap: 40px 24px;
  align-items: start;
  width: max-content;
}

.grid-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  width: 300px;
  flex-shrink: 0;
}

.grid-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.grid-item a {
  display: block;
  overflow: hidden;
}

.grid-item a img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.grid-item a:hover img {
  opacity: 0.6;
}

.grid-item p {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1a1a;
}

/* ========================
   CURSOR
======================== */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background-color: #3d3530;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 1024px) {
  .nav__list { column-gap: 18px; }
}

@media (max-width: 768px) {
  .cursor { display: none; }

  nav.nav {
    flex-wrap: wrap;
    justify-content: center;  /* tuck everything to the left */
    align-items: center;
    gap: 10px 16px;
    padding: 10px 20px;
  }

  .nav__brand {
    position: static;
    transform: none;
    order: -1;            /* name sits on its own line, on top */
    flex-basis: 100%;
    text-align: center;
    font-size: 18px;
    letter-spacing: 0.12em;
  }

  .nav__list {
    justify-content: center;
    column-gap: 16px;
  }

  /* Projects dropdown on mobile — same seamless, staggered white panel as desktop,
     just resized for touch and narrower screens */
  .nav__submenu {
    padding: 16px 18px 14px;
    row-gap: 12px;
  }

  .nav__submenu a {
    font-size: 11px;
    padding: 4px 2px;
  }

  .portfolio-header {
    width: 100%;
    margin: 76px 0 0;
  }

  .header-poem-row {
    left: 20px;
    right: 20px;
    align-items: flex-start;
    gap: 10px;
  }

  .header-poem {
    font-size: 11px;
    white-space: normal;
    text-overflow: clip;
  }

  .header-clock {
    margin-top: 2px;
  }

  .grid-wrap {
    padding: 20px 5% 80px;
    overflow-x: auto;
    display: flex;
    justify-content: flex-start;
  }

  .grid {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: start;
    width: max-content;
  }

  .grid-item {
    width: 260px;
    flex-shrink: 0;
  }
}