/* Glossarion site — shared styles for the landing page and the help pages */

:root {
  --bg: #fff9fa;
  --bg-alt: #fdf0f3;
  --surface: #ffffff;
  --surface-2: #f7eef2;
  --ink: #2a2233;
  --ink-soft: #4a4155;
  --muted: #6e6479;
  --line: #eadde4;
  --accent: #c2475f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe1e7;
  --plum: #5b4468;
  --plum-soft: #ece4f1;
  --navy: #33405e;
  --ok: #2f7d5b;
  --ok-soft: #dff1e8;
  --warn: #9a6512;
  --warn-soft: #fbefd9;
  --shadow: 0 1px 2px rgba(60, 30, 50, .06), 0 8px 24px rgba(60, 30, 50, .07);
  --shadow-lg: 0 2px 4px rgba(60, 30, 50, .06), 0 24px 60px rgba(60, 30, 50, .12);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15111a;
    --bg-alt: #1b1622;
    --surface: #211b29;
    --surface-2: #2a2333;
    --ink: #f4eef6;
    --ink-soft: #d9d0de;
    --muted: #a99fb4;
    --line: #362d40;
    --accent: #f08da0;
    --accent-ink: #2a1019;
    --accent-soft: #3a2230;
    --plum: #c9b3d8;
    --plum-soft: #2f2639;
    --navy: #b9c4e2;
    --ok: #7fd4a9;
    --ok-soft: #1e3329;
    --warn: #f0c272;
    --warn-soft: #3a2f1b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #15111a;
  --bg-alt: #1b1622;
  --surface: #211b29;
  --surface-2: #2a2333;
  --ink: #f4eef6;
  --ink-soft: #d9d0de;
  --muted: #a99fb4;
  --line: #362d40;
  --accent: #f08da0;
  --accent-ink: #2a1019;
  --accent-soft: #3a2230;
  --plum: #c9b3d8;
  --plum-soft: #2f2639;
  --navy: #b9c4e2;
  --ok: #7fd4a9;
  --ok-soft: #1e3329;
  --warn: #f0c272;
  --warn-soft: #3a2f1b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .08em .38em; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); }
.nav { display: none; margin-left: auto; gap: 4px; align-items: center; }
.nav a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); text-decoration: none; }
/* the landing page's eight links only just fit beside the brand at the narrowest desktop widths */
@media (max-width: 1060px) { .nav { gap: 0; } .nav a { padding: 8px 9px; font-size: .92rem; } }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav + .header-actions { margin-left: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-btn { display: inline-grid; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
}
.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 12px 16px; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .mobile-nav, .mobile-nav.open { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: .98rem; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn small { font-weight: 600; opacity: .75; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 48px 0 36px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 120%; z-index: -1;
  background:
    radial-gradient(600px 380px at 82% 30%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(520px 340px at 8% 10%, color-mix(in srgb, var(--plum) 16%, transparent), transparent 70%);
}
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 56px; } .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 40px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: .85rem; font-weight: 600;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); margin-left: 4px; }
.hero h1 { font-size: clamp(2.3rem, 6.4vw, 4rem); font-weight: 800; margin: 18px 0 16px; letter-spacing: -.035em; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--plum));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: 1.14rem; color: var(--ink-soft); max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.hero-note { color: var(--muted); font-size: .9rem; margin: 0; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: .88rem; font-weight: 600;
}
.chip svg { width: 16px; height: 16px; }
a.chip { transition: background .15s ease, color .15s ease, border-color .15s ease; }
a.chip:hover { text-decoration: none; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-art .halo {
  position: absolute; width: min(420px, 86%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--accent-soft), transparent 68%);
}
.hero-art img { position: relative; width: min(420px, 82%); filter: drop-shadow(0 24px 40px rgba(80, 30, 60, .22)); }
.float-card {
  position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 12px; font-size: .8rem; color: var(--ink-soft); display: none;
}
@media (min-width: 560px) { .float-card { display: block; } }
.float-card b { color: var(--ink); display: block; font-size: .86rem; }
.float-card { max-width: 200px; }
/* keep both cards below the shoulders and out to the sides, clear of the mascot's face */
.float-card.fc1 { left: 0; bottom: 24%; }
.float-card.fc2 { right: 0; bottom: 4%; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 30px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.4rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .86rem; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 84px 0; } }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); font-weight: 800; }
.section-head p { color: var(--ink-soft); font-size: 1.06rem; }
.kicker { display: inline-block; color: var(--accent); font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }

