/* =========
   Theme
   ========= */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #0b0b0b;
  --muted: rgba(0, 0, 0, 0.65);
  --hairline: rgba(0, 0, 0, 0.14);
  --card: rgba(0, 0, 0, 0.03);
  --shadow: rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --maxw: 820px;
  --pad: clamp(18px, 4vw, 36px);
  --gap: clamp(14px, 2.2vw, 22px);
  --font-main: "Courier New", Courier, ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --font-base: 15px;
  --release-col-width: 160px;
  --release-col-bg: rgba(0, 0, 0, 0.02);
  --release-col-hover: rgba(0, 0, 0, 0.08);

  /* drawing preview opacity (set to 0 if you want it invisible) */
  --mask-opacity: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --fg: #f5f5f5;
    --muted: rgba(255, 255, 255, 0.72);
    --hairline: rgba(255, 255, 255, 0.16);
    --card: rgba(255, 255, 255, 0.04);
    --shadow: rgba(0, 0, 0, 0.40);
    --mask-opacity: 0;
    --release-col-bg: rgba(255, 255, 255, 0.04);
    --release-col-hover: rgba(255, 255, 255, 0.10);
  }
}

html.print-theme-light,
body.print-theme-light {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0b0b0b;
  --muted: rgba(0, 0, 0, 0.65);
  --hairline: rgba(0, 0, 0, 0.14);
  --card: rgba(0, 0, 0, 0.03);
  --shadow: rgba(0, 0, 0, 0.08);
  --release-col-bg: rgba(0, 0, 0, 0.02);
  --release-col-hover: rgba(0, 0, 0, 0.08);
}

html.print-theme-dark,
body.print-theme-dark {
  color-scheme: dark;
  --bg: #0b0b0b;
  --fg: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.72);
  --hairline: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.04);
  --shadow: rgba(0, 0, 0, 0.40);
  --release-col-bg: rgba(255, 255, 255, 0.04);
  --release-col-hover: rgba(255, 255, 255, 0.10);
}

/* =========
   Base
   ========= */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-main);
  font-size: var(--font-base);
  line-height: 1.45;
  letter-spacing: 0.2px;
}

body.fx-click-hint {
  cursor: pointer;
}

a {
  color: currentColor;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
a:hover { border-bottom-color: currentColor; }

h1, h2, h3 { margin: 0 0 0.5rem 0; line-height: 1.12; }
p { margin: 0; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========
   Background: mask image layer
   ========= */
.mask-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
  pointer-events: none;
}

.mask-img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  opacity: var(--mask-opacity);
  user-select: none;
  -webkit-user-drag: none;
}

/* =========
   Background: canvas effect
   ========= */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* =========
   Layout (CENTERED)
   ========= */
.wrap {
  position: relative;
  z-index: 2;

  min-height: 100vh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad);

  display: flex;
  flex-direction: column;
  justify-content: center;  /* vertical center */
  align-items: center;
  text-align: center;
  gap: calc(var(--gap) * 1.4);
}

body.fx-click-hint .wrap {
  cursor: auto;
}

.wrap.wrap-top {
  justify-content: flex-start;
  padding-top: var(--pad);
}

.hero,
.section,
.footer {
  width: 100%;
}

.hero.hero-compact h1 {
  font-size: clamp(20px, 3vw, 28px);
}

