/* ==========================================================================
   BASE RESET, TYPOGRAPHY, & FLOATING FRAMELESS LIGHTBOX
   ========================================================================== */

:root {
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-manrope: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg-page: #000000;
  --bg-card: #181717;
  --bg-card-hover: #211f1f;
  --bg-btn: #2d2a2a;
  --bg-btn-hover: #3a3636;
  --text-primary: #ffffff;
  --text-body: rgb(255 255 255 / 0.8);
  --text-muted: rgb(255 255 255 / 0.65);
  /* Reading text (decided 2026-12, see AGENTS.md): ~65 chars/line, 18px body. */
  --read-size: 18px;
  --read-lh: 1.65;
  --read-ls: 0.005em;
  --read-color: rgb(255 255 255 / 0.78);
  --read-gap: 26px;
  --read-measure: 612px;
  --read-wide: 800px;
  --read-sm-size: 15.5px;
  --read-sm-lh: 1.6;
  --read-xs-size: 14.5px;
  --read-xs-lh: 1.55;
  --accent: #ec7200;
  --divider-subtle: rgb(255 255 255 / 0.16);
  --ring-subtle: rgb(255 255 255 / 0.09);
  --ring-hover: rgb(255 255 255 / 0.2);

  --border-hairline: 1px;
  --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
}

@media (max-width: 480px) {
  :root {
    --read-size: 17px;
    --read-gap: 22px;
  }
}

@media only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi) {
  :root {
    --border-hairline: 0.5px;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  background: var(--bg-page);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgb(255 255 255 / 0.45);
  outline-offset: 2px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2147483647;
  padding: 10px 14px;
  background: #181717;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: 16px; }

#stage {
  min-height: 100dvh;
  isolation: isolate;
}

/* ==========================================================================
   SHARED-ELEMENT VIEW TRANSITION (Smooth card -> lightbox morph)
   ========================================================================== */
::view-transition-group(active-plate) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 20;
}

::view-transition-old(active-plate),
::view-transition-new(active-plate) {
  height: 100%;
  width: 100%;
  object-fit: contain;
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ==========================================================================
   FLOATING FRAMELESS LIGHTBOX (<dialog closedby="any">)
   Floats cleanly above the page (never full-page takeover), zero ugly mat
   padding around the artwork, Prev/Next buttons + arrow keys, collapsible info
   ========================================================================== */
.inspect-dialog {
  padding: 0;
  border: 0;
  width: min(1280px, calc(100vw - 48px));
  height: min(840px, calc(100dvh - 56px));
  max-width: none;
  max-height: none;
  border-radius: 16px;
  background: #0b0b0b;
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.1),
    0 32px 80px rgb(0 0 0 / 0.8);
  overflow: hidden;
}

.inspect-dialog:modal {
  overscroll-behavior: contain;
}

.inspect-dialog::backdrop {
  background: rgb(0 0 0 / 0.82);
  backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.inspect-dialog[open] {
  display: flex;
}

.inspect-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  width: 100%;
  height: 100%;
}

.inspect-shell.is-info-hidden {
  grid-template-columns: minmax(0, 1fr) 0px;
}

.inspect-shell.is-info-hidden .inspect-meta-pane {
  display: none;
}

.inspect-media-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #000000;
  overflow: hidden;
  min-width: 0;
}

.inspect-canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 68px 66px;
  overflow: hidden;
}

.inspect-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 320ms var(--ease-out-quint);
  transform-origin: center center;
}

.inspect-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

/* Prev / Next flanking gallery arrows */
.inspect-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: rgb(24 23 23 / 0.85);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12);
  color: #fff;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}

.inspect-prev { left: 16px; }
.inspect-next { right: 16px; }

.inspect-nav:hover:not(:disabled) {
  background: #2d2a2a;
}

.inspect-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
}

.inspect-nav:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.inspect-controls-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgb(24 23 23 / 0.9);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.inspect-ctrl-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d5d5d5;
  font-family: var(--font-manrope);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.inspect-ctrl-btn:hover {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

.inspect-ctrl-btn[aria-pressed="true"] {
  color: #fff;
}

.inspect-ctrl-sep {
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: rgb(255 255 255 / 0.14);
}

.inspect-zoom-val {
  font-size: 12px;
  color: rgb(255 255 255 / 0.65);
  min-width: 42px;
  text-align: center;
}

/* Optional bottom thumbnail filmstrip inside lightbox */
.inspect-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 14px;
  background: #0a0a0a;
  border-top: var(--border-hairline) solid rgb(255 255 255 / 0.08);
  overflow-x: auto;
}

.inspect-strip[hidden] {
  display: none;
}

.inspect-strip-btn {
  flex: 0 0 64px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #181717;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 150ms ease, box-shadow 150ms ease;
}

.inspect-strip-btn:hover { opacity: 0.85; }
.inspect-strip-btn[data-active="true"] {
  opacity: 1;
  box-shadow: 0 0 0 2px #fff;
}

.inspect-strip-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Move controls bar above strip when strip is visible */
.inspect-media-pane.has-strip .inspect-controls-bar {
  bottom: 82px;
}

.inspect-meta-pane {
  padding: 26px 26px 28px;
  background: #111010;
  border-left: var(--border-hairline) solid rgb(255 255 255 / 0.08);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspect-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspect-meta-line {
  font-family: var(--font-manrope);
  font-size: 13px;
  color: var(--text-muted);
}

.inspect-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-btn);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: background-color 140ms ease;
}

.inspect-close:hover { background: var(--bg-btn-hover); }
.inspect-close:active { transform: scale(0.95); }

.inspect-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 1.24;
  font-weight: 600;
  color: #fff;
  text-wrap: balance;
}

.inspect-credit {
  margin: -8px 0 0;
  font-family: var(--font-manrope);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.inspect-summary {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--read-sm-size);
  line-height: var(--read-sm-lh);
  letter-spacing: var(--read-ls);
  color: var(--read-color);
  text-wrap: pretty;
}

.inspect-caveat {
  padding: 16px;
  border-radius: 10px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspect-caveat[hidden],
.inspect-lookfor[hidden] {
  display: none;
}

.inspect-caveat-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspect-caveat-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.inspect-caveat-label {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.inspect-caveat-new {
  margin: 0;
  font-size: var(--read-xs-size);
  line-height: var(--read-xs-lh);
  letter-spacing: var(--read-ls);
  color: var(--read-color);
}

.inspect-section-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.inspect-lookfor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspect-lookfor-btn {
  text-align: start;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-card);
  color: inherit;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.inspect-lookfor-btn:hover,
.inspect-lookfor-btn[data-active="true"] {
  background: #232121;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.18);
}

.inspect-lookfor-btn strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.inspect-lookfor-btn span {
  display: block;
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: var(--read-ls);
  color: var(--text-muted);
}

.inspect-facts {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: var(--border-hairline) solid rgb(255 255 255 / 0.08);
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 7px 12px;
  font-size: 12.5px;
}

.inspect-facts dt { color: rgb(255 255 255 / 0.48); }
.inspect-facts dd { margin: 0; color: var(--text-body); }

@media (max-width: 900px) {
  .inspect-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
  .inspect-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 52% 48%;
  }
  .inspect-meta-pane {
    border-left: 0;
    border-top: var(--border-hairline) solid rgb(255 255 255 / 0.08);
  }
  .inspect-canvas {
    padding: 14px 48px 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inspect-img-wrap { transition: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
