:root {
  --bg: #140e0c;
  --cream: #f3e6c8;
  --cream-dim: #cbb892;
  --mustard: #e0a15a;
  --cyan: rgba(127, 219, 212, 0.75);
  --magenta: rgba(224, 112, 152, 0.72);
  --display: "Anton", Impact, "Arial Black", sans-serif;
  --thin: "Josefin Sans", "Century Gothic", "Trebuchet MS", sans-serif;
  --mono: "Share Tech Mono", "Courier New", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 75% 55% at 50% 8%, #1c1410 0%, #110e0c 46%, #0c0908 100%);
  color: var(--cream);
  font-family: var(--thin);
  font-weight: 400;
}

::selection {
  background: var(--mustard);
  color: #140e0c;
}

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

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--cream);
  color: #140e0c;
  padding: 0.4rem 0.7rem;
  text-decoration: none;
}

.skip:focus { top: 0.6rem; }

.grain {
  position: fixed;
  inset: -30px;
  z-index: 7;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.column {
  position: relative;
  z-index: 1;
  width: min(100% - 1rem, 42rem);
  margin: 0 auto;
  padding: 0 0 2.75rem;
}

body[data-page="archive"] .column {
  width: min(100% - 1.5rem, 36rem);
  padding-top: 1.25rem;
}

.stage { margin: 0; }

.set {
  position: relative;
  width: 100%;
  aspect-ratio: 1320 / 1110;
  margin: 0 0 0.35rem;
}

.set-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 12px), transparent),
    linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 12px), transparent),
    linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent);
  mask-composite: intersect;
}

.crt {
  position: absolute;
  z-index: 1;
  left: 20.606%;
  top: 38.829%;
  width: 50.606%;
  height: 43.694%;
  border-radius: 4.2% / 5.4%;
  overflow: hidden;
  background: #070605;
  cursor: pointer;
  touch-action: pan-y;
}

.crt video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070605;
}

.vignette,
.glare,
.bug,
.tap,
.crt::after {
  position: absolute;
  pointer-events: none;
}

.vignette {
  inset: 0;
  z-index: 3;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.5) 100%);
}

.glare {
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.04) 18%, transparent 36%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 255, 255, 0.12), transparent 60%);
  mix-blend-mode: screen;
}

.crt::after {
  content: "";
  inset: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0px,
    rgba(0, 0, 0, 0.4) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.2;
  mix-blend-mode: multiply;
}

.bug {
  z-index: 2;
  top: 0.55rem;
  right: 0.65rem;
  display: flex;
  align-items: baseline;
  gap: 0.28rem;
  color: #fff;
  text-shadow:
    0 0 2px #000,
    1px 0 0 #000,
    -1px 0 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000;
}

.bug-ch {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.bug-num {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.4vw, 1.7rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
}

.tap {
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}

.tap[hidden] { display: none; }

.swipe-hint {
  position: absolute;
  z-index: 4;
  top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.85);
}

.swipe-hint[hidden] { display: none; }

.swipe-older { left: 0.5rem; animation: nudge-older 1.6s ease-in-out infinite; }
.swipe-newer { right: 0.5rem; top: 2.15rem; animation: nudge-newer 1.6s ease-in-out infinite; }

.swipe-hint i {
  width: 0.42rem;
  height: 0.42rem;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  filter: drop-shadow(0 0 2px #000);
}

.swipe-older i { transform: rotate(-135deg); }
.swipe-newer i { transform: rotate(45deg); }

@keyframes nudge-older {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(-4px); opacity: 1; }
}

@keyframes nudge-newer {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(4px); opacity: 1; }
}

.set[data-silent] .knob { display: none; }

.knob {
  position: absolute;
  z-index: 2;
  left: calc(80.606% - 22px);
  top: calc(60.721% - 22px);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  height: 62%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 7px 1px rgba(255, 176, 64, 0.95);
  opacity: 0;
  pointer-events: none;
}

.knob[aria-pressed="true"]::after {
  width: 100%;
  height: 100%;
  opacity: 1;
  animation: vol-pulse 1.4s ease-in-out infinite;
}

.knob[aria-pressed="false"]::after {
  opacity: 1;
  animation: none;
}

.vol-hint { color: var(--cream); }

.set:has(.knob[aria-pressed="false"]) ~ .datestamp .vol-hint,
.set[data-silent] ~ .datestamp .vol-hint { display: none; }

@keyframes vol-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 176, 64, 0.2);
    opacity: 0.4;
  }
  50% {
    box-shadow: 0 0 14px 6px rgba(255, 176, 64, 0.95);
    opacity: 1;
  }
}

.steam {
  position: absolute;
  z-index: 2;
  left: 8.3%;
  top: 0;
  width: 17.4%;
  height: 16.2%;
  pointer-events: none;
  overflow: hidden;
}

.steam i {
  position: absolute;
  bottom: 0;
  width: 34%;
  height: 62%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 80%, rgba(232, 232, 232, 0.72), rgba(232, 232, 232, 0) 68%);
  filter: blur(2.4px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: wisp 4.6s ease-in infinite;
}