.hero h1 {
  font-size: clamp(22px, 3.6vw, 34px);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hero-kicker {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.tagline {
  margin-top: 8px;
  font-size: clamp(12px, 1.8vw, 14px);
  color: var(--muted);
}

.hero-summary {
  width: min(100%, 620px);
  margin: 10px auto 0 auto;
  font-size: clamp(14px, 1.9vw, 17px);
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

.hero-structure-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 16px;
}

.hero-structure-link {
  border-bottom: 1px solid transparent;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-structure-link:hover {
  color: var(--fg);
  border-bottom-color: currentColor;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 16px;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-bottom: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
}

.links a:hover {
  border-color: currentColor;
  background: var(--card);
}

.links a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.sound-toggle {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 20;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  color: var(--fg);
  font-family: var(--font-main);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow);
  pointer-events: auto;
  white-space: nowrap;
  max-width: calc(100vw - env(safe-area-inset-right, 0px) - 20px);
}

.sound-toggle:hover {
  border-color: currentColor;
  background: var(--card);
}

.sound-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
  text-align: center;
  align-items: center;
}

.section.section-compact {
  gap: 10px;
}

.section h2 {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  width: 100%;
}

.section-copy {
  width: min(100%, 660px);
  text-align: center;
  text-wrap: balance;
}

.section-actions {
  margin-top: 4px;
}

#releases .section-actions {
  width: 100%;
}

#releases {
  margin-top: 10px;
}

#releases .section-actions .btn {
  width: 100%;
  justify-content: center;
}

.mini-game-shell {
  width: 100%;
  height: clamp(220px, 35vh, 420px);
  min-height: 220px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 8px 30px var(--shadow);
  overflow: hidden;
  position: relative;
}

#mini-game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
}

#mini-game-canvas:active {
  cursor: grabbing;
}

/* =========
   Releases
   ========= */
.release-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.release-list > * {
  flex: 0 0 auto;
}

.release-mode-control {
  --release-mode-progress: 0;
  width: min(100%, 420px);
  margin: 0 auto 6px auto;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  box-shadow: 0 4px 14px var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 8;
}

.release-mode-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.release-mode-label {
  color: var(--muted);
  opacity: 0.65;
  transition: opacity 140ms ease, color 140ms ease;
}

.release-mode-control[data-mode="past"] [data-mode-label="past"],
.release-mode-control[data-mode="upcoming"] [data-mode-label="upcoming"] {
  color: var(--fg);
  opacity: 1;
}

.release-mode-slider {
  width: 100%;
  margin: 0;
  accent-color: currentColor;
}

.release-mode-stage {
  --release-mode-progress: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius);
}

.release-mode-stage-hover {
  cursor: ew-resize;
}

.release-panel {
  position: relative;
  grid-area: 1 / 1;
  width: 100%;
  min-width: 0;
  align-self: start;
  pointer-events: none;
  will-change: opacity, filter, transform;
  transition: opacity 120ms linear, filter 220ms ease, transform 220ms ease;
}

.release-panel.is-interactive {
  pointer-events: auto;
}

.release-panel[data-release-mode="past"] {
  opacity: calc(1 - var(--release-mode-progress));
  filter: blur(calc(var(--release-mode-progress) * 8px));
  transform: translate3d(calc(var(--release-mode-progress) * 1.5%), 0, 0);
}

.release-panel[data-release-mode="upcoming"] {
  opacity: var(--release-mode-progress);
  filter: blur(calc((1 - var(--release-mode-progress)) * 8px));
  transform: translate3d(calc((1 - var(--release-mode-progress)) * -1.5%), 0, 0);
}

.work.release .work-meta {
  background: linear-gradient(
      0deg,
      rgba(0, 0, 0, var(--release-dark, 0)),
      rgba(0, 0, 0, var(--release-dark, 0))
    ),
    var(--card);
}

.work.release.release-has-status.release-upcoming {
  border-color: color-mix(in srgb, currentColor 45%, var(--hairline));
}

.work.release.release-has-status.release-past {
  border-color: var(--hairline);
}

@media (prefers-color-scheme: dark) {
  .work.release .work-meta {
    background: linear-gradient(
        0deg,
        rgba(255, 255, 255, var(--release-light, 0)),
        rgba(255, 255, 255, var(--release-light, 0))
      ),
      var(--card);
  }
}

.release-grid {
  display: grid;
  grid-template-columns: 1fr;
}

body[data-release-page="true"] .release-panel[data-release-mode="past"] .work-meta {
  align-items: flex-start;
  text-align: left;
}

