:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --surface: #14141a;
  --surface-2: #1c1c24;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7f7f3;
  --muted: #aaaab4;
  --acid: #d7ff3f;
  --violet: #8c6cff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.reader-open { overflow: hidden; }

button, input { font: inherit; }

button { color: inherit; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -60px;
  padding: 12px 16px;
  background: var(--acid);
  color: #0a0a0c;
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 15, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: none;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--acid);
  color: #0c0c0e;
  font-size: 19px;
  line-height: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.mobile-badge {
  padding: 5px 8px;
  border: 1px solid rgba(215, 255, 63, .32);
  border-radius: 99px;
  color: var(--acid);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button svg, .bottom-nav svg, .reader-header svg, .hero-actions svg, .mini-save svg, .search-box svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main { min-height: calc(100svh - 64px); padding-bottom: calc(92px + var(--safe-bottom)); }

.view { display: none; }
.view.is-active { display: block; animation: reveal .35s ease both; }

@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }

.hero-shell {
  position: relative;
  min-height: min(730px, calc(100svh - 64px));
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #111115;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: min(730px, calc(100svh - 64px));
  flex-direction: column;
  justify-content: flex-end;
  padding: 42px 20px 34px;
  background: linear-gradient(180deg, rgba(11,11,15,.03) 15%, rgba(11,11,15,.16) 38%, #0b0b0f 81%);
}

.eyebrow, .section-kicker {
  margin: 0 0 13px;
  color: var(--acid);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
}

.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 16px var(--acid); }

.hero-copy h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(38px, 11vw, 68px);
  line-height: .98;
  letter-spacing: -.075em;
  text-wrap: balance;
}

.hero-copy h1 em { color: var(--acid); font-style: normal; }

.hero-description {
  max-width: 510px;
  margin: 18px 0 0;
  color: #d3d3d8;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
}

.hero-meta { display: flex; gap: 18px; margin-top: 16px; color: var(--muted); font-size: 13px; font-weight: 750; }
.hero-meta span + span { position: relative; }
.hero-meta span + span::before { content: ""; position: absolute; left: -10px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: #676771; }

.hero-actions { display: flex; gap: 10px; margin-top: 22px; }

.primary-button, .save-button {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  background: var(--acid);
  color: #101005;
}

.primary-button svg { fill: currentColor; stroke: none; }

.save-button {
  display: inline-flex;
  min-width: 82px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(26,26,33,.83);
}

.save-button[aria-pressed="true"] { border-color: var(--acid); color: var(--acid); }
.save-button[aria-pressed="true"] svg { fill: currentColor; }

.hero-art { position: absolute; inset: 0; }
.hero-art img { width: 100%; height: 68%; object-fit: cover; object-position: 50% 12%; opacity: .82; }
.hero-gradient { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,11,15,.05), transparent 55%), linear-gradient(180deg, transparent 35%, #0b0b0f 88%); }
.hero-number { position: absolute; right: -8px; top: 39%; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.2); font-size: 96px; font-weight: 950; letter-spacing: -.09em; }

.content-section { padding: 48px 18px 24px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.section-kicker { margin-bottom: 7px; }
.text-button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }

