/* Joey Guzzino — joeys.cam 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;
  --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;
  /* Hairline dark edge around red captions. No blur, no panel. */
  --caption-edge:
    -1px 0 0 #0a0a0a,
    1px 0 0 #0a0a0a,
    0 -1px 0 #0a0a0a,
    0 1px 0 #0a0a0a,
    -1px -1px 0 #0a0a0a,
    1px -1px 0 #0a0a0a,
    -1px 1px 0 #0a0a0a,
    1px 1px 0 #0a0a0a;
}

*,
*::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: transparent;
}

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));
}

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

.float--brand {
  /* Resting box is the small mark on Amanda's thumbnail. Park uses transform only. */
  --brand-small: 0.4;
  --brand-top: calc(1.45rem + 0.28rem);
  --brand-left: 0.45rem;
  --brand-park-top: 14vh;
  top: var(--brand-top);
  left: var(--brand-left);
  transform-origin: top left;
  text-align: left;
  transform: translate(
    calc(50vw - var(--brand-left) - 50%),
    calc(var(--brand-park-top) - var(--brand-top) - 50%)
  ) scale(1);
  max-width: min(72vw, 22rem);
  animation: none;
}

.float--brand.is-landing {
  will-change: transform;
  animation: brand-land 1.6s ease forwards;
}

html.is-settled .float--brand {
  animation: none;
  transform: none;
  transition: none;
  will-change: auto;
  top: var(--brand-top);
  left: var(--brand-left);
}
.float__mark {
  transform-origin: top left;
  transform: scale(var(--brand-scale, 1));
}
html.is-settled .float__mark {
  --brand-scale: var(--brand-small);
}

/* Promote the layer a frame before the scale change so the grow does not pop. */
html.is-settled .float--brand.is-growing {
  will-change: transform;
}

/* JS eases --brand scale. Kill the snappy class transition while it drives. */
html.is-settled .float--brand.is-scale-ease {
  transition: none;
}

html.is-brand-large .float--brand {
  transform: none;
}
html.is-settled.is-brand-large .float__mark {
  --brand-scale: 1;
}

html.is-brand-large.is-brand-grown .float--brand {
  will-change: auto;
}

.float__title {
  font-family: var(--font-display);
  font-size: var(--display-size);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: none; /* preserve joeys.camera lowercase brand */
  color: var(--accent);
  margin: 0;
  width: fit-content;
  max-width: 100%;
  text-align: left;
  text-shadow: none;
  /* Tight plate. Left padding is 0 so joeys. and the tagline share one edge. */
  background-color: #000;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.02em 0 0.04em;
  transition: background-color 1.6s ease;
}

html.is-revealed .float__title {
  background-color: transparent;
}

.float__tagline {
  margin: 0.35rem 0 0;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(0.625rem, 2.4vw, 0.75rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: none;
  border-left: none;
  padding: 0.02em 0 0;
  background-color: #000;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 1.6s ease;
}

html.is-revealed .float__tagline {
  background-color: transparent;
}

/* Green category stack. Fixed on this element, bottom center of the viewport.
   a58d69e set the parent to position:static and width/height 0, which collapsed
   the box. Transform stays here, not on an ancestor of a fixed child. */
.float--social {
  position: fixed;
  z-index: 60;
  top: auto;
  right: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0 0 var(--safe-bottom);
  overflow: visible;
  pointer-events: none;
  background: transparent;
  border-radius: 0;
  text-align: center;
}

#category-float {
  position: static;
  z-index: auto;
  pointer-events: none;
  user-select: none;
  color: #30ff0d;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  text-align: center;
}

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

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

@keyframes brand-land {
  from {
    transform: translate(
      calc(50vw - var(--brand-left) - 50%),
      calc(var(--brand-park-top) - var(--brand-top) - 50%)
    ) scale(1);
  }
  to {
    transform: translate(0, 0) scale(var(--brand-small));
  }
}

