@font-face {
  font-family: "Lora Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("/truyen-ngan-thay-ke/fonts/lora-vietnamese-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Lora Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("/truyen-ngan-thay-ke/fonts/lora-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Lora Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("/truyen-ngan-thay-ke/fonts/lora-latin-wght-normal.woff2") format("woff2-variations");
  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: "Lora Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url("/truyen-ngan-thay-ke/fonts/lora-vietnamese-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Lora Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url("/truyen-ngan-thay-ke/fonts/lora-latin-ext-wght-italic.woff2") format("woff2-variations");
  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: "Lora Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url("/truyen-ngan-thay-ke/fonts/lora-latin-wght-italic.woff2") format("woff2-variations");
  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 {
  --ink: #251a17;
  --muted: #71625b;
  --paper: #f7f0e5;
  --paper-deep: #eadfce;
  --cream: #fffaf2;
  --rust: #9e3f2f;
  --rust-dark: #6d2c22;
  --green: #31483d;
  --gold: #c9954c;
  --line: rgba(73, 49, 38, .18);
  --shadow: 0 22px 70px rgba(49, 31, 23, .15);
  --reader-size: 1.13rem;
  --serif: "Lora Variable", "Times New Roman", serif;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-150%); background: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 240, 229, .92);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font: 700 1.05rem/1.12 var(--serif); letter-spacing: .04em; }
.brand small { margin-top: 6px; color: var(--rust); font-weight: 800; letter-spacing: .16em; font-size: .65rem; }
.site-header nav, .site-footer nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.site-header nav a, .site-footer nav a { text-decoration: none; font-size: .9rem; font-weight: 700; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--rust); }

.hero {
  min-height: calc(100svh - 76px);
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(36px, 7vw, 104px);
  padding: clamp(58px, 7vw, 108px) clamp(22px, 7vw, 112px);
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 15%, rgba(201, 149, 76, .18), transparent 28%),
    linear-gradient(135deg, #fbf6ed 0%, #f3e8d7 58%, #dfc7ac 100%);
}

.eyebrow { margin: 0 0 15px; color: var(--rust); font-size: .72rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 650px; font: 700 clamp(3.8rem, 8vw, 8.4rem)/.92 var(--serif); letter-spacing: -.045em; font-optical-sizing: auto; }
.hero h1 em { color: var(--rust); font-weight: 500; }
.hero-lead { max-width: 610px; margin: 32px 0 0; font: 500 clamp(1.25rem, 2vw, 1.72rem)/1.58 var(--serif); }
.hero-note { max-width: 570px; margin: 17px 0 0; color: var(--muted); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { min-height: 50px; border: 1px solid var(--ink); border-radius: 999px; padding: 0 23px; cursor: pointer; font-weight: 800; transition: transform .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--ink); color: #fff; }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: rgba(255,255,255,.5); }
.series-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.story-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 34px; color: var(--muted); }
.story-stats span { display: inline-flex; align-items: baseline; gap: 6px; }
.story-stats strong { color: var(--ink); font: 700 1.3rem var(--serif); }

.hero-art { min-width: 0; position: relative; }
.cover-frame { position: relative; max-width: 560px; margin-inline: auto; border: 12px solid rgba(255,250,242,.82); border-radius: 2px; box-shadow: var(--shadow); transform: rotate(.6deg); overflow: hidden; }
.cover-frame::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 60px rgba(68, 39, 24, .14); pointer-events: none; }
.cover-frame img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.art-caption { max-width: 560px; margin: 18px auto 0; text-align: center; color: var(--muted); font: italic 1rem/1.6 var(--serif); }