.series-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.series-cover { position: relative; min-height: 190px; overflow: hidden; padding: 0; border: 0; border-radius: 13px; background: #24242a; cursor: pointer; }
.series-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.free-pill { position: absolute; left: 9px; top: 9px; padding: 5px 7px; border-radius: 6px; background: var(--acid); color: #101005; font-size: 12px; font-weight: 950; }
.cover-play { position: absolute; right: 9px; bottom: 9px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: rgba(11,11,15,.85); font-size: 11px; }
.series-info { min-width: 0; display: flex; flex-direction: column; padding: 5px 2px 2px; }
.series-category { margin: 0; color: var(--violet); font-size: 12px; font-weight: 850; }
.series-info h3 { margin: 10px 0 6px; font-size: 21px; letter-spacing: -.045em; }
.episode-title { margin: 0; color: #bebec6; font-size: 14px; line-height: 1.45; }
.series-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; color: #85858f; font-size: 12px; }
.mini-save { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); cursor: pointer; }
.mini-save[aria-pressed="true"] { color: var(--acid); }
.mini-save[aria-pressed="true"] svg { fill: currentColor; }

.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 30px 18px 48px; border-block: 1px solid var(--line); }
.feature-strip div { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 22px 7px; text-align: center; }
.feature-strip div + div { border-left: 1px solid var(--line); }
.feature-strip strong { color: var(--acid); font-size: clamp(17px, 5vw, 24px); letter-spacing: -.04em; }
.feature-strip span { color: var(--muted); font-size: 12px; line-height: 1.35; }

.page-intro { padding: 46px 18px 22px; }
.page-intro h1 { margin: 0; font-size: clamp(38px, 10vw, 58px); letter-spacing: -.07em; }
.page-intro > p:last-child { max-width: 540px; color: var(--muted); font-size: 15px; line-height: 1.6; }

.search-box {
  display: flex;
  height: 54px;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.search-box:focus-within { border-color: var(--acid); }
.search-box svg { flex: 0 0 auto; color: var(--muted); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-box input::placeholder { color: #74747e; }
.search-box kbd { display: none; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: #777781; font-size: 12px; }

.filter-row { display: flex; gap: 8px; margin-top: 17px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter { min-height: 44px; flex: 0 0 auto; padding: 0 16px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.filter.is-active { border-color: var(--acid); background: var(--acid); color: #0b0b0f; font-weight: 900; }

.explore-grid { display: grid; gap: 14px; padding: 8px 18px 48px; }
.explore-card { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 16px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.explore-cover { position: relative; height: 168px; overflow: hidden; padding: 0; border: 0; border-radius: 12px; background: #222; cursor: pointer; }
.explore-cover img { width: 100%; height: 100%; object-fit: cover; }
.explore-cover span { position: absolute; left: 8px; bottom: 8px; padding: 5px 8px; border-radius: 5px; background: var(--acid); color: #111; font-size: 12px; font-weight: 900; }
.explore-card p { margin: 0 0 8px; color: var(--violet); font-size: 12px; font-weight: 850; }
.explore-card h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.05em; }
.explore-card div > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty-search { padding: 80px 20px; color: var(--muted); text-align: center; }

.library-intro { border-bottom: 1px solid var(--line); }
.library-empty { display: grid; max-width: 500px; place-items: center; margin: 70px auto; padding: 0 26px; text-align: center; }
.library-empty > span { display: grid; width: 68px; height: 68px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--acid); font-size: 32px; }
.library-empty h2 { margin: 22px 0 8px; font-size: 21px; }
.library-empty p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.6; word-break: keep-all; }
.library-card { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: center; margin: 24px 18px; padding: 14px; border: 1px solid rgba(215,255,63,.28); border-radius: 20px; background: linear-gradient(135deg, rgba(215,255,63,.06), var(--surface)); }
.library-card:not([hidden]) { display: grid; }
.library-card img { width: 120px; height: 172px; object-fit: cover; border-radius: 12px; }
.library-card p { margin: 0 0 6px; color: var(--acid); font-size: 12px; font-weight: 850; }
.library-card h2 { margin: 0 0 7px; font-size: 20px; }
.library-card span { display: block; margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.library-card .primary-button { min-height: 44px; font-size: 14px; }

.bottom-nav {
  position: fixed;
  z-index: 70;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(68px + var(--safe-bottom));
  padding: 5px 12px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(15,15,20,.94);
  backdrop-filter: blur(18px);
}
.bottom-nav button { display: flex; min-height: 56px; align-items: center; justify-content: center; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; color: #85858f; font-size: 12px; font-weight: 750; cursor: pointer; }
.bottom-nav button.is-active { color: var(--acid); }
.bottom-nav svg { width: 21px; }
.bottom-nav button.is-active:first-child svg { fill: currentColor; }
.bottom-nav button.is-active:last-child svg { fill: currentColor; }

.reader {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background: #050506;
}
.reader.is-open { display: block; }
.reader-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 64px;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 8px;
  background: rgba(8,8,10,.91);
  backdrop-filter: blur(16px);
}
.reader-back { display: grid; width: 48px; height: 48px; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.reader-header div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.reader-header strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.reader-header span { color: var(--muted); font-size: 12px; }
.reader-count { min-width: 50px; text-align: right; }
.reader-progress { position: sticky; z-index: 4; top: 64px; height: 3px; background: rgba(255,255,255,.1); }
.reader-progress span { display: block; width: 1.2%; height: 100%; background: var(--acid); transition: width .2s ease; }
.reader-panels { width: min(100%, 690px); min-height: 100vh; margin: 0 auto; background: #fff; }
.reader-panel { display: block; width: 100%; height: auto; margin: 0; background: #efefef; }
.reader-end { display: grid; min-height: 280px; place-items: center; padding: 50px 24px 100px; background: var(--bg); text-align: center; }
.reader-end strong { display: block; color: var(--acid); font-size: 13px; letter-spacing: .1em; }
.reader-end h2 { margin: 10px 0 8px; font-size: 27px; }
.reader-end p { margin: 0; color: var(--muted); font-size: 14px; }
.to-top { position: fixed; z-index: 6; right: 16px; bottom: calc(18px + var(--safe-bottom)); display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(20,20,26,.9); color: var(--acid); font-size: 20px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }

.toast { position: fixed; z-index: 400; left: 50%; bottom: calc(84px + var(--safe-bottom)); max-width: calc(100% - 32px); transform: translate(-50%, 18px); padding: 12px 17px; border: 1px solid rgba(215,255,63,.35); border-radius: 12px; background: #23232a; box-shadow: 0 14px 50px rgba(0,0,0,.4); font-size: 14px; font-weight: 750; opacity: 0; pointer-events: none; transition: .22s ease; white-space: nowrap; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .topbar { height: 72px; padding-inline: max(28px, calc((100vw - 1180px) / 2)); }
  main { padding-bottom: 0; }
  .hero-shell { min-height: 690px; display: grid; grid-template-columns: 1.05fr .95fr; }
  .hero-copy { min-height: 690px; justify-content: center; padding: 70px max(36px, calc((100vw - 1180px) / 2)); padding-right: 40px; background: linear-gradient(90deg, #0b0b0f 26%, rgba(11,11,15,.72) 69%, transparent); }
  .hero-art { left: 47%; }
  .hero-art img { height: 100%; object-position: 50% 22%; }
  .hero-gradient { background: linear-gradient(90deg, #0b0b0f 0%, rgba(11,11,15,.12) 46%, transparent), linear-gradient(0deg, rgba(11,11,15,.65), transparent 50%); }
  .hero-number { right: 3vw; top: 10%; font-size: 150px; }
  .hero-description { font-size: 17px; }
  .content-section, .page-intro, .explore-grid { width: min(100% - 48px, 1180px); margin-inline: auto; padding-inline: 0; }
  .content-section { padding-top: 72px; }
  .series-card { grid-template-columns: 200px 1fr; max-width: 670px; }
  .series-cover { min-height: 280px; }
  .series-info { padding: 16px 10px 10px; }
  .series-info h3 { font-size: 29px; }
  .feature-strip { width: min(100% - 48px, 1180px); margin: 50px auto 80px; }
  .feature-strip span { font-size: 12px; }
  .search-box { max-width: 620px; }
  .search-box kbd { display: inline-block; }
  .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-card { width: min(100% - 48px, 720px); margin: 36px auto; }
  .bottom-nav { position: static; display: none; }
  .reader-header { padding-inline: max(16px, calc((100vw - 730px) / 2)); }
  .to-top { right: max(24px, calc((100vw - 820px) / 2)); }
  .toast { bottom: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
