/* Nude Fox — app chrome.
   The photograph is the page. Everything else floats on top of it. */

:root {
  --bg: #000;
  --fg: #f6f6f4;
  --muted: rgba(246, 246, 244, 0.62);
  --glass: rgba(12, 12, 14, 0.42);
  --glass-strong: rgba(10, 10, 12, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #fff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --ui: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

html, body.gallery {
  overflow: hidden;
  overscroll-behavior: none;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -5rem;
  z-index: 80;
  background: #fff;
  color: #000;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: calc(0.6rem + var(--safe-top)); }

.app {
  position: relative;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
}

/* ---- viewport: the entire page ---- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.stage.is-panning { cursor: grabbing; }

.stage {
  isolation: isolate;
}

.shot {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.shot.is-hold {
  opacity: 0;
  z-index: 0;
}
.shot.is-hold.is-visible {
  opacity: 1;
}
.shot.is-hold.is-visible.is-fading-out {
  opacity: 0;
  transition: opacity 380ms linear;
}
.shot.is-live {
  z-index: 1;
  opacity: 1;
}
.shot.is-fading {
  transition: opacity 380ms linear;
}
/* Complementary opacities + plus-lighter = a dissolve that does not
   punch a hole to black in the overlap, but still lets leftover
   outgoing pixels fade away. */
.shot.dissolve {
  mix-blend-mode: plus-lighter;
}

.layer {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
}

.photo {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  pointer-events: none;
  background: #000;
  backface-visibility: hidden;
}
.photo.is-back {
  opacity: 0;
  z-index: 1;
  transition: none;
}
.photo.is-front {
  opacity: 1;
  z-index: 2;
  transition: none;
}
.photo.is-incoming {
  opacity: 0;
  z-index: 3;
  transition: opacity 380ms linear;
}
.photo.is-incoming.is-on {
  opacity: 1;
}
.photo.film {
  opacity: 1;
  z-index: 3;
  background: #000;
  object-fit: contain;
}
html.js .photo.film[hidden] { display: none; }
html.js img.photo.is-video-still,
html.js img.photo.is-hidden-still,
html.js .photo.is-cover.is-video-still,
html.js .photo.is-cover.is-hidden-still {
  display: none !important;
}
html:not(.js) .layer:has(video) > img.photo { display: none; }

html[data-reduced-motion="1"] .shot.is-fading,
html[data-reduced-motion="1"] .shot.is-hold.is-visible.is-fading-out,
html[data-reduced-motion="1"] .photo.is-cover {
  transition: none;
}

.load-spin {
  position: fixed;
  top: calc(0.85rem + var(--safe-top));
  right: calc(0.85rem + var(--safe-right));
  z-index: 20;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: load-spin 0.65s linear infinite;
  pointer-events: none;
}
.load-spin[hidden] { display: none !important; }
@keyframes load-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .load-spin { animation: none; border-top-color: #fff; opacity: 0.85; }
}

/* ---- overlays sit above the photo, never steal its space ---- */

.chrome,
.nav-edge {
  position: fixed;
  z-index: 8;
  color: var(--fg);
  transition: opacity var(--ease), transform var(--ease);
  pointer-events: none;
}
.chrome * ,
.nav-edge {
  pointer-events: auto;
}

.chrome-top {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: calc(0.7rem + var(--safe-top)) calc(1rem + var(--safe-right)) 2.4rem calc(1rem + var(--safe-left));
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.18) 55%, transparent 100%);
}

.chrome-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 2.2rem calc(0.85rem + var(--safe-right)) calc(0.7rem + var(--safe-bottom)) calc(0.85rem + var(--safe-left));
  background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.22) 58%, transparent 100%);
}
.chrome-bottom .video-bar { order: 1; }
.chrome-bottom .transport { order: 2; }
.chrome-bottom .thumbs { order: 3; }

body[data-idle="1"] .chrome-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}
body[data-idle="1"] .chrome-bottom,
body[data-idle="1"] .nav-edge {
  opacity: 0;
  pointer-events: none;
}
body[data-idle="1"] .chrome-bottom { transform: translateY(12px); }
.video-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 0.4rem 0.55rem 0.4rem 0.35rem;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.video-bar[hidden] { display: none !important; }
.video-clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 2.4rem;
}
.video-bar input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.22);
  border-radius: 99px;
  margin: 0;
}
.video-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 0;
}
#video-seek { flex: 1; }
#video-vol { width: 4.2rem; }
.video-bar .icon-mute { display: none; }
.video-bar [data-action="video-mute"][aria-pressed="true"] .icon-vol { display: none; }
.video-bar [data-action="video-mute"][aria-pressed="true"] .icon-mute { display: block; }

html.js img.photo.is-hidden-still,
html.js .photo.is-cover.is-hidden-still {
  opacity: 0 !important;
  visibility: hidden;
}
body[data-idle="1"] .nav-edge-prev { transform: translate(-8px, -50%); }
body[data-idle="1"] .nav-edge-next { transform: translate(8px, -50%); }
body[data-idle="1"] .stage { cursor: none; }

