:root {
  color-scheme: dark;
  --void: #000000;
  --obsidian: #0d0c11;
  --charcoal: #121212;
  --ash: #848895;
  --fog: #ababba;
  --white: #ffffff;
  --hairline: rgba(234, 236, 240, 0.13);
  --hairline-strong: rgba(234, 236, 240, 0.25);
  --green: #14f195;
  --purple: #9945ff;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--void);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--void);
  color: var(--white);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.014em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.lightbox-open {
  overflow: hidden;
}

body,
button {
  font-family: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

::selection {
  background: rgba(153, 69, 255, 0.5);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  min-height: 44px;
  padding: 11px 16px;
  transform: translateY(-150%);
  border-radius: 999px;
  background: var(--white);
  color: var(--void);
  font-size: 14px;
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.aftermath-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: grid;
  height: 72px;
  padding: 0 28px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px) saturate(130%);
}

.aftermath-brand {
  display: flex;
  width: max-content;
  min-height: 44px;
  align-items: center;
}

.aftermath-brand img {
  width: 174px;
  height: auto;
}

.header-edition {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ash);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-edition span:first-child {
  color: var(--white);
}

.header-edition span + span::before {
  margin-right: 10px;
  color: var(--hairline-strong);
  content: "/";
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  padding: 0 14px;
  align-items: center;
  justify-self: end;
  gap: 9px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--fog);
  font-size: 13px;
  transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 140ms var(--ease-out);
}

.back-link svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  transition: transform 180ms var(--ease-out);
}

.back-link:active,
.lightbox-control:active,
.copy-link:active {
  transform: scale(0.97);
}

.gallery-intro {
  position: relative;
  display: grid;
  width: min(calc(100% - 48px), 1480px);
  min-height: min(66vh, 700px);
  margin-inline: auto;
  padding: 164px 0 72px;
  align-content: end;
  grid-template-columns: minmax(0, 1fr);
  border-bottom: 1px solid var(--hairline);
}

.gallery-intro::before {
  position: absolute;
  top: 22%;
  right: 3%;
  width: min(40vw, 540px);
  height: 180px;
  transform: rotate(-12deg);
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(153, 69, 255, 0.42), rgba(20, 241, 149, 0.24));
  filter: blur(76px);
  opacity: 0.65;
  content: "";
  pointer-events: none;
}

.intro-meta {
  position: relative;
  display: flex;
  gap: 20px;
  color: var(--ash);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.intro-meta span:first-child {
  color: var(--white);
}

.gallery-intro h1 {
  position: relative;
  margin-top: 26px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(5.5rem, 15vw, 13rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.78;
}

.gallery-intro > p {
  position: absolute;
  right: 0;
  bottom: 78px;
  color: var(--ash);
  font-size: 12px;
}

.photo-grid {
  display: grid;
  width: min(calc(100% - 48px), 1480px);
  margin: 48px auto 0;
  grid-auto-flow: dense;
  grid-auto-rows: 24px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(234, 236, 240, 0.08);
  border-radius: 12px;
  background: var(--obsidian);
  cursor: zoom-in;
  isolation: isolate;
  transition: transform 160ms var(--ease-out), border-color 180ms var(--ease-out);
}

.photo-card[data-orientation="landscape"] {
  grid-column: span 6;
  grid-row: span 12;
}

.photo-card[data-orientation="portrait"] {
  grid-column: span 4;
  grid-row: span 16;
}

.photo-card[data-orientation="square"] {
  grid-column: span 4;
  grid-row: span 12;
}

.photo-card.is-featured {
  grid-column: span 8;
  grid-row: span 17;
}

.photo-card::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(110deg, #0d0c11 20%, #18151d 50%, #0d0c11 80%);
  background-size: 220% 100%;
  animation: image-skeleton 1.5s ease-in-out infinite;
  content: "";
}

@keyframes image-skeleton {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.photo-card img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 240ms var(--ease-out), transform 520ms var(--ease-out), filter 240ms var(--ease-out);
}

.photo-card.is-loaded img {
  opacity: 1;
}

.photo-card::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 42%, rgba(0, 0, 0, 0.66));
  opacity: 0;
  content: "";
  transition: opacity 220ms var(--ease-out);
}

