/* The Show Must Go Under — mobile-first, vanilla CSS */

/* ---------- Fonts (self-hosted, SIL OFL — see /assets/fonts/) ---------- */

@font-face {
  font-family: "Bungee";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/bungee-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Bungee";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/bungee-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --bg: #1d2027;
  --panel: rgb(20 18 30 / 0.82);
  --text: #f1eaf7;
  --muted: #c9bcd8;
  --accent: #02ff2b;
  --purple: #c77dff;
  --border: rgb(241 234 247 / 0.85);
  --radius: 6px;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Bungee", "Arial Black", Impact, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", "Segoe UI Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/*
  Background: fixed full-viewport layer. The image is square, so `cover` fits
  its width to the screen in landscape and its height in portrait, cropping
  the overflow around the center. (A fixed layer instead of
  background-attachment: fixed, which iOS Safari ignores.)
*/
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg) url("/assets/images/background.webp") center / cover no-repeat;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

a:hover {
  color: #8dff9e;
}

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

.text-center {
  text-align: center;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--accent);
}

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

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 1.25rem;
  text-align: center;
}

.logo {
  display: block;
  width: min(80vw, 420px);
  border-radius: var(--radius);
}

.logo img {
  display: block;
  width: 100%;
}

.site-nav ul,
.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav ul {
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.25rem 0.125rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.8);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.social {
  gap: 0.75rem;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.35rem;
}

.social img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- Main panel ---------- */

.panel {
  width: min(100% - 1rem, 800px);
  margin: 0 auto;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius);
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-family: var(--font-heading);
  font-weight: 400; /* Bungee has a single weight; avoid faux bold */
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.1rem;
}

/* ---------- Comic ---------- */

.comic-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.comic-nav a,
.comic-nav .is-disabled {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0.4rem;
}

.comic-nav img {
  height: 100%;
  width: auto;
}

.comic-nav .is-disabled {
  opacity: 0.3;
}

.comic {
  margin: 0.5rem 0;
}

.comic img {
  display: block;
  width: 100%;
  margin: 0 auto;
  border: 2px solid var(--border);
}

.comic img + img {
  margin-top: 1rem;
}

.comic-info {
  margin-top: 1.5rem;
}

.comic-meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.author-note {
  padding: 0;
}

.author-note > :first-child {
  margin-top: 0;
}

.author-note > :last-child {
  margin-bottom: 0;
}

.comments {
  margin-top: 2rem;
}

.discuss-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--text);
  background: rgb(38 152 255 / 0.15);
  border: 2px solid #2698ff;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.discuss-button img {
  height: 1.6rem;
  width: auto;
}

.discuss-button:hover {
  color: var(--text);
  background: rgb(38 152 255 / 0.3);
}

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.share-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.share-links a,
.share-links button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0.5rem;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.share-links button[hidden] {
  display: none;
}

.share-links img {
  height: 100%;
  width: auto;
}

.share-links a:hover,
.share-links button:hover {
  background: rgb(255 255 255 / 0.1);
}

.copy-link img {
  height: 75%;
}

.copy-status {
  min-height: 1.6em;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.coming-soon {
  text-align: center;
  font-size: 1.2rem;
}

/* ---------- About ---------- */

.about-banner {
  display: block;
  width: 100%;
  margin-top: 1.5rem; /* breathing room below the About heading */
}

.about-portrait {
  display: block;
  width: min(100%, 320px);
  margin: 0 auto;
}

.about-image {
  display: block;
  /* Half the column width, but never tiny on phones. */
  width: clamp(min(100%, 240px), 50%, 100%);
  margin: 0 auto;
  border-radius: var(--radius);
}

.section-break {
  margin: 2.5rem 0 2rem;
  border: 0;
  border-top: 2px solid var(--border);
  opacity: 0.5;
}

/* ---------- Cast ---------- */

.cast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.cast-portrait {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

/* Console readout: label above value, neon green mono. */
.cast-file {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-shadow: 0 0 6px rgb(2 255 43 / 0.35);
}

.cast-file > div + div {
  margin-top: 0.5rem;
}

.cast-file dt {
  opacity: 0.7;
}

.cast-file dt::after {
  content: " ........";
}

.cast-file dd {
  margin: 0;
}

/* ---------- Archive ---------- */

.chapter {
  margin-bottom: 2rem;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thumb-grid a {
  display: block;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.thumb-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  margin-bottom: 0.25rem;
  border: 2px solid var(--border);
}

.thumb-grid a:hover img {
  border-color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  width: min(100% - 1rem, 800px);
  margin: 1.5rem auto 2rem;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  background: rgb(20 18 30 / 0.7);
  border-radius: var(--radius);
}

.site-footer p {
  margin: 0.5rem 0;
}

/* ---------- Larger screens ---------- */

@media (min-width: 40em) {
  .panel {
    padding: 1.5rem 2rem 2rem;
  }

  .comic-nav {
    gap: 1rem;
  }

  .thumb-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .cast-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }

  .cast-file {
    font-size: 0.8rem;
  }
}