.intro-band { position: relative; display: grid; place-items: center; min-height: 400px; padding: 80px 24px; overflow: hidden; background: var(--green); color: #f8f1e6; text-align: center; }
.intro-band::before, .intro-band::after { content: ""; position: absolute; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.intro-band::before { top: -210px; left: -80px; }
.intro-band::after { right: -100px; bottom: -230px; }
.quote-mark { position: absolute; top: 18px; margin: 0; color: rgba(255,255,255,.12); font: 16rem/1 var(--serif); }
.intro-band blockquote { position: relative; z-index: 1; max-width: 910px; margin: 0; font: 500 clamp(1.75rem, 3.5vw, 3.1rem)/1.42 var(--serif); }
.intro-credit { position: relative; z-index: 1; margin-top: 26px; color: #d7bd99; font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.chapters-section { padding: clamp(74px, 9vw, 130px) clamp(20px, 6vw, 96px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 48px; max-width: 1320px; margin: 0 auto 32px; }
.section-heading h2, .characters-copy h2 { margin: 0; font: 700 clamp(2.3rem, 4vw, 4.4rem)/1.1 var(--serif); letter-spacing: -.025em; }
.section-heading > p { max-width: 440px; margin: 0 0 4px; color: var(--muted); line-height: 1.7; }
.act-tabs { display: flex; gap: 8px; max-width: 1320px; margin: 0 auto 32px; overflow-x: auto; scrollbar-width: none; }
.act-tabs::-webkit-scrollbar { display: none; }
.act-tab { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 750; }
.act-tab.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }

.chapter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; max-width: 1320px; margin-inline: auto; }
.chapter-card { position: relative; display: flex; min-width: 0; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,250,242,.76); overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.chapter-card:hover { transform: translateY(-4px); border-color: rgba(158,63,47,.46); box-shadow: 0 18px 45px rgba(80,49,35,.1); }
.chapter-card[hidden] { display: none; }
.chapter-card.is-complete::after { content: "ĐÃ ĐỌC"; position: absolute; z-index: 3; top: 18px; right: -28px; width: 116px; padding: 5px 0; transform: rotate(42deg); background: var(--green); color: white; text-align: center; font-size: .6rem; font-weight: 900; letter-spacing: .12em; }
.chapter-poster-open { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: #201916; cursor: pointer; overflow: hidden; }
.chapter-poster-open img { display: block; width: 100%; height: auto; aspect-ratio: 941 / 1672; object-fit: contain; transition: transform .35s ease, filter .35s ease; }
.chapter-card:hover .chapter-poster-open img { transform: scale(1.018); filter: saturate(1.04); }
.chapter-card-copy { display: flex; flex: 1; flex-direction: column; padding: 20px 20px 22px; }
.chapter-number { color: var(--rust); font-size: .72rem; font-weight: 900; letter-spacing: .14em; }
.chapter-card h3 { margin: 12px 0 10px; font: 700 1.35rem/1.2 var(--serif); }
.chapter-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.58; }
.chapter-open { align-self: start; margin-top: auto; padding: 18px 0 0; border: 0; background: transparent; color: var(--rust); cursor: pointer; font-weight: 850; }

.characters-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 7vw, 104px); align-items: center; padding: clamp(72px, 9vw, 130px) clamp(22px, 7vw, 112px); background: #e4d5c1; }
.characters-copy { max-width: 630px; }
.characters-copy > p:not(.eyebrow) { margin: 28px 0; color: #584a43; line-height: 1.8; }
.text-link { color: var(--rust-dark); font-weight: 850; text-decoration: none; border-bottom: 1px solid rgba(109,44,34,.4); }
.characters-section > img { width: min(100%, 620px); height: auto; max-height: none; object-fit: contain; justify-self: center; border: 10px solid rgba(255,250,242,.7); box-shadow: var(--shadow); }

.reader-shell { display: grid; grid-template-columns: 290px minmax(0, 820px); justify-content: center; align-items: start; gap: 40px; padding: clamp(72px, 8vw, 120px) clamp(18px, 5vw, 76px); background: #f0e5d5; }
.reader-index { position: sticky; top: 98px; max-height: calc(100svh - 122px); overflow: auto; padding: 24px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,250,242,.6); }
.reader-index h2 { margin: 0 0 18px; font: 700 1.45rem var(--serif); }
.reader-index ol { list-style: none; margin: 0; padding: 0; }
.reader-index li + li { border-top: 1px solid var(--line); }
.reader-index button { width: 100%; border: 0; padding: 12px 5px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: .82rem; line-height: 1.35; }
.reader-index button:hover, .reader-index button.is-current { color: var(--rust); }
.reader-index button.is-current { font-weight: 850; }
.reader-index button.is-complete::after { content: " ✓"; color: var(--green); }

.reader-panel { min-width: 0; padding: clamp(26px, 5vw, 64px); border: 1px solid var(--line); border-radius: 24px; background: var(--cream); box-shadow: 0 24px 60px rgba(64,41,31,.1); transition: background .2s, color .2s; }
.reader-panel.is-dark { background: #211d1b; color: #efe5d6; --muted: #c0b1a3; --line: rgba(255,255,255,.13); }
.chapter-header { display: flex; justify-content: space-between; align-items: start; gap: 25px; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
.chapter-kicker { margin: 0 0 10px; color: var(--rust); font-size: .68rem; font-weight: 900; letter-spacing: .17em; }
.reader-panel.is-dark .chapter-kicker { color: #e9a790; }
.chapter-header h2 { margin: 0; font: 700 clamp(2.35rem, 5vw, 4.6rem)/1.08 var(--serif); letter-spacing: -.025em; }
.chapter-header > div:first-child > p:last-child { margin: 18px 0 0; color: var(--muted); line-height: 1.6; }
.reading-tools { display: flex; flex: 0 0 auto; gap: 5px; }
.reading-tools button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-weight: 800; }

.audio-player { display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; margin: 30px 0 0; padding: 16px; border-radius: 17px; background: var(--green); color: #fff; }
.audio-main { width: 52px; height: 52px; border: 0; border-radius: 50%; background: #f6e8d2; color: var(--green); cursor: pointer; font-size: 1.05rem; }
.audio-main-info { min-width: 0; }
.audio-topline, .audio-time { display: flex; justify-content: space-between; gap: 12px; }
.audio-topline { margin-bottom: 9px; font-size: .78rem; }
.audio-topline span, .audio-time { color: #cfded5; }
.audio-time { margin-top: 5px; font-size: .7rem; }
.audio-player input[type="range"] { width: 100%; height: 4px; accent-color: #f2c27c; cursor: pointer; }
.audio-actions { display: flex; gap: 4px; }
.audio-actions button { min-width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.audio-actions button:last-child { width: 43px; border-radius: 999px; font-size: .72rem; }
.audio-status { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: .75rem; }

.chapter-body { font: 400 var(--reader-size)/1.92 var(--serif); margin-top: 42px; text-wrap: pretty; font-optical-sizing: auto; }
.chapter-illustration { margin: 0 0 2.6em; }
.chapter-illustration img { width: 100%; height: auto; border-radius: 16px; box-shadow: 0 18px 45px rgba(62, 39, 29, .16); }
.chapter-illustration figcaption { max-width: 680px; margin: 14px auto 0; color: var(--muted); font: italic .88rem/1.65 var(--serif); text-align: center; }
.chapter-poster-feature { display: grid; justify-items: center; padding: clamp(14px, 4vw, 32px); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(228,213,193,.72), rgba(255,250,242,.42)); }
.chapter-poster-feature img { width: min(100%, 420px); border-radius: 8px; }
.chapter-scene { margin-top: 2.2em; }
.reader-panel.is-dark .chapter-poster-feature { background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); }
.chapter-body h1 { display: none; }
.chapter-body h2, .chapter-body h3 { margin: 2.4em 0 .7em; font: 700 1.55em/1.3 var(--serif); }
.chapter-body p { margin: 0 0 1.22em; }
.chapter-body em { color: var(--rust-dark); }
.reader-panel.is-dark .chapter-body em { color: #efb5a3; }
.chapter-body blockquote { margin: 2em 0; padding: 0 0 0 22px; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; }
.chapter-body hr { margin: 3em auto; width: 25%; border: 0; border-top: 1px solid var(--line); }

.reader-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); }
.reader-nav button { min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 0 15px; background: transparent; color: inherit; cursor: pointer; font-weight: 750; }
.reader-nav button:last-child { justify-self: end; }
.reader-nav button:disabled { opacity: .35; cursor: default; }
#mark-complete { color: var(--green); }
.reader-panel.is-dark #mark-complete { color: #b7d5c2; }

.site-footer { display: flex; justify-content: space-between; gap: 40px; padding: 48px clamp(20px, 7vw, 110px); background: var(--ink); color: #f6ecdf; }
.site-footer strong { font: 700 1.3rem var(--serif); }
.site-footer p { margin: 8px 0 0; color: #b9aaa0; }

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 36px; padding-inline: 32px; }
  .hero h1 { font-size: clamp(3.6rem, 9vw, 6.5rem); }
  .chapter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .characters-section { grid-template-columns: 1fr; }
  .characters-copy { max-width: 850px; }
  .characters-section > img { max-height: none; }
}

@media (max-width: 780px) {
  html { scroll-padding-top: 68px; }
  .site-header { min-height: 66px; padding: 8px 15px; }
  .brand img { width: 42px; height: 42px; }
  .brand strong { font-size: .9rem; }
  .brand small { font-size: .56rem; }
  .site-header nav a { display: none; }
  .site-header nav a:last-child { display: inline; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 55px 20px 72px; }
  .hero-copy { text-align: center; }
  .hero h1, .hero-lead, .hero-note { margin-inline: auto; }
  .hero-actions, .story-stats { justify-content: center; }
  .hero-art { max-width: 540px; margin-inline: auto; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 18px; }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .chapter-card { border-radius: 14px; }
  .chapter-card-copy { padding: 14px 13px 16px; }
  .chapter-card h3 { margin-top: 8px; font-size: 1.05rem; }
  .chapter-card p { display: none; }
  .chapter-open { padding-top: 12px; font-size: .78rem; }
  .characters-section { padding-inline: 20px; }
  .reader-shell { display: block; padding: 52px 12px 90px; }
  .reader-index { position: static; max-height: none; margin-bottom: 16px; padding: 18px; }
  .reader-index ol { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 3px; scrollbar-width: none; }
  .reader-index ol::-webkit-scrollbar { display: none; }
  .reader-index li { flex: 0 0 auto; border: 0 !important; }
  .reader-index button { width: auto; max-width: 180px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; }
  .reader-panel { padding: 26px 20px 36px; border-radius: 18px; }
  .chapter-header { display: block; }
  .reading-tools { margin-top: 20px; }
  .audio-player { position: sticky; top: 76px; z-index: 20; grid-template-columns: auto 1fr; box-shadow: 0 14px 34px rgba(30, 22, 18, .22); }
  .audio-actions { grid-column: 1 / -1; justify-content: center; }
  .chapter-body { line-height: 1.82; }
  .chapter-poster-feature { padding: 10px; border-radius: 16px; }
  .reader-nav { grid-template-columns: 1fr 1fr; }
  #mark-complete { grid-column: 1 / -1; grid-row: 2; }
  .site-footer { display: block; }
  .site-footer nav { margin-top: 28px; flex-wrap: wrap; }
}

@media (max-width: 440px) {
  .hero h1 { font-size: 3.45rem; }
  .story-stats { font-size: .85rem; }
  .intro-band { min-height: 350px; padding-inline: 20px; }
  .intro-band blockquote { font-size: 1.55rem; }
  .chapter-header h2 { font-size: 2.4rem; }
  .audio-player { padding: 12px; gap: 10px; }
  .audio-main { width: 46px; height: 46px; }
}

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