.steam i:nth-child(1) { left: 22%; }
.steam i:nth-child(2) { left: 42%; height: 78%; animation-delay: -1.5s; animation-duration: 5.4s; }
.steam i:nth-child(3) { left: 58%; width: 24%; animation-delay: -3s; animation-duration: 4.1s; }
.steam i:nth-child(4) { left: 34%; height: 48%; width: 20%; animation-delay: -2.2s; animation-duration: 6s; }

.clock {
  position: absolute;
  z-index: 2;
  left: 49.76%;
  top: 17.85%;
  width: 12.12%;
  height: 14.41%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(#4a4036, #14110e 40%);
  transform-origin: 50% 0;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.65);
}

.hand-hour {
  height: 28%;
  width: 3px;
  transform: translateX(-50%) rotate(20deg);
  animation: creep 72s linear infinite;
}

.hand-minute {
  height: 42%;
  transform: translateX(-50%) rotate(-118deg);
  animation: twitch 6.2s linear infinite;
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #8a8176, #1a1612 62%);
  box-shadow: 0 0 0 1px rgba(40, 32, 24, 0.45);
}

@keyframes wisp {
  0% { transform: translateY(12%) scale(0.65); opacity: 0; }
  16% { opacity: 0.75; }
  100% { transform: translateY(-120%) translateX(8px) scale(1.2); opacity: 0; }
}

@keyframes creep {
  from { transform: translateX(-50%) rotate(20deg); }
  to { transform: translateX(-50%) rotate(380deg); }
}

@keyframes twitch {
  0%, 18% { transform: translateX(-50%) rotate(-118deg); }
  20%, 42% { transform: translateX(-50%) rotate(-94deg); }
  44%, 60% { transform: translateX(-50%) rotate(-132deg); }
  62%, 84% { transform: translateX(-50%) rotate(-76deg); }
  86%, 100% { transform: translateX(-50%) rotate(-118deg); }
}

.crt-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.4rem;
  padding: 1rem;
  text-align: center;
  color: var(--cream);
  cursor: default;
}

.crt-empty p { margin: 0; }

.empty-title {
  font-family: var(--mono);
  letter-spacing: 0.28em;
}

.datestamp {
  margin: 0.95rem 0 0.4rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--mustard);
}

.caption {
  margin: 0 auto;
  max-width: 22em;
  text-align: center;
  font-family: var(--thin);
  font-weight: 400;
  font-size: 1.28rem;
  line-height: 1.35;
  color: var(--cream);
  white-space: pre-line;
  text-wrap: balance;
}

.textlinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin: 1.05rem 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.textlinks a {
  color: var(--mustard);
  text-decoration: none;
}

.textlinks a:hover { text-decoration: underline; }

.share {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.chip {
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(224, 161, 90, 0.5);
  background: transparent;
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chip:hover,
.chip:focus-visible {
  background: rgba(224, 161, 90, 0.14);
  border-color: var(--mustard);
}

.icon {
  width: 14px;
  height: 14px;
  display: block;
}

.about {
  margin: 1.7rem 0 0;
  text-align: center;
  color: var(--cream-dim);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.45;
}

.archive-title {
  margin: 0.2rem 0 0.35rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.archive-note {
  margin: 0 0 0.6rem;
  text-align: center;
  color: var(--cream-dim);
  font-size: 0.95rem;
}

.reels {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reel {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.9rem 0.15rem;
  border-bottom: 1px solid rgba(224, 161, 90, 0.28);
  text-decoration: none;
  color: inherit;
}

.reel:hover,
.reel:focus-visible { background: rgba(224, 161, 90, 0.08); }

.reel-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--mustard);
}

.reel.is-current .reel-date::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  background: var(--mustard);
  box-shadow: 0 0 6px var(--mustard);
  vertical-align: -0.02rem;
}

.reel-quote {
  font-size: 1.08rem;
  line-height: 1.35;
  color: var(--cream);
}

.noscript {
  text-align: center;
  color: var(--cream-dim);
  font-size: 0.9rem;
}

.publish-panel {
  margin-top: 0.4rem;
}

.publish-panel h2,
.publish-log h2 {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

.publish-panel p,
.publish-log p,
.publish-log li {
  color: var(--cream-dim);
  line-height: 1.45;
}

.publish-panel label {
  display: block;
  margin: 0.8rem 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.publish-panel input {
  display: block;
  width: min(100%, 18rem);
  margin: 0 auto;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(224, 161, 90, 0.55);
  background: rgba(12, 9, 8, 0.55);
}

.publish-panel button {
  display: block;
  margin: 0.9rem auto 0;
}

.publish-log ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

@media (min-width: 800px) {
  .column { padding-bottom: 8vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .steam i { animation: none; opacity: 0.4; transform: translateY(-35%); }
  .hand-hour, .hand-minute { animation: none; }
  .knob[aria-pressed="true"]::after { animation: none; opacity: 0.85; }
  .swipe-older, .swipe-newer { animation: none; opacity: 0.9; }
}
