* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #F5EAD6; }

.marquee-wrap { overflow: hidden; position: relative; }
.font-display { font-family: 'Barlow', sans-serif; }
.font-black   { font-family: 'Barlow', sans-serif; font-weight: 900; }

.btn-outline-dark {
  border: 1px solid #1D4D2A;
  color: #1D4D2A;
  background: transparent;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 36px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  display: inline-block;
}
.btn-outline-dark:hover { background: #1D4D2A; color: #F5EAD6; }

.btn-outline-light {
  border: 1px solid #F5EAD6;
  color: #F5EAD6;
  background: transparent;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 36px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  display: inline-block;
}
.btn-outline-light:hover { background: #F5EAD6; color: #1D4D2A; }

.nav-pill-link {
  color: #F5EAD6;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-pill-link:hover { background: #F5EAD6; color: #1D4D2A; }

.btn-circle {
  width: 32px;
  height: 32px;
  border: 1px solid #1D4D2A;
  color: #1D4D2A;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.2s, color 0.2s, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.btn-circle:hover { background: #1D4D2A; color: #F5EAD6; }

/* ── Scroll progress bar ── */
.progress-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 150;
  pointer-events: none;
}
.progress-bar {
  height: 100%;
  width: 0%;
  transition: background-color 0.3s ease;
}
/* green section → cream bar; cream section → green bar */
.progress-container.is-cream .progress-bar { background: #F5EAD6; }
.progress-container.is-green .progress-bar { background: #1D4D2A; }

/* ── Nav overlay ── */
#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #1D4D2A;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
#nav-overlay.open { display: flex; }
#nav-overlay a {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: clamp(36px, 6vw, 64px);
  text-transform: uppercase;
  color: #F5EAD6;
  text-decoration: none;
  letter-spacing: 0.04em;
  /* Mask: clip the sliding inner span */
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  opacity: 0.9;
  transition: opacity 0.15s, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#nav-overlay a:hover { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  #nav-overlay a:hover { transform: scale(1.07); }
}

/* Inner span starts below its mask and slides up on open */
.nav-link-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Staggered reveal when .nav-anim is applied */
#nav-overlay.nav-anim .nav-link-inner           { transform: translateY(0); }
#nav-overlay.nav-anim a:nth-child(2) .nav-link-inner { transition-delay: 0.08s; }
#nav-overlay.nav-anim a:nth-child(3) .nav-link-inner { transition-delay: 0.16s; }
#nav-overlay.nav-anim a:nth-child(4) .nav-link-inner { transition-delay: 0.24s; }
#nav-overlay.nav-anim a:nth-child(5) .nav-link-inner { transition-delay: 0.32s; }

/* ── Hamburger button ── */
#nav-open {
  position: fixed;
  top: 24px;
  right: 20px;
  z-index: 300;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 30px;
}
#nav-open .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #F5EAD6;
  border-radius: 1px;
  transform-origin: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
/* Dynamic color — matches progress bar logic but ~40px ahead */
#nav-open.nav-is-green .bar  { background: #1D4D2A; }
/* When overlay is open, bars always appear cream (on green overlay bg) */
#nav-open.active .bar        { background: #F5EAD6; }
/* X state — translateY recalculated for height:2px + gap:5px → center offset = 7px */
#nav-open.active .bar-top    { transform: translateY(7px) rotate(45deg); }
#nav-open.active .bar-mid    { opacity: 0; transform: scaleX(0); }
#nav-open.active .bar-bot    { transform: translateY(-7px) rotate(-45deg); }

/* ── Skills slider ── */
.skill-card {
  flex: 0 0 calc(25% - 12px);
  background: #1D4D2A;
  border-radius: 14px;
  padding: 22px 18px;
  color: #F5EAD6;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  transition: filter 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .skill-card { cursor: pointer; }
  .skill-card:hover { filter: brightness(1.12); }
}
.skill-name {
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.25;
}
.skill-bullets {
  list-style: disc;
  padding-left: 14px;
  font-size: 11px;
  line-height: 1.65;
  opacity: 0.78;
  flex: 1;
}
.skill-bullets li + li { margin-top: 6px; }
.skill-num {
  font-size: 10px;
  opacity: 0.32;
  letter-spacing: 0.08em;
  align-self: flex-end;
}
.skill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid #1D4D2A;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.skill-dot.active { background: #1D4D2A; }
@media (max-width: 600px) {
  .skill-card { flex: 0 0 100%; }
}

/* ── Word-reveal animation ── */
.word-reveal {
  display: inline-block;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(10px);
  transition:
    opacity  0.55s cubic-bezier(0.215, 0.61, 0.355, 1),
    filter   0.55s cubic-bezier(0.215, 0.61, 0.355, 1),
    transform 0.55s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.word-reveal.word-active {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

/* ── Hover lift base — defined BEFORE reveal-el so reveal-el's transition wins
      on elements that carry both classes ── */
.hover-lift {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Inline elements need block formatting for transform to work in all browsers */
span.hover-lift { display: inline-block; }

/* ── Universal scroll reveal ── */
.reveal-el {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-el.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Fade-only variant for elements with overflow:hidden (avoids clipping artefact) */
.reveal-fade {
  opacity: 0;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-fade.is-visible { opacity: 1; }

/* ── Hover lift interactive (desktop pointer only) ── */
@media (hover: hover) and (pointer: fine) {
  .hover-lift { cursor: pointer; }
  /* inline elements need inline-block for transform to apply */
  span.hover-lift { display: inline-block; }
  .hover-lift:hover { transform: translateY(0) scale(1.04); position: relative; z-index: 2; }
  .btn-outline-dark:hover  { transform: scale(1.04); position: relative; z-index: 2; }
  .btn-outline-light:hover { transform: scale(1.04); position: relative; z-index: 2; }
  .nav-pill-link:hover     { transform: scale(1.04); position: relative; z-index: 2; }
  .btn-circle:hover        { transform: scale(1.04); position: relative; z-index: 2; }
}

/* ── Hero name slide-up mask ── */
.name-mask {
  display: inline-block;
  overflow: hidden;
  /* Extra room below the baseline so descenders ('y') aren't clipped */
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
  vertical-align: top;
}
.name-word {
  display: block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.name-word.name-visible {
  transform: translateY(0);
}
#name-duffy { transition-delay: 0.1s; }

/* ── Hero name hover (scale entire h1) ── */
.hero-name {
  display: inline-block;
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .hero-name:hover { transform: scale(1.07); }
}

@media (max-width: 640px) {
  /* Projects: 3-col → 1-col */
  #projects-grid {
    grid-template-columns: 1fr !important;
  }

  /* Contact pill: side-by-side → stacked */
  #contact-pill {
    flex-direction: column !important;
    min-height: unset !important;
  }
  #contact-photo {
    width: 100% !important;
    padding: 16px 16px 0 !important;
  }
  #contact-photo img {
    height: 220px !important;
    width: 100% !important;
  }
  #contact-form-col {
    padding: 20px 20px 24px !important;
  }



  /* Image strip: 5-col → 3-col */
  #image-strip {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  #image-strip img:nth-child(4),
  #image-strip img:nth-child(5) {
    display: none !important;
  }

  /* About content: stack headshot above bio on mobile */
  #about-content { flex-direction: column !important; gap: 24px !important; }
  #about-content > div:first-child { width: 100% !important; }

  /* Footer nav pill: tighten gap + padding to prevent link wrapping */
  #footer-nav-pill { gap: 10px !important; padding: 8px 14px !important; }

  /* Image strip: 3-col grid → horizontal swipe scroll */
  #image-strip {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 8px !important;
    padding: 0 16px !important;
  }
  #image-strip a {
    flex: 0 0 160px !important;
    display: block;
  }
  #image-strip img {
    width: 160px !important;
    height: 120px !important;
    scroll-snap-align: start;
  }
  /* Un-hide images 4 and 5 (previously hidden in the 3-col grid layout) */
  #image-strip a:nth-child(4),
  #image-strip a:nth-child(5) {
    display: block !important;
  }
}

/* ── Case study / photography back-link ── */
.cs-back-link {
  color: #F5EAD6;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.cs-back-link:hover { opacity: 1; }

/* ── Contact form ── */
.contact-input {
  border: 1px solid rgba(29,77,42,0.35);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  background: transparent;
  color: #1D4D2A;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.contact-input:focus { border-color: #1D4D2A; }
.contact-input::placeholder { opacity: 0.5; }
