/* ============================================
   Kevin Jordan O'Shea — Portfolio v2
   Performance-tuned, identical visual language
   ============================================ */

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

:root {
  --color-bg:        #fafaf8;
  --color-text:      #0d0d0d;
  --color-muted:     #888888;
  --color-border:    #e8e8e8;
  --color-skeleton:  #f0efec;
  --color-skeleton2: #e6e5e1;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --strip-h: clamp(160px, 28vh, 280px);
  --strip-gap: 3px;
  --ease: 220ms cubic-bezier(.22,.61,.36,1);
  --ease-slow: 480ms cubic-bezier(.22,.61,.36,1);
}



html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--ease-slow), color var(--ease-slow);
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; line-height: 0; }


/* ============================================
   Header
   ============================================ */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.125rem 2rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 100;
  backdrop-filter: saturate(1.2);
}

.nav-primary {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  row-gap: 0.25rem;
}

.nav-link {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color var(--ease);
  white-space: nowrap;
}
.nav-link:hover   { color: var(--color-text); }
.nav-link--active {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.site-name {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.82rem, 1.05vw, 0.96rem);
  letter-spacing: 0.06em;
  white-space: nowrap;
  justify-self: center;
  transition: opacity var(--ease);
}
.site-name:hover { opacity: 0.4; }

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}



.instagram-link       { display: flex; color: var(--color-muted); transition: color var(--ease); padding: 0.25rem; }
.instagram-link:hover { color: var(--color-text); }
.instagram-link svg   { width: 18px; height: 18px; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 0.25rem;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-width: 44px; min-height: 44px;
}
.nav-toggle__bar {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--color-text);
  transition: transform 220ms ease, opacity 220ms ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================
   Hub intro
   ============================================ */
.hub-intro {
  padding: 3.5rem 2rem 0;
}
.hub-intro__tagline {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ============================================
   Series row
   ============================================ */
.serie-row { margin-bottom: 5rem; }

.serie-row__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2rem 1rem;
  gap: 1rem;
}

.serie-row__title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  transition: opacity var(--ease);
}
.serie-row__title:hover { opacity: 0.45; }

.serie-row__desc {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  font-weight: 300;
}

.serie-row__more {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  transition: color var(--ease);
  white-space: nowrap;
}
.serie-row__more:hover { color: var(--color-text); }

/* ============================================
   Strip — horizontal scroller
   ============================================ */
.strip-wrap {
  position: relative;
}

.gallery-strip {
  display: flex;
  gap: var(--strip-gap);
  overflow-x: auto;
  overflow-y: hidden;
  height: var(--strip-h);
  scrollbar-width: none;
  padding: 0 2rem;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: var(--snap, none);
}
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-strip.is-grabbing { cursor: grabbing; scroll-behavior: auto; }

.strip__item {
  flex: 0 0 auto;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--color-skeleton);
  scroll-snap-align: start;
  /* Reserve width via aspect-ratio so layout doesn't shift */
  aspect-ratio: var(--ar, 3/2);
}

/* Skeleton shimmer while images decode */
.strip__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--color-skeleton) 0%,
    var(--color-skeleton2) 50%,
    var(--color-skeleton) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  opacity: 1;
  transition: opacity 320ms ease;
}
.strip__item.is-loaded::before { opacity: 0; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.strip__item img {
  position: relative;
  height: 100%;
  width: 100%;
  display: block;
  object-fit: cover;
  transition: filter var(--ease), opacity 320ms ease, transform var(--ease-slow);
  filter: brightness(0.96);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
}
.strip__item.is-loaded img { opacity: 1; }
.strip__item:hover img    { filter: brightness(1.02); }

/* Hover variants set by Tweaks */
[data-hover="zoom"] .strip__item:hover img    { transform: scale(1.04); filter: brightness(1.0); }
[data-hover="grayscale"] .strip__item img     { filter: grayscale(1) brightness(0.94); }
[data-hover="grayscale"] .strip__item:hover img { filter: grayscale(0) brightness(1.02); }

/* Edge fade — soft scroll affordance */
.strip-wrap.has-edge-fade::before,
.strip-wrap.has-edge-fade::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 4rem;
  pointer-events: none;
  z-index: 2;
  transition: opacity var(--ease);
}
.strip-wrap.has-edge-fade::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg) 10%, transparent);
  opacity: 0;
}
.strip-wrap.has-edge-fade::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg) 10%, transparent);
  opacity: 1;
}
.strip-wrap.is-scrolled::before { opacity: 1; }
.strip-wrap.at-end::after       { opacity: 0; }

/* Scroll arrows */
.strip-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
}
.strip-arrow:hover { background: var(--color-text); color: var(--color-bg); }
.strip-arrow--prev { left: 0.75rem; }
.strip-arrow--next { right: 0.75rem; }
.strip-wrap:hover .strip-arrow { opacity: 1; }
.strip-arrow[disabled] { opacity: 0 !important; pointer-events: none; }

/* ============================================
   Hero / page label / about / contact
   ============================================ */
.hero { padding: 5rem 2rem 3.5rem; text-align: center; }
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.hero__tagline {
  font-size: clamp(0.875rem, 1.4vw, 1rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-muted);
  max-width: 36em;
  margin-inline: auto;
}

