:root {
  --bg: #0f1115; --panel: #181b22; --text: #e8e6e3; --muted: #9aa0ab;
  --accent: #ffb454; --line: #262a33; --danger: #e06c75;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s12: 48px;
  --fs-xs: .75rem; --fs-sm: .85rem; --fs-md: 1rem; --fs-lg: 1.2rem; --fs-xl: 1.6rem; --fs-2xl: 2.1rem;
  --ease: 150ms ease;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
a { color: inherit; }
main { max-width: 720px; margin: 0 auto; padding: 16px 12px 64px; }

.site-header {
  position: sticky; top: 0; z-index: 10; padding: 12px 16px;
  background: rgba(15, 17, 21, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  transition: transform var(--ease);
}
.site-header.hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: baseline; gap: var(--s3); text-decoration: none; }
.brand-stamp { background: var(--accent); color: #14100a; font-weight: 800; padding: 2px 10px; border-radius: 6px; letter-spacing: .04em; }
.brand-tag { color: var(--muted); font-size: var(--fs-xs); }
.lang-switch { display: flex; gap: var(--s2); }
.lang-switch a { color: var(--muted); text-decoration: none; font-size: var(--fs-sm); padding: 2px 8px; border-radius: 6px; }
.lang-switch a.on { color: var(--text); background: var(--panel); }

.site-footer {
  border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 16px 40px;
  color: var(--muted); font-size: .85rem; text-align: center;
}
.site-footer nav { display: flex; gap: 16px; justify-content: center; margin-bottom: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.ai-note { margin: 4px 0 0; }

.section-title {
  display: flex; align-items: center; gap: var(--s2);
  font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em;
  color: var(--text); margin: var(--s8) 0 var(--s3);
}
.section-title::before {
  content: ""; width: 14px; height: 3px; border-radius: 2px;
  background: var(--accent); flex-shrink: 0;
}

.genre-badge {
  display: inline-block; margin: 8px 10px 0; padding: 1px 8px; border-radius: 99px;
  background: rgba(255, 180, 84, .12); color: var(--accent); font-size: .72rem;
}

.hero { position: relative; margin: var(--s4) calc(-1 * var(--s3)) var(--s8); overflow: hidden; border-radius: 14px; }
.hero-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  flex: 0 0 100%; scroll-snap-align: start; position: relative;
  min-height: 320px; display: flex; align-items: center;
  background: linear-gradient(105deg, var(--genre) 0%, color-mix(in srgb, var(--genre) 35%, var(--bg)) 45%, var(--bg) 100%);
}
.hero-hit { position: absolute; inset: 0; z-index: 1; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.3px);
  background-size: 5px 5px;
}
.hero-copy { padding: var(--s8); max-width: 55%; position: relative; z-index: 2; pointer-events: none; }
.hero-copy .cta { pointer-events: auto; }
.hero-copy h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 900;
  letter-spacing: -.02em; margin: var(--s2) 0; line-height: 1.15;
}
.hero-copy p { color: rgba(255,255,255,.85); }
.hero-art { position: absolute; right: 0; top: 0; height: 100%; width: 50%; object-fit: cover; object-position: top; mask-image: linear-gradient(90deg, transparent, #000 30%); }
.cta { display: inline-block; margin-top: var(--s4); background: #0a0b0e; color: #fff; padding: var(--s3) var(--s6); border-radius: 10px; font-weight: 700; text-decoration: none; transition: transform var(--ease); }
.cta:hover { transform: translateY(-2px); }
.hero-dots { position: absolute; bottom: var(--s3); left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.hero-dots button {
  width: 10px; height: 10px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 7px solid transparent; box-sizing: content-box;
  background: rgba(255, 255, 255, .35); background-clip: padding-box;
}
.hero-dots button.on { background: #fff; background-clip: padding-box; }

.mill-board { margin-bottom: var(--s4); }
.week-strip {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1);
  list-style: none; margin: 0; padding: var(--s3);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.day-cell { min-width: 0; padding: var(--s1) var(--s2); border-radius: 10px; }
.day-cell.today { border: 1px solid var(--accent); background: rgba(255, 180, 84, .06); }
.day-name {
  display: flex; align-items: center; gap: var(--s1);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs); color: var(--muted);
}
.day-cell.today .day-name { color: var(--accent); font-weight: 700; }
.today-stamp {
  background: var(--accent); color: #14100a; font-weight: 800;
  font-size: .6rem; border-radius: 4px; padding: 0 4px; letter-spacing: .04em;
}
.day-series {
  display: flex; align-items: center; gap: 4px; margin-top: var(--s1);
  font-size: var(--fs-xs); text-decoration: none; color: var(--text);
}
.day-series .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--genre, var(--accent)); flex-shrink: 0; }
.day-series .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-series:hover .name { color: var(--genre, var(--accent)); }
.day-off { color: var(--line); font-size: var(--fs-xs); }
@media (max-width: 560px) {
  .day-series { font-size: .65rem; }
  .hero-slide { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-art {
    position: static; width: 100%; height: auto; aspect-ratio: 16 / 10;
    object-fit: cover; object-position: top;
    mask-image: linear-gradient(180deg, #000 65%, transparent);
  }
  .hero-copy { max-width: 100%; padding: 0 var(--s4) var(--s6); margin-top: calc(-1 * var(--s8)); }
  .hero-copy .cta { display: block; text-align: center; }
  .week-strip { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .week-strip::-webkit-scrollbar { display: none; }
  .day-cell { flex: 0 0 84px; scroll-snap-align: start; }
}

.rail { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s3); }
.rail::-webkit-scrollbar { display: none; }
.rail .series-card { flex: 0 0 152px; scroll-snap-align: start; }
.series-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; transition: transform var(--ease), border-color var(--ease); }
.series-card:hover { transform: translateY(-3px); border-color: var(--genre); }
.series-card img { width: 100%; aspect-ratio: 832/1216; object-fit: cover; display: block; }
.card-meta { padding: var(--s2) var(--s3) var(--s3); }
.card-meta h3 { font-size: var(--fs-sm); margin: var(--s1) 0; }
.new-badge { background: var(--genre, var(--accent)); color: #0a0b0e; font-size: var(--fs-xs); font-weight: 800; padding: 1px 6px; border-radius: 5px; margin-right: var(--s1); }
.done-badge {
  display: inline-block; border: 1px solid var(--line); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 700; padding: 0 6px; border-radius: 5px;
}
.days-badge { color: var(--muted); font-size: var(--fs-xs); }
.latest-no { color: var(--genre, var(--accent)); font-size: var(--fs-xs); font-family: var(--mono); font-variant-numeric: tabular-nums; }

.feed-item {
  display: flex; gap: 10px; align-items: baseline; padding: 12px 4px;
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.feed-series { color: var(--accent); font-size: .85rem; white-space: nowrap; }
.feed-series[data-genre] { color: var(--genre); }
.feed-title { flex: 1; }
.feed-item time { color: var(--muted); font-size: .8rem; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }

.series-head { display: flex; gap: 16px; margin-bottom: 8px; }
.series-head img { width: 128px; border-radius: 10px; }
.series-head .desc { color: var(--muted); font-size: .9rem; }
.ep-list a {
  display: flex; justify-content: space-between; padding: 12px 4px;
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.ep-list time { color: var(--muted); font-size: .8rem; }

#progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--genre, var(--accent)); z-index: 20; }

.viewer { max-width: 720px; margin: 0 auto; }
.viewer .cut { display: block; width: 100%; height: auto; }
.cut-wrap.loading {
  min-height: 40vh; background: linear-gradient(100deg, var(--panel) 40%, #1b1e26 50%, var(--panel) 60%);
  background-size: 200% 100%; animation: pulse 1.2s infinite;
}
@keyframes pulse { to { background-position: -200% 0; } }
.next-cta {
  display: block; text-align: center; margin: var(--s6) 0; padding: var(--s4);
  border-radius: 12px; background: var(--genre, var(--accent)); color: #0a0b0e;
  font-weight: 800; text-decoration: none; font-size: var(--fs-lg);
}
.viewer-nav { display: flex; justify-content: space-between; padding: 16px 0; }
.viewer-nav a, .btn {
  display: inline-block; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); text-decoration: none;
}
.viewer-nav .disabled { opacity: .35; pointer-events: none; }
.synopsis { background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; color: var(--muted); font-size: .92rem; }

.ep-head { background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: var(--s4); margin-bottom: var(--s4); }
.ep-head h1 { margin: 4px 0 var(--s2); font-size: var(--fs-lg); }
.ep-series { color: var(--genre, var(--accent)); text-decoration: none; font-size: var(--fs-sm); font-weight: 700; }
.ep-meta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center;
  margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.ep-meta a { color: var(--accent); text-decoration: none; }
.ep-meta a:hover { text-decoration: underline; }
.prev-story { margin-top: var(--s3); color: var(--muted); font-size: var(--fs-sm); }
.prev-story summary { cursor: pointer; color: var(--accent); }
.prev-story p { margin: var(--s2) 0 0; }

.react-row { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.react-btn {
  padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: .95rem; cursor: pointer;
}
.react-btn:disabled { opacity: .5; }
.react-btn .count { color: var(--accent); margin-left: 6px; }

.comments h2 { font-size: 1rem; color: var(--muted); }
.comment { padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.comment time { color: var(--muted); font-size: .75rem; margin-left: 8px; }
.comment-notice { color: var(--muted); font-size: .9rem; }
.comment-ep { color: var(--accent); text-decoration: none; margin-right: var(--s2); font-size: var(--fs-xs); }
.pager { display: flex; gap: var(--s2); margin: var(--s4) 0; }
#comment-episode { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: var(--s2); margin: var(--s2) 0; }
#comment-form textarea {
  width: 100%; min-height: 72px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); padding: 10px; font: inherit;
}
#comment-form button { margin-top: 8px; }

.adslot { margin: 16px 0; min-height: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.notfound { text-align: center; padding: 64px 0; }
.notfound h1 { font-size: 3rem; color: var(--accent); margin-bottom: 0; }
.policy h1 { font-size: 1.3rem; }
.policy h2 { font-size: 1.05rem; margin-top: 24px; }
.policy p, .policy li { color: var(--muted); }

/* about page */
[data-genre="romance"] { --genre: #f472a6; }
[data-genre="fantasy"] { --genre: #a78bfa; }
[data-genre="mystery"] { --genre: #2dd4bf; }
[data-genre="comedy"] { --genre: #facc15; }

.about-hero {
  display: flex; align-items: center; gap: 28px; margin-bottom: 8px;
  padding: 40px 28px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(115deg,
    color-mix(in srgb, var(--genre, var(--accent)) 45%, var(--bg)), var(--bg) 60%);
}
.about-hero .hero-text { min-width: 0; }
.about-hero .genre-badge { margin: 0; }
.about-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.08;
  margin: 10px 0 12px; letter-spacing: -.01em;
}
.about-hero .hero-synopsis { color: var(--text); opacity: .82; font-size: .92rem; margin: 0; max-width: 42ch; }
.about-hero .hero-cover { flex-shrink: 0; width: 168px; }
.about-hero .hero-cover img { width: 100%; border-radius: 12px; box-shadow: 0 16px 32px rgba(0, 0, 0, .35); display: block; }
@media (max-width: 560px) {
  .about-hero { flex-direction: column; align-items: flex-start; padding: 28px 20px; }
  .about-hero .hero-cover { width: 128px; align-self: center; }
}

.about-synopsis { color: var(--muted); font-size: .95rem; }
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .char-grid { grid-template-columns: repeat(3, 1fr); } }
.char-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.char-card h3 { margin: 0 0 2px; font-size: 1rem; }
.char-role {
  display: inline-block; font-size: .72rem; color: var(--accent);
  background: rgba(255, 180, 84, .12); border-radius: 99px; padding: 1px 8px; margin-bottom: 8px;
}
.char-card p { margin: 4px 0; font-size: .88rem; }
.char-look { color: var(--muted); }

.rel-list { display: flex; flex-direction: column; gap: 8px; }
.rel-item {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: .9rem;
}
.rel-arrow { color: var(--accent); font-size: .82rem; }