.photo-index,
.photo-open-mark {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  opacity: 0;
  color: rgba(255, 255, 255, 0.86);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.photo-index {
  top: 16px;
  left: 16px;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.photo-open-mark {
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  transform: translateY(4px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.photo-open-mark svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.photo-card:active {
  transform: scale(0.992);
}

.noscript-message {
  width: min(calc(100% - 48px), 1480px);
  margin: 48px auto;
  color: var(--fog);
}

.aftermath-footer {
  display: flex;
  width: min(calc(100% - 48px), 1480px);
  min-height: 160px;
  margin: 80px auto 0;
  padding: 42px 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--hairline);
  color: var(--ash);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aftermath-footer a {
  min-height: 44px;
  color: var(--fog);
  transition: color 180ms var(--ease-out);
}

.lightbox {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  grid-template-rows: 72px minmax(0, 1fr) 72px;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: var(--white);
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
}

.lightbox[open] {
  display: grid;
}

.lightbox::backdrop {
  background: transparent;
}

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

.lightbox-chrome {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
}

.lightbox-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  padding: max(12px, env(safe-area-inset-top)) 24px 0;
  justify-content: space-between;
}

.lightbox-counter {
  display: flex;
  gap: 9px;
  color: var(--ash);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.lightbox-counter span:first-child {
  color: var(--white);
}

.lightbox-control,
.copy-link {
  display: inline-grid;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(16px);
  color: var(--fog);
  cursor: pointer;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 140ms var(--ease-out), border-color 160ms var(--ease-out);
}

.lightbox-control svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.close-control {
  width: 48px;
}

.nav-control {
  align-self: center;
  justify-self: center;
}

.previous-control {
  grid-column: 1;
  grid-row: 2;
}

.next-control {
  grid-column: 3;
  grid-row: 2;
}

.lightbox-stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 2;
  place-items: center;
  touch-action: pan-y pinch-zoom;
  transform: translateY(8px) scale(0.985);
  transition: transform 220ms var(--ease-out);
}

.lightbox.is-open .lightbox-stage {
  transform: translateY(0) scale(1);
}

.lightbox-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.988);
  filter: blur(2px);
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 200ms var(--ease-out), transform 220ms var(--ease-out), filter 200ms var(--ease-out);
}

.lightbox-stage img.is-ready {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.image-loader {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
}

.image-loader span {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: loader-spin 700ms linear infinite;
}

.image-loader[hidden] {
  display: none;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.image-error {
  color: var(--fog);
  font-size: 14px;
}

.lightbox-bottombar {
  grid-column: 1 / -1;
  grid-row: 3;
  padding: 0 24px max(12px, env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 20px;
}

.lightbox-bottombar > p {
  color: var(--ash);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-link {
  display: inline-flex;
  min-width: 116px;
  min-height: 44px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12px;
}

.copy-link svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

@media (hover: hover) and (pointer: fine) {
  .back-link:hover,
  .aftermath-footer a:hover {
    color: var(--white);
  }

  .back-link:hover {
    border-color: var(--hairline-strong);
  }

  .back-link:hover svg {
    transform: translateX(-2px);
  }

  .photo-card:hover,
  .photo-card:focus-visible {
    border-color: var(--hairline-strong);
  }

  .photo-card:hover img,
  .photo-card:focus-visible img {
    transform: scale(1.035);
    filter: saturate(1.04);
  }

  .photo-card:hover::after,
  .photo-card:focus-visible::after,
  .photo-card:hover .photo-index,
  .photo-card:focus-visible .photo-index,
  .photo-card:hover .photo-open-mark,
  .photo-card:focus-visible .photo-open-mark {
    opacity: 1;
  }

  .photo-card:hover .photo-open-mark,
  .photo-card:focus-visible .photo-open-mark {
    transform: translateY(0);
  }

  .lightbox-control:hover,
  .copy-link:hover {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(28, 28, 28, 0.9);
    color: var(--white);
  }
}

@media (max-width: 1100px) {
  .photo-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .photo-card[data-orientation="landscape"] {
    grid-column: span 4;
    grid-row: span 11;
  }

  .photo-card[data-orientation="portrait"] {
    grid-column: span 4;
    grid-row: span 16;
  }

  .photo-card[data-orientation="square"] {
    grid-column: span 4;
    grid-row: span 12;
  }

  .photo-card.is-featured {
    grid-column: span 8;
    grid-row: span 16;
  }
}

@media (max-width: 700px) {
  .aftermath-header {
    height: 64px;
    padding-inline: 16px;
    grid-template-columns: 1fr auto;
  }

  .aftermath-brand img {
    width: 150px;
  }

  .header-edition {
    display: none;
  }

  .back-link {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .back-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .gallery-intro {
    width: calc(100% - 32px);
    min-height: 480px;
    padding: 134px 0 54px;
  }

  .gallery-intro::before {
    top: 24%;
    right: -18%;
    width: 90vw;
    height: 130px;
  }

  .intro-meta {
    flex-direction: column;
    gap: 6px;
  }

  .gallery-intro h1 {
    margin-top: 24px;
    font-size: clamp(4.6rem, 20vw, 7rem);
    line-height: 0.85;
  }

  .gallery-intro > p {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 34px;
  }

  .photo-grid {
    display: flex;
    width: calc(100% - 24px);
    margin-top: 24px;
    flex-direction: column;
    gap: 12px;
  }

  .photo-card,
  .photo-card[data-orientation],
  .photo-card.is-featured {
    width: 100%;
    aspect-ratio: var(--aspect);
  }

  .photo-card[data-orientation="portrait"] {
    max-height: 78vh;
  }

  .photo-card::after,
  .photo-index,
  .photo-open-mark {
    opacity: 1;
  }

  .photo-card::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 54%, rgba(0, 0, 0, 0.5));
  }

  .photo-open-mark {
    transform: translateY(0);
  }

  .aftermath-footer {
    width: calc(100% - 32px);
    min-height: 190px;
    margin-top: 52px;
    flex-direction: column;
    gap: 12px;
  }

  .aftermath-footer a {
    display: flex;
    align-items: center;
  }

  .lightbox {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    grid-template-rows: 64px minmax(0, 1fr) 76px;
  }

  .lightbox-topbar {
    padding-inline: 12px;
  }

  .lightbox-stage {
    grid-column: 1 / -1;
    padding: 0 8px;
  }

  .nav-control {
    position: relative;
    z-index: 5;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .previous-control {
    margin-left: 8px;
    justify-self: start;
  }

  .next-control {
    margin-right: 8px;
    justify-self: end;
  }

  .lightbox-bottombar {
    padding-inline: 12px;
  }

  .lightbox-bottombar > p {
    display: none;
  }

  .copy-link {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .photo-card img,
  .lightbox-stage,
  .lightbox-stage img {
    transform: none !important;
    filter: none !important;
  }
}