@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;
}

/* ---------- Amanda intro: she fills the first screen ---------- */
/* No vignette. The photograph stays full brightness. */
.intro-vignette {
  display: none;
}

html:not(.is-settled),
html:not(.is-settled) body {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}

/* Full file, not the 50vw srcset candidate stretched to the viewport. */
@keyframes intro-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro-frame {
  position: fixed;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: none;
  transform: none;
  pointer-events: none;
  opacity: 0;
  animation: intro-in 1.35s ease 0.05s forwards;
  transition: opacity 0.9s ease;
}

@keyframes intro-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

html.is-revealed .intro-frame {
  opacity: 1;
  animation: intro-out 0.95s ease forwards;
  transition: none;
  will-change: opacity;
}

html:not(.is-revealed) .float--brand {
  animation: intro-in 1.35s ease 0.05s both;
}

/* Black cover stays through the fade so the mosaic dissolves in, not pops. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.is-settled)::before {
    content: "";
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 4;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.95s ease;
  }
  html.is-revealed::before {
    opacity: 0;
  }
  /* Tap path: drop the black cover immediately so the mosaic is already there. */
  html.is-revealed:not(.is-auto)::before {
    opacity: 0;
    visibility: hidden;
    transition: none;
  }
  /* Tap path: drop the cover immediately so the photo fades onto the mosaic. */
  html.is-revealed:not(.is-auto)::before {
    transition: none;
  }
}

html.is-settled .intro-frame {
  will-change: auto;
  visibility: hidden;
}

/* Hold her real mosaic cell under the full-bleed frame. */
html:not(.is-settled) .tile--feature {
  min-height: 50vw;
}

/* ---------- Work grid — 2-col default (phone) ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  align-items: start;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.tile {
  position: relative;
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
  background: transparent;
  align-self: start;
}

/* 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: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  background: transparent;
}

.tile__link:focus {
  outline: none;
}

/* Keyboard only. A click that opens the lightbox must not leave this ring. */
html.is-keyboard .tile__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  z-index: 2;
}

body.lightbox-open .tile__link:focus,
body.lightbox-open .tile__link:focus-visible {
  outline: none;
}

.tile__link picture {
  display: block;
  order: 1;
  flex: none;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0a0a0a;
}

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

/* Landing: captions take no space, so photos touch. First interaction opens the gutter. */
.tile__caption {
  order: 0;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  max-height: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: #ff3300;
  background: transparent;
  background-color: transparent;
  text-shadow: none;
  transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: none;
}

html.is-spaced .tile__caption {
  padding: 0.42rem 0 0.22rem;
  max-height: calc(0.42rem + 0.22rem + 0.6875rem * 1.1);
  opacity: 1;
}

html.is-spaced .tile__link:hover .tile__caption,
html.is-spaced .tile__link:focus-visible .tile__caption,
html.is-spaced .tile:focus-within .tile__caption,
html.is-spaced .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;
}

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

