/* Joey Guzzino — joeys.work portfolio
   MOBILE-FIRST (design target ~390px). Desktop is enhancement.
   Vibe: avant-garde / chic / modern fashion (Mowalola-adjacent).
   Palette: black / hotter orange #ff3300 / lime IG #30ff0d / gold accent */

:root {
  --bg: #000000;
  --accent: #ff3300; /* hotter than Strasser #ff4400 */
  --accent-hot: #ff1a00;
  --magenta: #ff1a6b; /* Mowalola-adjacent fashion heat */
  --gold: #c9a227;
  --social: #30ff0d;
  --caption-size: 0.875rem; /* stronger presence on phone */
  --display-size: clamp(2.85rem, 15vw, 4.35rem);
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --preloader-ms: 900ms;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --touch-min: 44px;
}

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

html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  font-weight: 400;
  background: var(--bg);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(255, 26, 107, 0.45);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(255, 51, 0, 0.28);
}

button {
  -webkit-tap-highlight-color: rgba(255, 51, 0, 0.28);
  font-family: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--accent);
  color: #000;
  padding: 0.75rem 1rem;
  font-weight: 600;
  min-height: var(--touch-min);
}

.skip-link:focus {
  left: calc(0.5rem + var(--safe-left));
  top: calc(0.5rem + var(--safe-top));
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.96);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader {
  width: min(120px, 40vw);
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.loader::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-hot), var(--magenta), var(--gold));
  transform-origin: left;
  animation: load-bar 1.2s ease-in-out infinite;
}

@keyframes load-bar {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(1); }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* ---------- Floating brand (mobile-first) ---------- */
.float {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  user-select: none;
}

.float--brand {
  top: calc(3vh + var(--safe-top));
  left: calc(3vw + var(--safe-left));
  max-width: min(72vw, 22rem);
  animation: drift-x 5s ease-in-out infinite alternate,
             drift-y 6s ease-in-out infinite alternate;
}

.float__title {
  font-family: var(--font-display);
  font-size: var(--display-size);
  font-weight: 700;
  line-height: 0.84;
  letter-spacing: 0.02em;
  text-transform: none; /* preserve joeys.camera lowercase brand */
  color: var(--accent);
  margin: 0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.float__tagline {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(0.625rem, 2.4vw, 0.75rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.62);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  border-left: none; /* POV: simple "photographer" — not a second category rail */
  padding-left: 0.1rem;
}

/* Green category stack — fixed to the viewport like the red brand float.
   The rule is on #category-float itself so it cannot scroll with the grid. */
#category-float {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  user-select: none;
  color: #30ff0d;
  top: auto;
  left: auto;
  right: calc(4vw + var(--safe-right));
  bottom: calc(5.5rem + var(--safe-bottom));
  margin: 0;
  max-width: 7.25rem;
}

/* Instagram: large tap target on phone */
.float--social {
  top: auto;
  bottom: calc(5.5rem + var(--safe-bottom));
  right: calc(4vw + var(--safe-right));
  width: auto;
  max-width: 7.25rem;
  height: auto;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  overflow: visible;
  pointer-events: none; /* POV: decorative — must not steal mobile-web taps */
  background: transparent;
  border-radius: 0;
}

.float__social {
  display: block;
  width: auto;
  height: auto;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--social);
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  opacity: 0.92;
  overflow: visible;
  background: transparent;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.float__social:hover,
.float__social:focus-visible {
  opacity: 1;
  outline: 2px solid var(--social);
  outline-offset: 3px;
}

@keyframes drift-x {
  from { transform: translateX(0); }
  to { transform: translateX(6vw); } /* POV: less face occlusion on phone */
}

@keyframes drift-y {
  from { margin-top: 0; }
  to { margin-top: 8vh; }
}

@keyframes drift-x-slow {
  from { transform: translateX(0); }
  to { transform: translateX(-10vw); }
}

@keyframes drift-y-slow {
  from { margin-top: 0; }
  to { margin-top: -12vh; }
}

body.lightbox-open .float {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.lightbox-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  inset: 0 auto auto 0;
}

body.lightbox-open .work-grid,
body.lightbox-open .about-strip,
body.lightbox-open .float {
  pointer-events: none;
}

/* ---------- Work grid — 2-col default (phone) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0a0a0a;
}

/* Mosaic featured spans (tablet+) — keep 2-col square on phone */
.tile--feature,
.tile--wide {
  /* phone: stay 1 cell */
}

.tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 26, 107, 0.08) 0%,
    transparent 42%,
    rgba(0, 0, 0, 0.18) 100%
  );
  opacity: 0.85;
  mix-blend-mode: soft-light;
}


