/* Mark Jeffries — Street Gallery
   Late-night museum corridor */

:root {
  --void: #070708;
  --void-soft: #0e0e11;
  --wall: #141418;
  --frame: #2a241c;
  --frame-edge: #3d3428;
  --gold: #c4a574;
  --gold-dim: #8a7350;
  --plaque: #1a1814;
  --plaque-text: #d4cfc4;
  --plaque-muted: #8a8578;
  --light: rgba(255, 235, 200, 0.06);
  --vignette: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 35%, rgba(0,0,0,0.55) 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--void);
  color: var(--plaque-text);
  font-family: var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

body.gallery-active {
  cursor: grab;
}
body.gallery-active.is-dragging {
  cursor: grabbing;
  user-select: none;
}

/* Atmosphere */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: var(--vignette);
}

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 41;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Title screen */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(40, 32, 22, 0.45), transparent 70%),
    var(--void);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}

.title-screen.is-exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.title-inner {
  text-align: center;
  padding: 2rem;
  animation: titleIn 1.4s var(--ease) both;
}

@keyframes titleIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.title-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.75rem;
  font-weight: 400;
}

.title-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  letter-spacing: 0.04em;
  color: #ebe6dc;
  line-height: 1.05;
}

.title-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--gold);
  margin-top: 0.35rem;
  letter-spacing: 0.12em;
}

.enter-btn {
  margin-top: 3rem;
  appearance: none;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.95rem 1.8rem;
  cursor: pointer;
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}

.enter-btn:hover,
.enter-btn:focus-visible {
  background: rgba(196, 165, 116, 0.1);
  border-color: var(--gold);
  outline: none;
}

.enter-arrow {
  display: inline-block;
  margin-left: 0.6rem;
  transition: transform 0.35s var(--ease);
}

.enter-btn:hover .enter-arrow {
  transform: translateX(4px);
}

.title-hint {
  margin-top: 1.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--plaque-muted);
  opacity: 0.7;
}

.title-contact {
  margin-top: 2.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.title-contact a {
  color: var(--gold-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 165, 116, 0.25);
  transition: color 0.25s, border-color 0.25s;
}

.title-contact a:hover,
.title-contact a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
  outline: none;
}

.hud-contact {
  color: var(--gold-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 0.65rem;
}

.hud-contact:hover,
.hud-contact:focus-visible {
  color: var(--gold);
  outline: none;
}

/* Gallery corridor */
.gallery {
  position: fixed;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(180deg, #0a0a0c 0%, #121216 18%, #16151a 50%, #101014 82%, #080809 100%);
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }

.gallery::before {
  /* floor reflection band */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55));
  pointer-events: none;
  z-index: 2;
}

.track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  height: 100%;
  width: max-content;
  min-width: 100%;
  padding: 0 clamp(8vw, 12vw, 18vw);
  gap: clamp(4rem, 10vw, 9rem);
}

/* Each framed work = a "room" station */
.station {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: 100vh;
  padding: 6vh 0 10vh;
  position: relative;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.frame {
  position: relative;
  padding: clamp(8px, 1.2vw, 14px);
  background:
    linear-gradient(145deg, #3a3228 0%, #1e1a14 40%, #2c261e 100%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.8),
    0 25px 60px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,220,170,0.08);
  max-width: min(78vw, 820px);
  max-height: min(68vh, 720px);
}

.frame::before {
  /* mat */
  content: "";
  position: absolute;
  inset: clamp(8px, 1.2vw, 14px);
  border: clamp(10px, 1.6vw, 18px) solid #0c0c0e;
  pointer-events: none;
  z-index: 1;
}

.frame::after {
  /* soft spotlight on frame */
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 80%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 220, 170, 0.09), transparent 65%);
  pointer-events: none;
  z-index: 3;
}

.frame-inner {
  position: relative;
  overflow: hidden;
  background: #0a0a0c;
  line-height: 0;
}

.work-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(72vw, 780px);
  max-height: min(58vh, 640px);
  object-fit: contain;
  opacity: 0;
  filter: brightness(0.92) contrast(1.04);
  transition: opacity 0.7s var(--ease);
}

