:root {
  --bg: #070614;
  --ink: #f7f2ff;
  --muted: #b9add6;
  --faint: #8a7ea8;
  --fluxer: #4641d9;
  --fluxer-2: #7a75ff;
  --love: #ff6b9d;
  --love-2: #ffd0e0;
  --gold: #e7c27a;
  --paper: #fff6ea;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --radius: 18px;
  --header-h: 4.4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--love-2);
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
}

kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05em 0.4em;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  background: var(--gold);
  color: #1a1208;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}

.skip-link:focus {
  top: 0.8rem;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 85% 0%, rgba(70, 65, 217, 0.38), transparent 58%),
    radial-gradient(700px 420px at 8% 90%, rgba(255, 107, 157, 0.14), transparent 50%),
    url("/assets/atmosphere.jpg") center / cover no-repeat,
    #070614;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 6, 20, 0.28), rgba(7, 6, 20, 0.78) 62%, #070614);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/></svg>");
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.7rem 1.1rem;
  background: linear-gradient(180deg, rgba(7, 6, 20, 0.86), rgba(7, 6, 20, 0.55) 70%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  color: var(--love);
  display: grid;
  place-items: center;
  animation: beat 1.8s ease-in-out infinite;
}

.brand-dot {
  color: var(--love);
}

.brand-name {
  font-size: 1.05rem;
}

.modes {
  display: flex;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.modes a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}

.modes a[aria-selected="true"] {
  color: var(--bg);
  background: var(--ink);
}

.player {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 28rem;
  padding: 0.28rem 0.45rem 0.28rem 0.28rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 10, 28, 0.72);
}

.player-meta {
  min-width: 0;
  flex: 1;
}

.player-title {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--love-2);
}

.seek,
.vol input,
.slide-speed input {
  width: 100%;
  accent-color: var(--love);
}

.vol {
  width: 4.2rem;
  display: none;
}

.icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn.play {
  background: var(--love);
  color: #2a1018;
}

.player:not(.is-playing) .i-pause,
.player.is-playing .i-play,
.view-slideshow:not(.is-playing) .i-pause,
.view-slideshow.is-playing .i-play {
  display: none;
}

.hero {
  width: min(920px, calc(100% - 2.2rem));
  margin: 2.2rem auto 1.2rem;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--love);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.18);
}

.hero h1 {
  margin: 0.85rem 0 0.7rem;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 12vw, 7.4rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.05em;
}

.hero h1 em {
  font-style: italic;
  color: var(--love);
}

.hero h1 .flux {
  display: block;
  background: linear-gradient(120deg, #d9d6ff 10%, var(--fluxer-2), var(--love));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn-love {
  background: var(--love);
  color: #2a1018;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.tally {
  margin-top: 1rem;
  color: var(--faint);
  font-size: 0.92rem;
}

.film-wrap,
.wall-wrap {
  position: relative;
  margin-top: 1.5rem;
}

.film-head {
  width: min(1100px, calc(100% - 2.2rem));
  margin: 0 auto 0.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.film-head h2,
.story-card h2,
.help h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
}

.film-head p {
  color: var(--faint);
}

.film-controls {
  position: absolute;
  right: 1.2rem;
  top: 0.1rem;
  display: flex;
  gap: 0.3rem;
}

.filmstrip {
  display: flex;
  gap: 1.15rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1.2rem max(1.1rem, 8vw) 2.4rem;
  scrollbar-color: var(--fluxer-2) transparent;
}

.polaroid {
  flex: 0 0 auto;
  width: min(78vw, 300px);
  scroll-snap-align: center;
  background: var(--paper);
  color: #2a2218;
  padding: 0.72rem 0.72rem 2.15rem;
  border-radius: 3px 3px 7px 7px;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, -1.4deg));
  text-align: left;
  text-decoration: none;
  transition: transform 220ms var(--ease);
}

.polaroid:nth-child(even) {
  --tilt: 1.7deg;
}

.polaroid:nth-child(3n) {
  --tilt: -0.5deg;
}

.polaroid:hover,
.polaroid:focus-visible {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #1b1730;
}