.tile__link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
}

.tile__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  z-index: 2;
}

.tile__link picture {
  display: block;
  width: 100%;
  height: 100%;
}

.tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

/* Phone: captions always readable — stronger presence */
.tile__caption {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 0.5rem 0.6rem;
  font-size: var(--caption-size);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.025em;
  text-transform: lowercase;
  color: var(--accent);
  transform: scale(1);
  transform-origin: top left;
  transition: opacity 0.15s ease, transform 0.1s ease, color 0.15s ease;
  pointer-events: none;
  max-width: calc(100% - 0.2rem);
  opacity: 0.82; /* POV client: image-forward, still readable */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 12px rgba(0, 0, 0, 0.45);
  background: transparent;
  padding-bottom: 0.5rem;
}

.tile__link:hover .tile__caption,
.tile__link:focus-visible .tile__caption,
.tile:focus-within .tile__caption,
.tile.is-caption-on .tile__caption {
  opacity: 1;
  transform: scale(1);
  color: var(--accent);
}
.tile__client,
.tile__name,
.tile__sep {
  color: var(--accent);
  opacity: 1;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.tile__link:hover .tile__img,
.tile__link:focus-visible .tile__img,
.tile.is-caption-on .tile__img {
  transform: scale(1.04);
  filter: brightness(0.72) saturate(1.18) contrast(1.05);
}

.tile__sep {
  color: var(--accent);
  opacity: 1;
}


/* Top-row tiles share one caption color and one inset (phone + desktop) */
.tile--top .tile__caption {
  top: 0.5rem;
  left: 0.55rem;
  padding: 0;
  margin: 0;
  opacity: 1;
  transform: none;
  color: var(--accent);
  line-height: 1.15;
  font-weight: 600;
}

/* ---------- Smart-crop helpers (square covers) ---------- */
.tile__img {
  object-position: center center;
}
.tile--pos-top .tile__img,
.tile--pos-top picture .tile__img {
  object-position: center top;
}
.tile--pos-upper .tile__img,
.tile--pos-upper picture .tile__img {
  object-position: center 18%;
}
.tile--pos-face .tile__img,
.tile--pos-face picture .tile__img {
  object-position: center 28%;
}
.tile--pos-center .tile__img,
.tile--pos-center picture .tile__img {
  object-position: center center;
}
.tile--pos-lower .tile__img,
.tile--pos-lower picture .tile__img {
  object-position: center 65%;
}


.tile--stage .tile__img,
.tile--stage picture .tile__img {
  object-position: center 36%;
}
.tile--wide.tile--stage .tile__img,
.tile--wide.tile--stage picture .tile__img {
  object-position: center center;
}

/* ---------- About strip ---------- */
.about-strip {
  position: relative;
  z-index: 10;
  padding: 1.75rem 1.25rem calc(1.85rem + var(--safe-bottom));
  padding-left: calc(1.25rem + var(--safe-left));
  padding-right: calc(1.25rem + var(--safe-right));
  background: var(--bg);
  border-top: 1px solid rgba(255, 26, 107, 0.4);
  max-width: 52rem;
}

.about-strip::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--magenta), var(--gold));
  margin-bottom: 1rem;
}

.about-strip p {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  text-transform: lowercase;
  letter-spacing: 0.01em;
}

.about-strip .about-lead {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  letter-spacing: 0.01em;
  margin-bottom: 0.85rem;
  text-transform: lowercase;
}

.about-strip .contact-line {
  margin-top: 1.15rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
}

.about-strip .contact-line a {
  color: var(--social);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
}

.about-strip .contact-line a:hover,
.about-strip .contact-line a:focus-visible {
  color: #fff;
}

.about-strip .contact-line .sep {
  margin: 0 0.55rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ---------- Lightbox (mobile-first, full-bleed) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: rgba(0, 0, 0, 0.98);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: calc(3.5rem + var(--safe-top)) 0 calc(1rem + var(--safe-bottom));
  width: 100%;
  height: 100%;
  height: 100dvh;
  touch-action: pan-y;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__close {
  position: absolute;
  top: calc(0.65rem + var(--safe-top));
  right: calc(0.65rem + var(--safe-right));
  width: 3rem;
  height: 3rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: none;
  border-radius: 2px;
  background: #1b1b1b;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: var(--accent);
  outline: none;
}

.lightbox__stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 7.5rem - var(--safe-top) - var(--safe-bottom));
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: none;
  border-radius: 2px;
  background: rgba(27, 27, 27, 0.85);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  background: var(--accent);
  outline: none;
}