body[data-release-page="true"] .release-panel[data-release-mode="upcoming"] .work-meta {
  align-items: flex-end;
  text-align: right;
}

body[data-release-page="true"] .release-panel .work-meta h3 {
  text-align: inherit;
}

body[data-release-page="true"] .release-panel .work-meta .work-desc {
  text-align: inherit;
  text-justify: auto;
}

body[data-release-page="true"] .release-panel[data-release-mode="past"] .release-secondary {
  justify-content: flex-start;
}

body[data-release-page="true"] .release-panel[data-release-mode="upcoming"] .release-secondary {
  justify-content: flex-end;
}

.release-status {
  align-self: center;
  margin: 0;
  padding: 2px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

.work.release.release-has-status.release-upcoming .release-status {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.work.release.release-has-status.release-past .release-status {
  opacity: 0.75;
}

.research-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.research-column {
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.research-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  text-align: center;
  text-decoration: none;
  color: currentColor;
  font-weight: 600;
  border-bottom: 1px solid var(--hairline);
  background: var(--release-col-bg);
  transition: background 160ms ease, border-color 160ms ease;
  flex: 1 1 auto;
}

.research-link:last-child {
  border-bottom: 0;
}

.research-link:hover {
  background: var(--release-col-hover);
  border-color: currentColor;
}

.research-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.research-link.research-highlight {
  background-image: url("assets/exconv-highlight.png");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  height: auto;
}

.research-link.research-highlight-row {
  border-top: 1px solid var(--hairline);
  border-bottom: 0;
  aspect-ratio: 16 / 9;
  min-height: 160px;
}

.release-column {
  border-top: 1px solid var(--hairline);
  background: var(--release-col-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: currentColor;
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease;
}

.release-column:hover {
  background: var(--release-col-hover);
  border-color: currentColor;
}

.release-column:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.release-card-link {
  display: block;
  border-bottom: 0;
}

.release-card-link .work.release {
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.release-card-link:hover .work.release {
  border-color: currentColor;
  background: var(--release-col-hover);
}

.release-card-link:focus-visible {
  outline: none;
}

.release-card-link:focus-visible .work.release {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.release-focus-flash {
  animation: release-flash 1200ms ease-out 1;
}

@keyframes release-flash {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 38%, transparent);
  }
  35% {
    box-shadow: 0 0 0 9px color-mix(in srgb, currentColor 28%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.release-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  font-size: 11px;
}

.release-secondary-link {
  border-bottom: 1px solid var(--hairline);
}

@media (min-width: 860px) {
  .release-grid {
    grid-template-columns: minmax(0, 1fr) var(--release-col-width);
    align-items: stretch;
  }

  .release-grid.release-grid-full {
    grid-template-columns: 1fr;
  }

  .release-grid.release-grid-spacer::after {
    content: "";
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid var(--hairline);
    background: var(--release-col-bg);
  }

  .release-column {
    border-top: 0;
    border-left: 1px solid var(--hairline);
  }

  body[data-release-page="true"] .release-panel[data-release-mode="past"] .release-grid:not(.release-grid-full) {
    grid-template-columns: var(--release-col-width) minmax(0, 1fr);
  }

  body[data-release-page="true"] .release-panel[data-release-mode="past"] .release-grid:not(.release-grid-full) > .release-column {
    grid-column: 1;
    grid-row: 1;
    border-left: 0;
    border-right: 1px solid var(--hairline);
  }

  body[data-release-page="true"] .release-panel[data-release-mode="past"] .release-grid:not(.release-grid-full) > .work-meta {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-release-page="true"] .release-panel[data-release-mode="past"] .release-grid.release-grid-spacer::after {
    grid-column: 1;
    border-left: 0;
    border-right: 1px solid var(--hairline);
  }

  .research-grid {
    grid-template-columns: minmax(0, 1fr) var(--release-col-width);
    align-items: stretch;
  }

  .research-column {
    border-top: 0;
    border-left: 1px solid var(--hairline);
  }

  .research-link.research-highlight-row {
    border-top: 1px solid var(--hairline);
  }
}

@media (max-width: 720px) {
  body[data-release-page="true"] .release-mode-control {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    left: 50%;
    transform: translateX(-50%);
    width: min(88vw, 340px);
    z-index: 19;
  }

  body[data-release-page="true"] .wrap.wrap-top {
    padding-top: calc(var(--pad) + 116px);
  }
}

/* =========
   Works
   ========= */
.work {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 8px 30px var(--shadow);
  overflow: hidden;
}

.work-meta {
  padding: 16px 16px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 6px;
}

.section p {
  width: 100%;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.hero p,
.section-copy,
.about-copy,
.additional-copy {
  text-align: center;
  text-justify: auto;
  hyphens: none;
}

.work-desc {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.work-meta h3 {
  font-size: 16px;
  color: var(--fg);
  text-align: center;
}

.work-desc {
  font-size: 15px;
  color: var(--muted);
}

.work-participants {
  font-size: 12px;
  color: var(--muted);
}

.work-participants .role {
  color: var(--fg);
  font-weight: 600;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 80px;
  margin-top: 6px;
}

.work-print-links {
  display: none;
}

.highlight-card {
  border-top: 1px solid var(--hairline);
  padding: 12px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.highlight-title {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.highlight-card .btn {
  width: 140px;
  height: 140px;
  padding: 0;
  justify-content: center;
  background-image: url("assets/exconv-highlight.png");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  border-color: transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.highlight-card .btn:hover {
  border-color: transparent;
  filter: brightness(1.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: currentColor;
  font-size: 15px;
  text-decoration: none;
}

.btn:hover {
  border-color: currentColor;
  background: var(--card);
}

.embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-top: 1px solid var(--hairline);
  background: transparent;
}

.embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.vertical-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.video-embed {
  aspect-ratio: auto;
  background: #000;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.video-embed video {
  width: min(100%, 420px);
  height: auto;
  max-height: 80vh;
  display: block;
  object-fit: contain;
}

.audio-embed {
  width: 100%;
  border-top: 1px solid var(--hairline);
  background: transparent;
  padding: 10px 12px;
}

.audio-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  opacity: 0.92;
}

.audio-embed iframe.bandcamp-light {
  display: block;
}

.audio-embed iframe.bandcamp-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .audio-embed iframe.bandcamp-light { display: none; }
  .audio-embed iframe.bandcamp-dark { display: block; }
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========
   Footer
   ========= */
.footer p {
  font-size: 12px;
  color: var(--muted);
}

.secret-video-section {
  width: 100%;
  margin-top: 8px;
}

.secret-video-block {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  position: relative;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 8px 30px var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.secret-video-block:active {
  cursor: grabbing;
}

.secret-video-status {
  margin: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.secret-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-top: 1px solid var(--hairline);
  padding-top: 10px;
}

.secret-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.secret-video-block.is-unlocked {
  border-style: solid;
}

.secret-video-block.is-unlocked .secret-video-status {
  display: none !important;
}

.print-mode .sound-toggle {
  display: none !important;
}

.print-mode .hero,
.print-mode .footer,
.print-mode .embed,
.print-mode .video-embed,
.print-mode .audio-embed,
.print-mode .secret-video-section,
.print-mode .mini-game-shell {
  display: none !important;
}

.print-mode .wrap {
  min-height: auto;
  max-width: none;
  padding: 0;
  gap: 12px;
  align-items: stretch;
}

.print-mode .wrap.wrap-top {
  padding-top: 0;
}

.print-mode .hero {
  display: grid !important;
  justify-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--hairline);
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-mode .hero h1 {
  margin: 0;
  font-size: 26px;
}

.print-mode .hero-summary {
  display: none !important;
}

.print-mode .hero-structure-links {
  margin-top: 2px;
  gap: 6px 12px;
}

.print-mode .hero-structure-link {
  color: var(--muted);
  border-bottom-color: transparent;
}

.print-mode .section {
  gap: 8px;
  padding-top: 0;
  align-items: stretch;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-mode #releases {
  break-inside: auto;
  page-break-inside: auto;
}

.print-mode .release-list {
  gap: 10px;
}

.print-mode #releases .section-actions {
  display: none !important;
}

.print-mode .work,
.print-mode .release-card-link,
.print-mode .release-grid,
.print-mode .release-panel,
.print-mode .research-item,
.print-mode .highlight-card {
  break-inside: avoid;
  page-break-inside: avoid;
  box-shadow: none;
}

.print-mode .research-link,
.print-mode .release-column {
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-mode .work-meta {
  padding: 12px 14px 10px;
}

.print-mode .work-print-links {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.print-mode .work-print-link-row {
  display: grid;
  gap: 2px;
}

.print-mode .work-print-link-label {
  color: var(--fg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.print-mode .work-print-links a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  border-bottom: 0;
  word-break: break-all;
}

.print-mode .work-actions {
  gap: 16px;
}

.print-secret-video-hidden #additional {
  display: none !important;
}

@media print {
  @page {
    margin: 6mm;
  }

  html,
  body {
    height: auto !important;
    background: var(--bg) !important;
    color: var(--fg) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    padding: 6mm !important;
    box-sizing: border-box;
  }

  #fx {
    display: none !important;
  }

  .print-include-fx #fx {
    display: block !important;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
  }

  .wrap {
    min-height: auto;
    max-width: none;
    padding: 0 !important;
    gap: 12px;
    align-items: stretch;
  }

  .wrap.wrap-top {
    padding-top: 0 !important;
  }

  .hero,
  .footer,
  .sound-toggle,
  .embed,
  .video-embed,
  .audio-embed,
  .secret-video-section,
  .mini-game-shell {
    display: none !important;
  }

  .hero {
    display: grid !important;
    justify-items: center;
    gap: 6px;
    margin: 0 0 6px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--hairline);
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .hero h1 {
    margin: 0;
    font-size: 26px;
  }

  .hero-summary {
    display: none !important;
  }

  .hero-structure-links {
    margin-top: 2px;
    gap: 6px 12px;
  }

  .hero-structure-link {
    color: var(--muted);
    border-bottom-color: transparent;
  }

  .section {
    gap: 8px;
    padding-top: 0;
    align-items: stretch;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #releases {
    break-inside: auto;
    page-break-inside: auto;
  }

  .release-list {
    gap: 10px;
  }

  #releases .section-actions {
    display: none !important;
  }

  .work,
  .release-card-link,
  .release-grid,
  .release-panel,
  .research-item,
  .highlight-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
  }

  .research-link,
  .release-column {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .work-meta {
    padding: 12px 14px 10px;
  }

  .work-print-links {
    display: grid;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--hairline);
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
  }

  .work-print-link-row {
    display: grid;
    gap: 2px;
  }

  .work-print-link-label {
    color: var(--fg);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .work-print-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    border-bottom: 0;
    word-break: break-all;
  }

  .work-actions {
    gap: 16px;
  }

  .print-secret-video-hidden #additional,
  .print-secret-video-hidden .secret-video-section,
  .print-secret-video-hidden .secret-video-block {
    display: none !important;
  }
}

/* =========
   Reduced motion: keep everything calm
   ========= */
@media (prefers-reduced-motion: reduce) {
  .work { box-shadow: none; }
  .release-focus-flash { animation: none; }
  .release-panel {
    transition: none;
    filter: none !important;
    transform: none !important;
  }
}
.back-actions {
  margin-top: 0;
  margin-bottom: 4px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: 4px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.back-link {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
  padding: 4px 0;
}

.back-link:hover {
  border-bottom-color: currentColor;
}