.work-img.is-loaded {
  opacity: 1;
}

.work-img.is-placeholder {
  filter: blur(16px) brightness(0.85);
  transform: scale(1.05);
}

/* Wall plaque */
.plaque {
  margin-top: clamp(1.1rem, 2.5vh, 1.8rem);
  max-width: min(72vw, 420px);
  text-align: center;
  padding: 0.85rem 1.1rem 1rem;
  background: linear-gradient(180deg, #1c1a16, #141310);
  border: 1px solid rgba(196, 165, 116, 0.18);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0.55;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.station.is-active .plaque {
  opacity: 1;
  transform: translateY(0);
}

.plaque-num {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.45rem;
}

.plaque-text {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  line-height: 1.45;
  color: var(--plaque-text);
  font-weight: 400;
}

.plaque-tone {
  margin-top: 0.55rem;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--plaque-muted);
}

/* HUD */
.hud {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 3vw, 2rem) calc(1rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.72));
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plaque-muted);
  pointer-events: none;
}

.hud > * { pointer-events: auto; }

.hud-artist {
  color: #c8c2b6;
  font-weight: 500;
}

.hud-sep { margin: 0 0.4rem; opacity: 0.5; }

.hud-center {
  font-variant-numeric: tabular-nums;
  color: var(--gold-dim);
}

.hud-of { margin: 0 0.25rem; opacity: 0.5; }

.nav-btn {
  appearance: none;
  border: 1px solid rgba(196, 165, 116, 0.25);
  background: rgba(20, 18, 14, 0.6);
  color: var(--gold);
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  margin-left: 0.4rem;
  transition: background 0.25s, border-color 0.25s;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  background: rgba(196, 165, 116, 0.12);
  border-color: var(--gold);
  outline: none;
}

.scroll-cue {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 44;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  opacity: 0;
  animation: cuePulse 3s ease-in-out 1.5s infinite;
  pointer-events: none;
  writing-mode: vertical-rl;
}

.scroll-cue.is-visible { opacity: 0.7; }

@keyframes cuePulse {
  0%, 100% { opacity: 0.35; transform: translateY(-50%) translateX(0); }
  50% { opacity: 0.8; transform: translateY(-50%) translateX(4px); }
}

/* Mobile tweaks */
@media (max-width: 700px) {
  .track {
    gap: clamp(2.5rem, 12vw, 4rem);
    padding: 0 12vw;
  }
  .station { padding: 5vh 0 12vh; }
  .frame {
    max-width: 88vw;
    max-height: 58vh;
  }
  .work-img {
    max-width: 82vw;
    max-height: 48vh;
  }
  .hud-left .hud-series,
  .hud-left .hud-sep,
  .hud-left .hud-contact-sep { display: none; }
  .hud-left .hud-contact {
    display: block;
    margin-top: 0.25rem;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .plaque { max-width: 86vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Full-screen zoom */
.nav-btn-zoom {
  width: auto;
  min-width: 2.4rem;
  padding: 0 0.85rem;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.is-zoomed {
  cursor: default;
  overflow: hidden;
}

body.is-zoomed #vignette,
body.is-zoomed #grain {
  z-index: 90;
}

.zoom {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 1.25rem calc(5.5rem + env(safe-area-inset-bottom));
  background: rgba(4, 4, 6, 0.97);
}

.zoom[hidden] {
  display: none !important;
}

.zoom-img {
  display: block;
  max-width: min(96vw, 1600px);
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0,0,0,0.65);
}

.zoom-caption {
  max-width: min(90vw, 640px);
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  line-height: 1.4;
  color: var(--plaque-text);
  opacity: 0.9;
}

.zoom-back {
  appearance: none;
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 85;
  border: 1px solid rgba(196, 165, 116, 0.45);
  background: rgba(20, 18, 14, 0.92);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

.zoom-back:hover,
.zoom-back:focus-visible {
  background: rgba(196, 165, 116, 0.14);
  border-color: var(--gold);
  outline: none;
}