/* Hover dim only for a real pointer. Touch :hover and :active stick after a drag that leaves the tile. */
@media (hover: hover) and (pointer: fine) {
  .tile__link:hover .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. Spacing still waits for .is-spaced. */
.tile--top .tile__caption {
  margin: 0;
  transform: none;
  color: #ff3300;
  line-height: 1.1;
  font-weight: 500;
  background: transparent;
  background-color: transparent;
  text-shadow: none;
}

/* ---------- 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;
  width: 100%;
  max-width: none;
  padding: 1.15rem 1.25rem calc(6.25rem + var(--safe-bottom));
  padding-left: calc(1.25rem + var(--safe-left));
  padding-right: calc(1.25rem + var(--safe-right));
  background: var(--bg);
  border: none;
  background-image: none;
}

.about-strip::before {
  content: none;
  display: none;
}

.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;
  width: 100%;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  gap: 0;
}

.about-strip .contact-line a {
  color: var(--social);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 0;
  display: inline;
  white-space: nowrap;
  padding: 0;
}

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

@media (max-width: 520px) {
  .about-strip .contact-line .contact-ig,
  .about-strip .contact-line .sep-ig {
    display: none;
  }
}

.about-strip .ig-line {
  margin: 0.85rem 0 0;
  text-align: center;
}
.about-strip .ig-line a {
  color: var(--social);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.about-strip .ig-line a:hover,
.about-strip .ig-line a:focus-visible {
  color: #fff;
}

.about-strip .contact-line .sep {
  margin: 0 0.26rem;
  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__page {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.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 {
    --brand-small: 0.34;
    --brand-top: calc(1.5rem + 0.4rem);
    --brand-left: 0.7rem;
  }

  html:not(.is-settled) .tile--feature {
    min-height: 100vw;
  }

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

  .float--social {
    position: fixed;
    z-index: 60;
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    height: auto;
    max-width: none;
    pointer-events: none;
  }

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

  #category-float {
    position: static;
    top: auto;
    bottom: auto;
    right: auto;
    left: auto;
    transform: none;
    width: auto;
    max-width: none;
    text-align: center;
    color: #30ff0d;
  }

  .about-strip {
    padding: 1.5rem 1.75rem calc(6.25rem + var(--safe-bottom));
  }

  .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;
  }

  .float--brand {
    --brand-small: 0.32;
    --brand-top: calc(1.7rem + 0.45rem);
    --brand-left: 0.75rem;
  }

  html:not(.is-settled) .tile--feature {
    min-height: 50vw;
  }

  .tile--wide {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: auto;
  }

  .tile--wide picture {
    aspect-ratio: 2 / 1;
  }

  .tile__caption {
    transform: none;
    background: transparent;
    background-color: transparent;
    text-shadow: none;
    font-size: 0.75rem;
    font-weight: 500;
  }

  html.is-spaced .tile__caption {
    padding: 0.5rem 0 0.28rem;
    max-height: calc(0.5rem + 0.28rem + 0.75rem * 1.1);
    opacity: 1;
  }

  html.is-spaced .tile__link:hover .tile__caption,
  html.is-spaced .tile__link:focus-visible .tile__caption,
  html.is-spaced .tile:focus-within .tile__caption,
  html.is-spaced .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: auto;
    left: auto;
    right: auto;
    bottom: auto;
    position: relative;
    margin: 0;
    transform: none;
    transform-origin: top left;
    color: #ff3300;
    background: transparent;
    background-color: transparent;
    text-shadow: none;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.025em;
  }

  html.is-spaced .tile--top .tile__caption,
  html.is-spaced .tile--top .tile__link:hover .tile__caption,
  html.is-spaced .tile--top .tile__link:focus-visible .tile__caption,
  html.is-spaced .tile--top .tile:focus-within .tile__caption,
  html.is-spaced .tile--top.is-caption-on .tile__caption {
    padding: 0.5rem 0 0.28rem;
    max-height: calc(0.5rem + 0.28rem + 0.75rem * 1.15);
    opacity: 1;
  }

  #category-float {
    position: static;
    top: auto;
    bottom: auto;
    right: auto;
    left: auto;
    transform: none;
    max-width: none;
    text-align: center;
    color: #30ff0d;
  }

  .float--social {
    position: fixed;
    z-index: 60;
    width: max-content;
    height: auto;
    max-width: none;
    top: auto;
    bottom: 0;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .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--brand.is-landing,
  html.is-settled .float--brand {
    animation: none;
    transition: none;
    top: var(--brand-top);
    left: var(--brand-left);
    transform: translate(0, 0) scale(var(--brand-small));
    will-change: auto;
  }
  html.is-brand-large .float--brand {
    transform: translate(0, 0) scale(1);
    will-change: auto;
  }
  .intro-frame {
    opacity: 0;
    visibility: hidden;
    transition: none;
  }
  .float__title,
  .float__tagline {
    background-color: transparent;
    transition: none;
    text-shadow: none;
  }
  html:not(.is-settled),
  html:not(.is-settled) body {
    overflow: visible;
    height: auto;
  }
  html:not(.is-settled) .tile--feature,
  html:not(.is-revealed) .tile--feature {
    min-height: 0;
  }
  .float--social,
  #category-float {
    animation: none;
  }
  .tile__caption,
  .tile--top .tile__caption {
    transform: none;
    opacity: 1;
    transition: none;
    padding: 0.42rem 0 0.22rem;
    max-height: calc(0.42rem + 0.22rem + 0.6875rem * 1.1);
  }

  @media (min-width: 992px) {
    .tile__caption,
    .tile--top .tile__caption {
      padding: 0.5rem 0 0.28rem;
      font-size: 0.75rem;
      max-height: calc(0.5rem + 0.28rem + 0.75rem * 1.15);
    }
  }
  .tile__img {
    transition: none;
  }
  .lightbox {
    transition: none;
  }
}

/* Auto reveal: one duration, one curve. Photo holds, then dissolves as the mark lands. */
@keyframes intro-out-auto {
  0% { opacity: 1; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}
html.is-auto.is-revealed .intro-frame {
  opacity: 1;
  animation: intro-out-auto 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: none;
}
html.is-auto.is-revealed::before {
  transition-duration: 2.6s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: 0.35s;
}
html.is-auto .float--brand.is-landing {
  animation-duration: 2.6s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
html.is-auto.is-revealed .float__title,
html.is-auto.is-revealed .float__tagline {
  transition-duration: 2.6s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
html.is-auto.is-settled .float--brand {
  transition: none;
}

.clients {
  margin: 1.05rem 0 0.15rem;
}
.clients__label {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
}
.clients__marquee {
  overflow: hidden;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.clients__track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  animation: clients-slide 155s linear infinite;
}
.clients__track span {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  text-transform: lowercase;
}
@keyframes clients-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .clients__marquee { mask-image: none; width: auto; margin-left: 0; }
  .clients__track { display: block; width: auto; animation: none; }
  .clients__track span[aria-hidden="true"] { display: none; }
  .clients__track span { white-space: normal; }
}

.brand-dot {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  line-height: inherit;
}
.brand-dot__core {
  color: inherit;
  transition: opacity 0.35s ease;
}
.brand-dot__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  margin: 0;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.brand-dot__ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center;
}
html.is-dot-load:not(.is-revealed) .brand-dot__core {
  opacity: 0;
}
html.is-dot-load:not(.is-revealed) .brand-dot__ring {
  opacity: 1;
}
html.is-dot-load:not(.is-revealed) .brand-dot__stroke {
  animation: brand-dot-draw 1.8s linear infinite;
}
html.is-revealed .brand-dot__core {
  opacity: 1;
  transition: opacity 0.28s ease 0.18s;
}
html.is-revealed .brand-dot__ring {
  opacity: 0;
  transition: opacity 0.28s ease 0.18s;
}
html.is-revealed .brand-dot__stroke {
  animation: none;
}
@keyframes brand-dot-draw {
  to { stroke-dashoffset: -100; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-dot__ring { display: none; }
}

.work-page { max-width: 920px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.work-page__back a, .work-page__license a { color: var(--accent); }
.work-page h1 { font-size: 1.35rem; font-weight: 600; text-transform: lowercase; letter-spacing: 0.03em; margin: 1rem 0 0.35rem; }
.work-page__by, .work-page__license { color: rgba(255,255,255,0.55); font-size: 0.85rem; }
.work-page img { display: block; width: 100%; height: auto; margin: 1.25rem 0; }

.about-strip .about-link {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  text-transform: lowercase;
}
.about-strip .about-link a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.about-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}
.about-page__back {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.about-page__back a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.about-page__video {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 0 auto 1.4rem;
  background: #000;
  pointer-events: none;
}
.about-page__copy p {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.01em;
  margin: 0 0 0.9rem;
}

.about-page__portrait {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 0.4rem auto 1.15rem;
  background: #000;
}

/* ========== Tablet and desktop: mirror the phone mosaic ==========
   Every tile is one equal square cell, like the phone. The wordmark and
   captions scale off the tile width (--tile) with the phone ratios. */
@media (min-width: 600px) {
  :root {
    --cols: 3;
    --tile: calc(100vw / var(--cols));
    --display-size: calc(var(--tile) * 0.3);
    --cap-font: clamp(0.6875rem, calc(var(--tile) * 0.035), 0.875rem);
  }
  .work-grid {
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-auto-flow: row;
  }
  .tile--feature,
  .tile--wide {
    grid-column: auto;
    grid-row: auto;
  }
  .tile--wide picture {
    aspect-ratio: 1 / 1;
  }
  html:not(.is-settled) .tile--feature {
    min-height: var(--tile);
  }
  .float--brand {
    --brand-small: 0.4;
    --brand-left: calc(var(--tile) * 0.037);
    --brand-top: calc(var(--cap-font) * 2.03 + var(--tile) * 0.028);
    max-width: calc(var(--tile) * 1.44);
  }
  .float--brand.is-landing {
    animation-name: brand-land-wide;
  }
  .float__tagline {
    font-size: calc(var(--tile) * 0.048);
    margin-top: calc(var(--tile) * 0.029);
  }
  .tile__caption,
  .tile--top .tile__caption {
    font-size: var(--cap-font);
    line-height: 1.1;
  }
  html.is-spaced .work-grid .tile .tile__caption,
  html.is-spaced .work-grid .tile .tile__link .tile__caption {
    padding: 0.61em 0 0.32em;
    max-height: calc(var(--cap-font) * 2.03);
    line-height: 1.1;
  }
}
@media (min-width: 600px) and (prefers-reduced-motion: no-preference) {
  .float--brand {
    transform: translate(
      calc(50vw - var(--brand-left) - 50% * var(--brand-intro, 1)),
      calc(var(--brand-park-top) - var(--brand-top) - 50% * var(--brand-intro, 1))
    ) scale(var(--brand-intro, 1));
  }
}
@keyframes brand-land-wide {
  from {
    transform: translate(
      calc(50vw - var(--brand-left) - 50% * var(--brand-intro, 1)),
      calc(var(--brand-park-top) - var(--brand-top) - 50% * var(--brand-intro, 1))
    ) scale(var(--brand-intro, 1));
  }
  to {
    transform: translate(0, 0) scale(var(--brand-small));
  }
}
/* Landscape screens: show her whole portrait, like the phone does. */
@media (min-width: 600px) and (min-aspect-ratio: 1/1) {
  .intro-frame {
    object-fit: contain;
    object-position: center center;
  }
}
@media (min-width: 1100px) {
  :root { --cols: 4; }
}
@media (min-width: 2200px) {
  :root { --cols: 5; }
}
@media (min-width: 3000px) {
  :root { --cols: 6; }
}

/* Wide screens: fill the side space beside her portrait with a soft blur of
   the same photo. The sharp intro frame itself is not touched or masked.
   html::after  blur under the photo (z 4)
   body::after  the same blur over the photo's outer 4.5%, fading inward (z 6)
   body::before fine grain, sides and seam band only (z 7)
   All three fade with the intro. Phones and portrait tablets never match. */
@media (min-width: 600px) and (min-height: 600px) and (min-aspect-ratio: 1/1) {
  :root {
    --photo-h: 100vh;
  }
  @supports (height: 100dvh) {
    :root { --photo-h: 100dvh; }
  }
  :root {
    /* Photo box is 1290 by 1612 at full height, centered by object-fit. */
    --photo-half: calc(var(--photo-h) * 1290 / 1612 / 2);
    --feather: calc(var(--photo-h) * 1290 / 1612 * 0.045);
  }
  html::after,
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    /* Tone: quiet shadow with only a hint of her color. */
    background: #000 url("../images/projects/amanda/cover-640w.jpg") center 18% / cover no-repeat;
    filter: blur(32px) brightness(0.3) saturate(0.5);
    transform: scale(1.12);
    opacity: 0;
    animation: intro-in 1.35s ease 0.05s forwards;
  }
  body::after {
    z-index: 6;
    /* Mask is in the unscaled box, so seam positions are divided by the 1.12 scale. */
    --l: calc(50vw - var(--photo-half) / 1.12);
    --r: calc(50vw + var(--photo-half) / 1.12);
    --f: calc(var(--feather) / 1.12);
    -webkit-mask-image: linear-gradient(to right, #000 var(--l), transparent calc(var(--l) + var(--f)), transparent calc(var(--r) - var(--f)), #000 var(--r));
    mask-image: linear-gradient(to right, #000 var(--l), transparent calc(var(--l) + var(--f)), transparent calc(var(--r) - var(--f)), #000 var(--r));
  }
  html.is-revealed::after,
  html.is-revealed body::after {
    opacity: 1;
    animation: intro-out 0.95s ease forwards;
  }
  html.is-auto.is-revealed::after,
  html.is-auto.is-revealed body::after {
    animation: intro-out-auto 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  html.is-settled::after,
  html.is-settled body::after {
    content: none;
    display: none;
  }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 7;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.6 -0.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: soft-light;
    --l: calc(50vw - var(--photo-half));
    --r: calc(50vw + var(--photo-half));
    -webkit-mask-image: linear-gradient(to right, #000 var(--l), transparent calc(var(--l) + var(--feather)), transparent calc(var(--r) - var(--feather)), #000 var(--r));
    mask-image: linear-gradient(to right, #000 var(--l), transparent calc(var(--l) + var(--feather)), transparent calc(var(--r) - var(--feather)), #000 var(--r));
    opacity: 0;
    animation: grain-in 1.35s ease 0.05s forwards;
  }
  html.is-revealed body::before {
    animation: grain-out 0.95s ease forwards;
  }
  html.is-auto.is-revealed body::before {
    animation: grain-out-auto 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  html.is-settled body::before {
    content: none;
    display: none;
  }
}
@keyframes grain-in {
  from { opacity: 0; }
  to { opacity: 0.3; }
}
@keyframes grain-out-auto {
  0% { opacity: 0.3; }
  22% { opacity: 0.3; }
  100% { opacity: 0; }
}
@keyframes grain-out {
  from { opacity: 0.3; }
  to { opacity: 0; }
}
@media (min-width: 600px) and (min-height: 600px) and (min-aspect-ratio: 1/1) and (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  html::after {
    content: none;
    display: none;
  }
}

/* Joey's signature in the empty end of the last mosaic row. Only on 3+ column
   layouts (never phones, portrait or landscape), and only when JS finds the
   last row short (html.has-sig-space). Decorative: no link, no focus, no tile. */
@media (min-width: 600px) and (min-height: 600px) {
  html.has-sig-space .work-grid::after {
    content: "";
    /* JS sets the span to the empty cell count. Contain keeps the native ratio. */
    grid-column: span var(--sig-span, 1);
    align-self: stretch;
    pointer-events: none;
    padding: calc(var(--cap-font) * 2.03 + var(--tile) * 0.14) calc(var(--tile) * 0.15) calc(var(--tile) * 0.14);
    background: url("../images/joey-signature.png") center / contain no-repeat content-box;
    background-image: image-set(
      url("../images/joey-signature.webp") type("image/webp"),
      url("../images/joey-signature.png") type("image/png")
    );
    opacity: 0.9;
  }
}