.serie-intro { padding: 3.5rem 2rem 2rem; max-width: 700px; }
.serie-intro p {
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--color-muted);
}

.page-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 3rem 2rem 1.5rem;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.96);
  z-index: 999;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}
.lightbox.is-open {
  display: flex;
  animation: lbfade 220ms ease both;
}
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }

.lightbox__stage {
  position: relative;
  width: 92vw;
  height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: default;
  opacity: 0;
  transition: opacity 240ms ease;
}
.lightbox__img.is-loaded { opacity: 1; }

.lightbox__loader {
  position: absolute;
  width: 28px; height: 28px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.7);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity var(--ease);
}
.lightbox.is-loading .lightbox__loader { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: color var(--ease);
  font-family: var(--font-body);
  position: absolute;
  user-select: none;
}
.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover { color: #fff; }

.lightbox__close {
  top: 1.25rem;
  right: 1.75rem;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  padding: 0.5rem;
}
.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.75rem;
  line-height: 1;
  padding: 0.5rem 1.5rem;
}
.lightbox__prev { left: 0; }
.lightbox__next { right: 0; }

.lightbox__caption {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

/* ============================================
   About / Contact
   ============================================ */
.about-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  column-gap: clamp(2rem, 4vw, 5rem);
  padding: 0 2rem 6rem;
  align-items: start;
}
.about-text p { font-size: 1rem; font-weight: 300; line-height: 1.85; }
.about-text p + p { margin-top: 1.5rem; }
.about-photo img { width: 100%; }

.contact-layout { padding: 5rem 2rem 4rem; text-align: center; }
.contact-location {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
}
.contact-links { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.contact-links a {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 300;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 3px;
  transition: color var(--ease), border-color var(--ease);
}
.contact-links a:hover { color: var(--color-muted); border-color: transparent; }

.contact-diptych {
  max-width: 560px;
  margin: 0 auto 5rem;
  padding: 0 2rem;
}
.contact-diptych img { width: 100%; display: block; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  background: var(--color-bg);
}
.site-footer__copy,
.site-footer a {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  transition: color var(--ease);
}
.site-footer a:hover { color: var(--color-text); }

/* ============================================
   Serie page — near-full-height immersive strip
   ============================================ */
body.serie-page .gallery-strip {
  --strip-h: clamp(260px, 48vh, 560px);
  margin-bottom: 0;
}

/* Compact info row: title + count | description */
.serie-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0 3rem;
  padding: 2rem 2rem 1.25rem;
}
.serie-head__left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 110px;
}
.serie-head__title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
}
.serie-head__count {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.serie-head__desc {
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--color-muted);
  max-width: 48em;
  text-wrap: pretty;
}

/* Lightbox counter */
.lightbox__counter {
  position: absolute;
  top: 1.35rem;
  left: 1.75rem;
  color: rgba(255,255,255,0.38);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ============================================
   Focus
   ============================================ */
:focus-visible {
  outline: 1.5px solid var(--color-text);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  body, .strip__item img { animation: none !important; transition: none !important; }
  .strip__item::before { animation: none; }
  .gallery-strip { scroll-behavior: auto; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    padding: 1rem 1.25rem;
  }
  .site-name    { grid-column: 1; grid-row: 1; justify-self: start; }
  .header-right { grid-column: 2; grid-row: 1; gap: 0.25rem; }

  .nav-toggle { display: flex; }

  .nav-primary {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 1.75rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 200ms ease, transform 200ms ease;
    flex-wrap: nowrap;
    column-gap: 0;
    row-gap: 0;
  }
  .nav-primary.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  body.nav-open { overflow: hidden; }

  .nav-link {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--color-muted);
    line-height: 1;
    white-space: normal;
  }
  .nav-link:hover, .nav-link--active { color: var(--color-text); }

  :root { --strip-h: clamp(180px, 44vw, 300px); }
  .gallery-strip {
    padding: 0 1.25rem;
    -webkit-mask-image: linear-gradient(to right, black 82%, transparent 100%);
    mask-image: linear-gradient(to right, black 82%, transparent 100%);
  }
  body.serie-page .gallery-strip {
    --strip-h: 60vw;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .serie-head {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 1rem;
  }
  .strip-arrow { display: none; }
  .strip-wrap.has-edge-fade::before,
  .strip-wrap.has-edge-fade::after { display: none; }

  .hero          { padding: 2.5rem 1.25rem 1.75rem; }
  .hero__title   { font-size: clamp(1.75rem, 6vw, 2.5rem); margin-bottom: 1rem; }
  .serie-intro   { padding: 2rem 1.25rem 1.5rem; }
  .page-label    { padding: 2rem 1.25rem 1rem; }
  .about-layout  { grid-template-columns: 1fr; padding: 0 1.25rem 4rem; }
  .contact-layout { padding: 3rem 1.25rem 2.5rem; }
  .site-footer    { padding: 1.25rem; }
  .hub-intro      { padding: 2.5rem 1.25rem 0; }
  .serie-row__header { padding: 0 1.25rem 0.75rem; }
  .serie-row { margin-bottom: 3rem; }
}

@media (max-width: 380px) {
  .nav-link   { font-size: 1.4rem; }
  :root       { --strip-h: 50vw; }
}