.brand {
  margin: 0;
  flex: 0 0 auto;
}
.brand a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tagline { display: none; }

.now-playing {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
}
.now-playing strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-playing span {
  color: var(--muted);
  font-size: 0.72rem;
}

.cats {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  min-width: 0;
  max-width: min(42vw, 28rem);
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
@media (max-width: 819px) {
  .cats { max-width: min(58vw, 16rem); }
}
.cats a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  flex: 0 0 auto;
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  border: 1px solid transparent;
}
.cats a:hover,
.cats a:focus-visible {
  color: var(--fg);
  background: rgba(255,255,255,0.14);
  outline: none;
}
.cats a[aria-current="page"] {
  color: #111;
  background: #fff;
}

.license-chip { margin: 0 0 0 0.2rem; }
.license-chip a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.license-chip a:hover { color: var(--fg); }

/* side hit-zones, Photos-app style */

.nav-edge {
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 1.35rem;
  line-height: 1;
}
.nav-edge:hover,
.nav-edge:focus-visible {
  background: var(--glass-strong);
  outline: none;
  color: #fff;
}
.nav-edge-prev { left: calc(0.7rem + var(--safe-left)); }
.nav-edge-next { right: calc(0.7rem + var(--safe-right)); }

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  align-self: center;
  padding: 0.28rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}
.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(255,255,255,0.14);
  outline: none;
}
.icon-btn[aria-pressed="true"] {
  background: #fff;
  color: #111;
}
.timer-btn {
  position: relative;
}
.timer-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(#fff var(--t, 0%), transparent 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
}
.timer-btn[aria-pressed="true"] .timer-ring {
  opacity: 1;
}
.timer-btn[aria-pressed="true"] {
  background: rgba(255,255,255,0.08);
  color: var(--fg);
}
.icon-btn .icon-pause { display: none; }
.icon-btn[aria-pressed="true"] .icon-play { display: none; }
.icon-btn[aria-pressed="true"] .icon-pause { display: block; }

.counter {
  min-width: 3.1rem;
  padding: 0 0.45rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.thumbs {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.45rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs ul {
  display: flex;
  justify-content: center;
  gap: 0.38rem;
  list-style: none;
  margin: 0;
  padding: 0.2rem 12vw;
  width: max-content;
  min-width: 100%;
}
.thumbs a {
  display: block;
  position: relative;
  width: 3.4rem;
  color: inherit;
  text-decoration: none;
}
.thumbs a.is-video::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.35rem;
  height: 1.35rem;
  margin: -0.85rem 0 0 -0.67rem;
  border-radius: 50%;
  background: rgba(0,0,0,0.72) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polygon fill='white' points='9 6 19 12 9 18'/></svg>") center/0.72rem no-repeat;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
  pointer-events: none;
}
.thumbs img {
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  object-fit: cover;
  background: #1a1a1a;
  border-radius: 6px;
  border: 1.5px solid transparent;
  opacity: 0.72;
  transition: opacity var(--ease), border-color var(--ease), transform var(--ease);
}
.thumbs a:hover img,
.thumbs a:focus-visible img {
  opacity: 1;
  outline: none;
}
.thumbs a[aria-current="page"] img {
  opacity: 1;
  border-color: #fff;
  box-shadow: 0 0 0 1px #fff;
}
.thumb-title { display: none; }

.fineprint {
  order: 4;
  margin: 0;
  text-align: center;
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0.55;
}
.fineprint a { color: inherit; }

@media (min-width: 700px) {
  .thumbs a,
  .thumbs img { width: 4rem; height: 4rem; }
}

/* ---- details sheet ---- */

.details {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22.5rem, 100%);
  background: var(--glass-strong);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border-left: 1px solid var(--line);
  overflow: auto;
  color: var(--fg);
}
.details-inner { padding: calc(1.2rem + var(--safe-top)) 1.25rem 3rem; }
.details h2 {
  font-size: 1.35rem;
  font-weight: 620;
  letter-spacing: -0.03em;
  margin: 0 0 0.55rem;
}
.lede {
  color: var(--muted);
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
}
.meta {
  display: grid;
  grid-template-columns: 6.8rem 1fr;
  gap: 0.45rem 0.75rem;
}
.meta dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.meta dd { margin: 0; font-size: 0.86rem; }
.meta a { color: var(--fg); }
.button {
  display: inline-flex;
  align-items: center;
  margin: 1.15rem 0.4rem 0 0;
  padding: 0.55rem 0.9rem;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 650;
  border-radius: 999px;
  border: 0;
}
.button.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}
.details .icon-btn {
  margin-top: 1.2rem;
  width: auto;
  height: auto;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* JS off: photo still cover-fills the viewport; overlays stay overlays. */
html:not(.js) .layer { inset: 0; overflow: hidden; }
html:not(.js) .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .chrome, .nav-edge, .thumbs img { transition: none !important; }
}

@media print {
  .chrome, .details, .skip-link, .nav-edge { display: none !important; }
  .stage { position: static; height: auto; overflow: visible; }
  .photo { position: static; width: 100%; height: auto; }
}
