/* Zane's Life: site styles
   Colors are defined once as "tokens" below. Change them here to restyle the whole site. */

@font-face {
  font-family: "Bangers";
  src: url("fonts/bangers.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Light theme (default) ---- */
:root {
  --bg: #fff7ee;
  --bg-dots: rgba(242, 96, 12, 0.10);
  --surface: #ffffff;
  --surface-2: #fff0e0;
  --text: #1a2140;
  --muted: #5b6482;
  --line: #1a2140;          /* comic-panel outlines */
  --shade: #1a2140;         /* offset "sticker" shadows */
  --soft-line: #f0dcc6;
  --accent: #ff7a1a;        /* sunrise orange */
  --accent-2: #ffc53d;      /* yellow highlight */
  --on-accent: #1a2140;
  --link: #c2410c;
  --reader-bg: #ece3d8;
  --radius: 16px;
  --font-display: "Bangers", "Impact", "Arial Black", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* ---- Dark theme: follows the device setting, unless the reader picked a theme ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1022;
    --bg-dots: rgba(255, 138, 51, 0.07);
    --surface: #151d3a;
    --surface-2: #1b2547;
    --text: #eef0f7;
    --muted: #a2abc8;
    --line: #03050c;
    --shade: #000000;
    --soft-line: #26305a;
    --accent: #ff8a33;
    --accent-2: #ffc53d;
    --on-accent: #1a1206;
    --link: #ffa45c;
    --reader-bg: #05070f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1022;
  --bg-dots: rgba(255, 138, 51, 0.07);
  --surface: #151d3a;
  --surface-2: #1b2547;
  --text: #eef0f7;
  --muted: #a2abc8;
  --line: #03050c;
  --shade: #000000;
  --soft-line: #26305a;
  --accent: #ff8a33;
  --accent-2: #ffc53d;
  --on-accent: #1a1206;
  --link: #ffa45c;
  --reader-bg: #05070f;
  color-scheme: dark;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h1, h2, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.03em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--accent); color: var(--on-accent); border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 0.4rem; color: var(--link); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }

/* ---- Buttons (comic sticker style) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; padding: 0.6rem 1.15rem;
  border: 2.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-weight: 800; font-size: 0.95rem; text-decoration: none; line-height: 1.2; text-align: center;
  box-shadow: 3px 3px 0 var(--shade);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shade); text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shade); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--lg { min-height: 52px; padding: 0.75rem 1.6rem; font-size: 1.05rem; }
.btn.is-disabled { opacity: 0.4; pointer-events: none; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.25rem 0; }

/* ---- Header ---- */
.site-header { border-bottom: 2.5px solid var(--line); background: var(--surface); }
.site-header__inner { display: flex; align-items: center; gap: 8px 20px; min-height: 64px; flex-wrap: wrap; }
.logo {
  font-family: var(--font-display); font-size: 1.65rem; letter-spacing: 0.04em; line-height: 1;
  color: var(--text); text-decoration: none; margin-right: auto;
  text-shadow: 2px 2px 0 var(--accent);
}
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 700;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 2.5px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--text);
  cursor: pointer; box-shadow: 2px 2px 0 var(--shade);
}
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 560px) {
  .site-header__inner { padding-block: 10px 6px; }
  .site-nav { order: 3; width: 100%; justify-content: space-between; }
  .site-nav a { flex: 1; text-align: center; padding: 8px 6px; }
}

/* ---- Hero (home) ---- */
.hero {
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1.6px, transparent 1.7px);
  background-size: 14px 14px;
  border-bottom: 2.5px solid var(--line);
}
.hero__inner {
  display: grid; gap: clamp(24px, 5vw, 56px); align-items: center;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  padding-block: clamp(32px, 7vw, 72px);
}
.hero__cover img {
  width: 100%; border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--shade); transform: rotate(-2deg); background: var(--surface-2);
}
.display { font-size: clamp(3rem, 11vw, 5.5rem); line-height: 0.95; margin: 0 0 0.25em; text-shadow: 4px 4px 0 var(--accent); }
.hero__meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
@media (max-width: 760px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__cover { max-width: 260px; margin-inline: auto; }
  .hero .lead { margin-inline: auto; }
  .hero .actions { justify-content: center; }
}