.lightbox__prev { left: 0.35rem; }
.lightbox__next { right: 0.35rem; }

.lightbox__meta {
  flex-shrink: 0;
  margin: 0.75rem 1rem 0;
  text-align: center;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  padding-bottom: 0.25rem;
}

.lightbox__counter {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: none;
  font-weight: 400;
}

.lightbox__hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.35);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* ========== Tablet+ (~768) ========== */
@media (min-width: 768px) {
  :root {
    --caption-size: clamp(0.9rem, 1.25vw, 1.2rem);
    --display-size: clamp(3.5rem, 9vw, 5.5rem);
  }

  /* asymmetric mosaic — Strasser energy with fashion scale */
  .tile--feature {
    grid-column: span 2;
    grid-row: span 2;
  }

  .tile--wide {
    grid-column: span 2;
  }

  .float--brand {
    top: calc(6vh + var(--safe-top));
    left: calc(5vw + var(--safe-left));
  }

  .float__tagline {
    font-size: 0.8125rem;
    letter-spacing: 0.16em;
  }

  .float--social {
    top: 50vh;
    bottom: auto;
    right: calc(6vw + var(--safe-right));
    width: 9.5rem;
    height: 9.5rem;
  }

  .float__social {
    font-size: 0.9rem;
    line-height: 1.5;
    display: block;
    padding: 0;
  }

  #category-float {
    top: 50vh;
    bottom: auto;
    right: calc(6vw + var(--safe-right));
    max-width: 8.5rem;
  }

  .float--social {
    width: auto;
    height: auto;
    max-width: 8.5rem;
  }

  .about-strip {
    padding: 2rem 1.75rem 2.25rem;
  }

  .about-strip p {
    font-size: 1rem;
  }

  .about-strip .about-lead {
    font-size: 1.2rem;
  }

  .lightbox {
    padding: calc(2.5rem + var(--safe-top)) 1rem calc(1.5rem + var(--safe-bottom));
    align-items: center;
  }

  .lightbox__stage {
    max-width: 960px;
  }

  .lightbox__img {
    width: auto;
    max-width: 100%;
  }

  .lightbox__hint {
    display: none;
  }
}

/* ========== Desktop large — 4-col ========== */
@media (min-width: 992px) {
  :root {
    --caption-size: clamp(0.95rem, 1.2vw, 1.25rem);
    --display-size: clamp(4rem, 8vw, 6.875rem);
  }

  .work-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense;
  }

  .tile--feature {
    grid-column: span 2;
    grid-row: span 2;
  }

  .tile--wide {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 2 / 1; /* landscape: avoid 1:1 height leaving black holes beside */
  }

  /* Desktop: hide captions until hover/focus (Strasser-like) */
  .tile__caption {
    transform: scale(0);
    opacity: 1;
    background: none;
    padding-bottom: 0.5rem;
  }

  .tile__link:hover .tile__caption,
  .tile__link:focus-visible .tile__caption,
  .tile:focus-within .tile__caption,
  .tile.is-caption-on .tile__caption {
    transform: scale(1);
    opacity: 1;
  }

  /* First-row captions: same orange, same top-left inset on every tile */
  .tile--top .tile__caption,
  .tile--top .tile__link:hover .tile__caption,
  .tile--top .tile__link:focus-visible .tile__caption,
  .tile--top .tile:focus-within .tile__caption,
  .tile--top.is-caption-on .tile__caption {
    top: 0.5rem;
    left: 0.55rem;
    right: auto;
    bottom: auto;
    padding: 0;
    margin: 0;
    opacity: 1;
    transform: none;
    transform-origin: top left;
    color: var(--accent);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.025em;
  }

  #category-float {
    top: 55vh;
    bottom: auto;
    right: calc(6vw + var(--safe-right));
    max-width: 11rem;
  }

  .float--social {
    width: auto;
    height: auto;
    max-width: 11rem;
    top: 55vh;
  }

  .lightbox__stage {
    max-width: 1100px;
  }

  @keyframes drift-x {
    from { transform: translateX(0); }
    to { transform: translateX(18vw); }
  }

  @keyframes drift-y {
    from { margin-top: 0; }
    to { margin-top: 22vh; }
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .float--brand,
  .float--social,
  #category-float {
    animation: none;
  }
  .loader::after {
    animation: none;
    transform: scaleX(0.6);
  }
  .tile__caption {
    transform: scale(1);
    opacity: 0.95;
  }
  .tile__img {
    transition: none;
  }
  .preloader {
    transition: none;
  }
  .lightbox {
    transition: none;
  }
}