.polaroid-cap {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #ffd18a;
  color: #5a3a08;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

.story {
  width: min(1100px, calc(100% - 2.2rem));
  margin: 1.2rem auto 2rem;
  display: grid;
  gap: 1.1rem;
}

.story-card,
.story-aside {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  padding: 1.4rem 1.5rem;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-card p + p {
  margin-top: 0.85rem;
}

.story-card p {
  color: var(--muted);
  font-size: 1.05rem;
}

blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic;
  line-height: 1.15;
}

blockquote cite {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-style: normal;
  color: var(--faint);
}

.stamp {
  margin: 1.2rem 0;
  display: inline-block;
  padding: 0.55rem 0.8rem;
  border: 2px solid #ff6b9d;
  color: #ff8fb3;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-6deg);
}

.aside-note {
  color: var(--muted);
}

.wall {
  width: min(1200px, calc(100% - 2.2rem));
  margin: 0 auto 2rem;
  columns: 260px 4;
  column-gap: 0.9rem;
}

.tile {
  break-inside: avoid;
  margin: 0 0 0.9rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}

.tile img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #120c22;
}

.tile-cap {
  display: block;
  margin-top: 0.35rem;
  color: var(--faint);
  font-size: 0.8rem;
}

.empty {
  width: min(720px, calc(100% - 2.2rem));
  margin: 1rem auto 2rem;
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  color: var(--muted);
  text-align: center;
}

.view-browse {
  width: min(1200px, calc(100% - 2.2rem));
  margin: 1rem auto 3rem;
}

.browse-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.crumbs a,
.crumbs span {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}

.crumbs a:hover {
  color: var(--ink);
}

.browse-tools {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.browse-tools select {
  background: #120c22;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}

.folder-card,
.file-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 8.5rem;
  padding: 0.8rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}

.folder-card {
  background: linear-gradient(180deg, rgba(231, 194, 122, 0.12), rgba(255, 255, 255, 0.03));
}

.folder-card strong,
.file-card strong {
  font-size: 0.92rem;
}

.folder-card span,
.file-card span {
  color: var(--faint);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  background: #120c22;
}

.view-slideshow {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.slide-stage {
  position: relative;
  flex: 1;
  min-height: 42dvh;
  margin: 0 1rem;
  overflow: hidden;
  border-radius: 1.2rem;
  background: #07060f;
}

.slide-stage img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 520ms ease;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

.slide-stage img.is-on {
  opacity: 1;
}

.slide-stage img.ken {
  animation: ken 14s ease-in-out alternate infinite;
}

.slide-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.slide-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem 1.1rem;
}

.slide-caption {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.slide-speed {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--faint);
  font-size: 0.8rem;
}

.slide-speed input {
  width: 6rem;
}

.progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--fluxer-2), var(--love));
}

.foot {
  width: min(900px, calc(100% - 2.2rem));
  margin: 0 auto 2.5rem;
  padding: 1.2rem 0 2rem;
  color: var(--faint);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}

.foot p + p {
  margin-top: 0.7rem;
}

.foot strong {
  color: var(--muted);
  font-weight: 650;
}

.lightbox[open] {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: rgba(5, 4, 14, 0.96);
  color: var(--ink);
}

.lightbox::backdrop {
  background: rgba(5, 4, 14, 0.92);
}

.lightbox img {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.lightbox-cap {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.7rem 4.5rem 1.1rem;
  color: var(--muted);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  top: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

.lb-close {
  right: 1rem;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev {
  left: 1rem;
}

.lb-next {
  right: 1rem;
}

.help {
  width: min(28rem, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: #120c22;
  color: var(--ink);
  padding: 1.2rem;
}

.help ul {
  padding-left: 1.1rem;
  color: var(--muted);
}

.help li + li {
  margin-top: 0.35rem;
}

.page-404 {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.page-404 h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 10vw, 6rem);
}

@keyframes beat {
  0%,
  100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.12);
  }
}

@keyframes ken {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

@media (min-width: 820px) {
  .story {
    grid-template-columns: 1.4fr 0.9fr;
  }

  .vol {
    display: block;
  }

  .player {
    min-width: 22rem;
  }
}

@media (max-width: 819px) {
  .top {
    flex-wrap: wrap;
    padding-bottom: 0.4rem;
  }

  .modes {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .modes a {
    flex: 1;
    text-align: center;
  }

  .player {
    max-width: none;
    flex: 1;
  }

  .film-controls {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3rem, 18vw, 4.8rem);
  }

  .foot {
    margin-bottom: 1.5rem;
  }

  .film-head {
    flex-direction: column;
    gap: 0.25rem;
  }

  :root {
    --header-h: 7.1rem;
  }

  .slide-speed {
    display: none;
  }

  .slide-stage img {
    filter: none;
  }

  .slide-stage img.ken {
    animation: none;
  }
}

body[data-mode="slideshow"] {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body[data-mode="slideshow"] #main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body[data-mode="slideshow"] .foot {
  margin-bottom: 1rem;
}

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

  .brand-mark,
  .slide-stage img.ken {
    animation: none;
  }

  .polaroid,
  .slide-stage img {
    transition: none;
  }
}