/* ---- Sections ---- */
.section { padding-block: clamp(32px, 6vw, 56px); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.section__head h2 { margin: 0; }
.section__head a { font-weight: 700; }
.page-head { margin-bottom: 1.75rem; }

/* ---- Chapter cards ---- */
.chapter-grid { display: grid; gap: clamp(16px, 3vw, 24px); grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); }
.chapter-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chapter-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shade); }
.chapter-card__thumb { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--surface-2); border-bottom: 2.5px solid var(--line); }
.chapter-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.chapter-card__body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.chapter-card__num { color: var(--link); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.chapter-card__title { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.chapter-card__desc { color: var(--muted); margin: 6px 0; }
.chapter-card__meta { color: var(--muted); font-size: 0.85rem; margin-top: auto; padding-top: 4px; }
.chapter-card--wide { flex-direction: row; max-width: 760px; }
.chapter-card--wide .chapter-card__thumb { flex: 0 0 clamp(120px, 30%, 200px); border-bottom: 0; border-right: 2.5px solid var(--line); }
.chapter-card--wide .chapter-card__body { padding: clamp(14px, 3vw, 22px); }
.chapter-card--wide .chapter-card__title { font-size: 1.35rem; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 2px 10px;
  background: var(--accent-2); color: #1a2140; border: 2px solid #1a2140; border-radius: 999px;
  font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.05em; transform: rotate(-4deg);
}

/* ---- Speech bubble + teaser ---- */
.bubble {
  position: relative; display: inline-block; margin: 0 0 1.25rem; padding: 0.5rem 1.25rem;
  background: var(--surface); color: var(--text); border: 3px solid var(--line); border-radius: 24px;
  font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.25rem); letter-spacing: 0.04em;
}
.bubble::after {
  content: ""; position: absolute; left: 28px; bottom: -16px; width: 22px; height: 22px;
  background: var(--surface); border-right: 3px solid var(--line); border-bottom: 3px solid var(--line);
  transform: skewY(35deg) rotate(10deg);
}
.teaser {
  padding: clamp(24px, 5vw, 40px); border: 3px dashed var(--soft-line); border-radius: var(--radius);
  background: var(--surface-2); max-width: 760px;
}
.teaser p:not(.bubble) { color: var(--muted); max-width: 55ch; }
.teaser--big { text-align: center; margin-inline: auto; }
.teaser--big .bubble::after { left: calc(50% - 11px); }
.teaser--big p:not(.bubble) { margin-inline: auto; }

/* ---- Reader ---- */
.page-reader main { background: var(--reader-bg); }
.reader__head { padding-block: clamp(24px, 5vw, 40px) 8px; text-align: center; }
.reader__head h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.reader__meta { color: var(--muted); font-size: 0.9rem; }
.reader__desc { max-width: 60ch; margin-inline: auto; color: var(--muted); }
.reader__pages { max-width: 800px; margin-inline: auto; background: var(--surface); box-shadow: 0 0 0 1px var(--soft-line); }
.reader__page { width: 100%; height: auto; background: var(--surface-2); }
.reader__end { text-align: center; padding-block: 36px 8px; }
.reader__end-title { font-family: var(--font-display); font-size: 2rem; letter-spacing: 0.04em; margin-bottom: 0.75rem; }
.reader__end p:not(.reader__end-title) { color: var(--muted); }
.chapter-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; max-width: 800px; margin: 16px auto 24px; }
.chapter-nav .btn { flex: 1; max-width: 220px; }
.show-sm { display: none; }
@media (max-width: 480px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .chapter-nav .btn { padding-inline: 0.6rem; }
}
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 50; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---- Ads ----
   Ad boxes reserve their space so the page doesn't jump when an ad loads. */
.ad-wrap:empty { display: none; }
.ad { display: block; text-align: center; margin: 16px auto; }
.ad__label { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad--header, .ad--footer { min-height: 100px; }
.reader__pages .ad { margin: 0; padding: 16px; min-height: 280px; background: var(--reader-bg); }
.ad--placeholder {
  display: grid; place-items: center; min-height: 100px; border: 2px dashed var(--muted); border-radius: 12px;
  color: var(--muted); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.reader__pages .ad--placeholder { border-radius: 0; min-height: 250px; }

/* ---- Episodes ---- */
.episodes { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.episodes--single { grid-template-columns: minmax(0, 640px); }
.episode { background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 4px 4px 0 var(--shade); scroll-margin-top: 16px; }
.yt { position: relative; aspect-ratio: 16 / 9; background: #000; border-bottom: 2.5px solid var(--line); }
.yt__link, .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt__link img { width: 100%; height: 100%; object-fit: cover; }
.yt__play { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); transition: transform .15s ease; }
.yt__link:hover .yt__play { transform: scale(1.08); }
.episode__body { padding: 14px 18px 18px; }
.episode__num { margin: 0; color: var(--link); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.episode__title { font-family: var(--font-body); font-weight: 800; font-size: 1.2rem; letter-spacing: 0; margin: 2px 0 4px; }
.episode__meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.episode__desc { margin: 0; }

/* ---- Text pages (About, Contact, Privacy) ---- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.link-list { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 10px; }
.link-list a { display: inline-block; padding: 6px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; }
.contact-email { font-size: 1.25rem; font-weight: 800; word-break: break-all; }
.notfound { text-align: center; }
.notfound .actions { justify-content: center; }
.notfound .bubble::after { left: calc(50% - 11px); }

/* ---- Footer ---- */
.site-footer { border-top: 2.5px solid var(--line); background: var(--surface); padding-block: 28px; margin-top: auto; }
.site-footer__inner { display: grid; gap: 14px; }
.site-footer__brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0; }
.site-footer__brand .logo { margin: 0; font-size: 1.4rem; }
.site-footer__brand span { color: var(--muted); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer__nav a { color: var(--text); font-weight: 600; }
.site-footer__copy { color: var(--muted); font-size: 0.85rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .hero__cover img { transform: none; }
}