/* steps */
.steps { display: grid; gap: 14px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.step .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .9rem; margin-bottom: 12px; }
.step h3 { font-size: 1.08rem; }
.step p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* feature rows */
.feature { display: grid; gap: 26px; align-items: center; padding: 28px 0; }
.feature > *, .hero-grid > *, .steps > *, .grid-cards > *, .free-grid > *, .platforms > * { min-width: 0; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 56px; padding: 40px 0; }
  .feature.flip .feature-copy { order: 2; }
}
.feature-copy h3 { font-size: clamp(1.45rem, 3.2vw, 1.95rem); font-weight: 800; }
.feature-copy > p { color: var(--ink-soft); font-size: 1.04rem; }
.feature-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--plum); background: var(--plum-soft); font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
.ticks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-soft); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .28em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232f7d5b'%3E%3Cpath d='M8.2 13.4 4.8 10l-1.1 1.1 4.5 4.5 8.2-8.2-1.1-1.1z'/%3E%3C/svg%3E") center/14px no-repeat;
}
.platform-line { margin-top: 14px; font-size: .85rem; color: var(--muted); }

/* small UI bits (hero progress bar, CTA row) */
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--plum)); }

/* real screenshots */
.shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: #1e1e1e; }
.shot a, .shot img { display: block; width: 100%; }
.shot a { cursor: zoom-in; }
.shot figcaption { font-size: .82rem; color: var(--muted); padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.shot-stack { display: grid; gap: 14px; }
.with-phone { position: relative; padding-bottom: 28px; }
.with-phone .phone { position: absolute; right: -6px; bottom: 0; width: 30%; max-width: 190px; }
.with-phone .shot figcaption { padding-right: min(34%, 210px); }
@media (max-width: 560px) { .with-phone .phone { width: 34%; right: 0; } }
.phone { margin: 0; border-radius: 26px; border: 7px solid #1b1720; background: #1b1720; overflow: hidden; box-shadow: var(--shadow-lg); }
.phone img { display: block; width: 100%; border-radius: 19px; }

/* manga before / after slider */
.compare { margin: 0; }
.compare-box { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--surface-2); touch-action: pan-y; }
.compare-box img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.compare-box .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare-box .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px; background: var(--accent); pointer-events: none; }
/* Only the knob drags on touch screens, so swiping over the image scrolls the page. */
.compare-box .knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow); pointer-events: auto; cursor: ew-resize; touch-action: none; user-select: none; }
/* the range stays for keyboard and screen readers; pointers are handled in site.js */
.compare-box input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; pointer-events: none; }
.compare-box:has(input:focus-visible) .knob { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .compare-box { cursor: ew-resize; } }
.compare-box .tag { position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: rgba(20, 16, 26, .78); color: #fff; pointer-events: none; }
.compare-box .tag.l { left: 10px; } .compare-box .tag.r { right: 10px; }
.compare-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.compare-steps button { font: inherit; font-size: .82rem; font-weight: 700; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.compare-steps button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.compare figcaption { font-size: .82rem; color: var(--muted); margin-top: 8px; text-align: center; }

.compare-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.compare-tabs button { font: inherit; font-size: .86rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; }
.compare-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
/* a tall webtoon strip scrolls inside a window shorter than the screen; at either end of the strip the
   swipe carries on to the page (no overscroll containment), so a phone can always scroll past it */
.compare-scroll { --strip-h: min(640px, 65vh); max-height: var(--strip-h); overflow-y: auto; overscroll-behavior-y: auto; border-radius: 14px; box-shadow: var(--shadow-lg); }
.compare-scroll .compare-box { box-shadow: none; overflow: clip; }  /* clip, not hidden: hidden would capture the sticky knob */
/* in the tall webtoon the knob stays in view while the strip scrolls */
.compare-tall .compare-box .knob { position: sticky; top: calc(var(--strip-h) / 2 - 22px); left: auto; transform: none; margin-left: -20.5px; }

/* phone gallery */
.phones { display: flex; gap: 18px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.phones figure { margin: 0; flex: 0 0 auto; width: min(220px, 62vw); scroll-snap-align: start; }
.phones figcaption { margin-top: 10px; font-size: .86rem; color: var(--ink-soft); text-align: center; }
.phones figcaption b { display: block; color: var(--ink); }
.phone-note { text-align: center; color: var(--muted); font-size: .9rem; margin: 6px auto 0; max-width: 46em; }

/* desktop gallery */
.gallery { display: grid; gap: 16px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery .shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
/* the manga walkthrough: four steps in one row on wide screens */
.gallery.gallery-2 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .gallery.gallery-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gallery.gallery-2 { grid-template-columns: repeat(4, 1fr); } }
.gallery-2 .shot { display: flex; flex-direction: column; }
.gallery-2 .shot figcaption { flex: 1; }

/* compact feature grid */
.grid-cards { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 1.04rem; display: flex; align-items: center; gap: 10px; }
.card h3 .ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); font-size: 1.05rem; flex: none; }
.card p { color: var(--ink-soft); font-size: .94rem; margin: 0; }

/* free / cost block */
.free-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .free-grid { grid-template-columns: repeat(3, 1fr); } }
.free-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.free-card .price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 2px; }
.free-card .price small { font-size: .95rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.free-card p { color: var(--ink-soft); font-size: .95rem; }
.free-card code { font-size: .8em; }
.free-card.highlight { border: 2px solid var(--accent); }

/* platforms */
.platforms { display: grid; gap: 14px; }
@media (min-width: 640px) { .platforms { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .platforms { grid-template-columns: repeat(5, 1fr); } }
.platform { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.platform.current { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.platform .os { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; }
.platform .os svg { width: 26px; height: 26px; color: var(--ink); }
.platform p { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.platform .files { display: grid; gap: 6px; margin-top: auto; }
.platform .files a { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .86rem; font-weight: 700; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.platform .files a:hover { text-decoration: none; background: var(--accent-soft); color: var(--accent); }
.platform .files a span { color: var(--muted); font-weight: 600; font-size: .78rem; }
.release-line { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 18px; }

/* providers */
.providers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 980px; margin: 0 auto; }
.providers span { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.providers span.hl { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
details[open] { box-shadow: var(--shadow); }
summary { cursor: pointer; list-style: none; font-weight: 700; padding: 14px 28px 14px 0; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 1.4rem; font-weight: 500; color: var(--muted); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { color: var(--ink-soft); padding-bottom: 14px; }
details > div p:last-child { margin-bottom: 0; }

/* CTA */
.cta { position: relative; border-radius: 28px; padding: 40px 24px; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--plum-soft)); border: 1px solid var(--line); }
.cta h2 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); font-weight: 800; }
.cta p { color: var(--ink-soft); max-width: 40em; margin: 0 auto 22px; }
.cta .row { justify-content: center; flex-wrap: wrap; }
.cta img { width: 120px; margin: 0 auto 10px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 28px; color: var(--muted); font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink-soft); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Help pages ---------- */
.help { display: grid; gap: 28px; padding-top: 32px; padding-bottom: 64px; }
.help > * { min-width: 0; }
@media (min-width: 960px) { .help { grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 44px; } }
.help-side { font-size: .93rem; }
@media (min-width: 960px) { .help-side { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; } }
.help-side h5 { margin: 18px 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.help-side h5:first-child { margin-top: 0; }
.help-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.help-side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-soft); font-weight: 600; }
.help-side a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.help-side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.help-side ul ul { padding-left: 12px; }
.help-side ul ul a { font-weight: 500; font-size: .88rem; padding: 4px 10px; }
@media (max-width: 959px) {
  .help-side { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
  .help-side ul ul { display: none; }
}
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 800; }
.prose h2 { font-size: 1.55rem; margin-top: 2em; padding-top: .4em; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.18rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose .lead { font-size: 1.12rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .93rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); background: var(--surface-2); font-weight: 700; }
@media (max-width: 640px) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
  .prose td { border: 0; padding: 2px 0; }
  .prose td:empty { display: none; }
  .prose td:first-child { font-weight: 700; color: var(--ink); }
}
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: .88rem; }
.prose pre code { background: none; border: 0; padding: 0; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 12px; padding: 14px 16px; margin: 0 0 1.2em; }
.callout.tip { border-left-color: var(--ok); }
.callout.warn { border-left-color: var(--warn); }
.callout p:last-child { margin: 0; }
.callout strong:first-child { color: var(--ink); }
.donate-grid { display: grid; gap: 14px; margin: 0 0 1.4em; }
@media (min-width: 640px) { .donate-grid { grid-template-columns: repeat(2, 1fr); } }
.donate-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.donate-card h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.donate-card p { margin: 0; font-size: .94rem; }
.donate-card .btn { align-self: flex-start; margin-top: 6px; }
.toc-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toc-next a { display: grid; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 200px; }
.toc-next a small { color: var(--muted); font-weight: 600; }
.toc-next a:hover { text-decoration: none; border-color: var(--accent); }
.toc-next a.next { margin-left: auto; text-align: right; }

/* ---------- Webtoons ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.webtoon-intro { padding: 40px 0 32px; }
.webtoon-intro .prose { margin: 0 auto; }
.webtoon-intro h1 small { display: block; margin-top: 8px; font-size: .5em; font-weight: 700; letter-spacing: 0; color: var(--muted); }
.webtoon-intro h2 { font-size: 1.25rem; }
/* the language switch and chapter menu stay under the site header while reading */
.webtoon-bar {
  position: sticky; top: 64px; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.webtoon-bar-inner { max-width: 800px; margin: 0 auto; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.webtoon-jump { flex: 1 1 auto; min-width: 0; }
.webtoon-jump select { width: 100%; max-width: 380px; font: inherit; font-size: .88rem; font-weight: 600; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-overflow: ellipsis; }
.webtoon-lang { flex: none; margin: 0; }
.webtoon-lang button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.webtoon-reader { max-width: 800px; margin: 0 auto; background: var(--surface-2); }
.webtoon-reader img { display: block; width: 100%; height: auto; }
.webtoon-reader [id] { scroll-margin-top: 40px; }  /* on top of html's scroll-padding: clears header + bar */
.webtoon-chapter { margin: 0; padding: 14px 16px; text-align: center; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.webtoon-end { padding-top: 48px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

/* Webtoon promotion: nav badge, hero announcement, landing-page feature */
.new-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; line-height: 1.5; }
.nav a.nav-new { white-space: nowrap; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.nav a.nav-new:hover, .nav a.nav-new[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); }
.mobile-nav a.nav-new { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 1060px) { .nav a.nav-new .new-badge { margin-left: 4px; padding: 0 5px; font-size: .6rem; } }
@media (max-width: 999px) { .nav a.nav-new .new-badge { display: none; } }
.announce { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin-bottom: 14px; padding: 6px 16px 6px 6px; border-radius: 22px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: .92rem; line-height: 1.35; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.announce .new-badge { flex: none; margin-left: 0; }
.announce-text { min-width: 0; }
.announce-arrow { flex: none; color: var(--accent); transition: transform .15s; }
.announce:hover { text-decoration: none; border-color: var(--accent); }
.announce:hover .announce-arrow { transform: translateX(3px); }
.webtoon-feature { background:
    radial-gradient(520px 340px at 85% 40%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(460px 300px at 10% 80%, color-mix(in srgb, var(--plum) 12%, transparent), transparent 70%); }
.webtoon-feature h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 14px; }
.webtoon-feature p { color: var(--ink-soft); }
.feature-split { display: grid; gap: 28px; align-items: center; }
.feature-split .compare { max-width: 460px; width: 100%; justify-self: center; margin: 0; }
@media (min-width: 900px) { .feature-split { grid-template-columns: 1.05fr .95fr; gap: 48px; } }

/* Image placeholder: the spinning Halgakos (Glossarion's loading icon) until the image has loaded (site.js) */
img.is-loading { background: var(--surface-2) url("loading-halgakos.svg") no-repeat; background-size: 64px 64px; background-position: center min(50%, 140px); }
