@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ============================================================
   VietPoem - design tokens
   Palette: romantic rose + elegant gold. Contrast ratios verified.
   ============================================================ */
:root {
  /* Color */
  --color-primary:          #DB2777;
  --color-on-primary:       #FFFFFF;   /* 4.60:1 on primary */
  --color-primary-hover:    #BE185D;
  --color-secondary:        #F472B6;
  --color-accent:           #A16207;   /* 4.97:1 on white   */
  --color-background:       #FDF2F8;
  --color-foreground:       #831843;   /* 8.87:1 on bg      */
  --color-card:             #FFFFFF;
  --color-muted:            #F0EDF4;
  --color-muted-foreground: #475569;   /* 6.85:1 on bg      */
  --color-border:           #FBCFE8;
  --color-link:             #BE185D;   /* 5.98:1 on white   */
  --color-ring:             #DB2777;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Be Vietnam Pro', 'Noto Sans', 'Segoe UI', system-ui, sans-serif;

  --text-xs:   0.8125rem;
  --text-sm:   0.9375rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;

  /* Spacing - spacious scale (density 3/10) */
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  64px;
  --space-2xl: 96px;

  /* Shape and depth */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(131, 24, 67, .06);
  --shadow-md: 0 4px 16px rgba(131, 24, 67, .08);
  --shadow-lg: 0 12px 32px rgba(131, 24, 67, .12);

  /* Motion */
  --ease-out:  cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast:  150ms;
  --dur-base:  250ms;
  --dur-slow:  400ms;

  --container: 1200px;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-background);
  background-image:
    radial-gradient(ellipse 900px 500px at 12% -8%, rgba(244,114,182,.22), transparent 62%),
    radial-gradient(ellipse 800px 420px at 92% 4%,  rgba(251,207,232,.40), transparent 60%);
  background-repeat: no-repeat;
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-sm);
  text-wrap: balance;
  scroll-margin-top: 96px;   /* clear the sticky header on anchor jumps */
}

section[id], [id] { scroll-margin-top: 96px; }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-sm); max-width: 68ch; }

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.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;
}

.skip-link {
  position: absolute; left: var(--space-sm); top: -100px;
  background: var(--color-primary); color: var(--color-on-primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm); z-index: 100;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-sm); }

/* ============================================================
   Header and navigation
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 242, 248, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex; align-items: center; gap: var(--space-md);
  min-height: 72px; position: relative;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand--header { padding: 4px 0; }
.brand__banner {
  display: block;
  width: clamp(230px, 24vw, 340px);
  height: auto;
  aspect-ratio: 1916 / 821;
  object-fit: contain;
}
.brand__mark { color: var(--color-primary); flex-shrink: 0; }
.brand__name {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 700; color: var(--color-foreground); line-height: 1.15;
}
.brand__tag {
  display: block; font-family: var(--font-body);
  font-size: var(--text-xs); font-weight: 400;
  color: var(--color-muted-foreground); letter-spacing: .04em;
}

.main-nav { position: relative; margin-left: auto; }
.main-nav ul {
  display: flex; align-items: center; gap: var(--space-xs);
  list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  display: flex; align-items: center;
  min-height: 44px; padding: 0 14px;
  border-radius: var(--radius-full);
  color: var(--color-foreground);
  font-size: var(--text-sm); font-weight: 500;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--color-card); color: var(--color-primary);
  text-decoration: none; box-shadow: var(--shadow-sm);
}
.main-nav__heart {
  position: absolute;
  top: calc(100% - 12px);
  left: 50%;
  z-index: 1;
  width: 64px;
  height: 64px;
  transform: translateX(-50%);
  pointer-events: none;
}

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-left: auto;
  background: var(--color-card); color: var(--color-foreground);
  border: 1px solid var(--color-border); border-radius: var(--radius-full);
  cursor: pointer;
}

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: var(--space-2xl) 0 var(--space-xl); }

.hero__inner {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: var(--space-xl); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-accent); margin-bottom: var(--space-sm);
}
.eyebrow::after {
  content: ""; width: 40px; height: 1px;
  background: currentColor; opacity: .5;
}

.hero h1 { margin-bottom: var(--space-sm); }
.hero h1 em { font-style: italic; color: var(--color-primary); font-weight: 500; }

.hero__lede {
  font-size: var(--text-lg); color: var(--color-muted-foreground);
  max-width: 54ch; margin-bottom: var(--space-lg);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* Featured poem card */
.poem-card {
  margin: 0;                 /* figure default margin would indent the card */
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.poem-card::before {
  content: "";
  position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none; opacity: .7;
}
.poem-card__title {
  font-family: var(--font-display); font-size: var(--text-2xl);
  margin: 0 0 var(--space-sm);
}
.poem-card__body {
  font-family: var(--font-display); font-style: italic;
  font-size: var(--text-lg); line-height: 1.95;
  color: var(--color-foreground); white-space: pre-line;
  margin: 0 0 var(--space-md);
}
.poem-card__meta {
  display: flex; align-items: center; gap: var(--space-xs);
  font-size: var(--text-sm); color: var(--color-muted-foreground);
  border-top: 1px solid var(--color-border); padding-top: var(--space-sm);
}
.poem-card__author { font-weight: 600; color: var(--color-foreground); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-xs);
  min-height: 48px; padding: 0 var(--space-md);
  border-radius: var(--radius-full);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--color-primary); color: var(--color-on-primary);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  background: var(--color-primary-hover); color: var(--color-on-primary);
  box-shadow: var(--shadow-lg);
}

.btn--ghost {
  background: var(--color-card); color: var(--color-foreground);
  border-color: var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn--intro { border-color: #E9B44C; color: #8B5E12; }
.btn--intro:hover { border-color: #C98A1D; color: #7A5008; background: #FFF9EA; }

/* ============================================================
   Sections and page layout
   ============================================================ */
.section { padding: var(--space-xl) 0; }
.section--card {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section__head { margin-bottom: var(--space-lg); max-width: 62ch; }
.section__head p { color: var(--color-muted-foreground); margin: 0; }

.layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-xl); align-items: start;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar { position: sticky; top: 96px; }

.side-group { margin-bottom: var(--space-lg); }
.side-group__title {
  display: flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 var(--space-sm);
}
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group li + li { margin-top: 2px; }
.side-group a {
  display: flex; align-items: center;
  min-height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--color-foreground); font-size: var(--text-sm);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              padding-left var(--dur-fast) var(--ease-out);
}
.side-group a:hover {
  background: var(--color-card); color: var(--color-primary);
  text-decoration: none; padding-left: 18px;
}

.badge {
  margin-left: auto; flex-shrink: 0; white-space: nowrap;
  background: var(--color-muted); color: var(--color-muted-foreground);
  font-size: var(--text-xs); font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-full);
}

.side-photo {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md); margin: 0 0 var(--space-lg);
  background: var(--color-card);
}
.side-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.side-photo figcaption {
  padding: 10px 12px; font-size: var(--text-xs);
  color: var(--color-muted-foreground);
}

/* ============================================================
   Cards and grids
   ============================================================ */
.card-grid {
  display: grid; gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  list-style: none; margin: 0; padding: 0;
}

.card {
  display: flex; flex-direction: column; gap: var(--space-xs);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-secondary);
}
.card__icon { color: var(--color-primary); }
.card__title {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 600; margin: 0;
}
.card__title a { color: inherit; }
.card__title a:hover { color: var(--color-primary); text-decoration: none; }
.card__meta { font-size: var(--text-sm); color: var(--color-muted-foreground); margin: 0; }

/* Author index */
.poet-list {
  max-width: 860px;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  counter-reset: poet;
}
.poet-list__item {
  counter-increment: poet;
}
.poet-list__item + .poet-list__item { border-top: 1px solid var(--color-border); }
.poet-list__item a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(72px, auto);
  align-items: center;
  gap: var(--space-sm);
  min-height: 72px;
  padding: 12px var(--space-md);
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.poet-list__item a:hover {
  background: #FFF7FB;
  text-decoration: none;
}
.poet-list__item a::before {
  content: counter(poet, decimal-leading-zero);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
}
.poet-list__count {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 72px;
  padding: 0;
  background: transparent;
  color: var(--color-muted-foreground);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.3;
  text-align: right;
}
.poet-list__count::after { content: ' bÃ i thÆ¡'; }
.poet-list__count::after { content: '\00a0b\00e0i th\01a1'; }

/* Poems by one author */
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  font-weight: 600;
}
.author-head { margin-bottom: var(--space-lg); }
.poem-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.poem-index__item {
  min-width: 0;
}
.poem-index__button {
  width: 100%;
  min-height: 132px;
  padding: var(--space-md);
  background: var(--color-card);
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.poem-index__button:hover {
  transform: translateY(-4px);
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-lg);
}
.poem-index__number {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
}
.poem-index__title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
}

.dialog-open { overflow: hidden; }
.poem-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(88vh, 900px);
  margin: auto;
  padding: 0;
  color: var(--color-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(76, 5, 34, .28);
  overflow: hidden;
}
.poem-dialog::backdrop {
  background: rgba(76, 5, 34, .58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.poem-dialog__panel {
  max-height: min(88vh, 900px);
  overflow-y: auto;
}
.poem-dialog__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  background: linear-gradient(to bottom, #FFF 82%, rgba(255,255,255,.92));
  border-bottom: 1px solid var(--color-border);
}
.poem-dialog__header .eyebrow { margin-bottom: var(--space-xs); }
.poem-dialog__header h2 { margin-bottom: 4px; }
.poem-dialog__author {
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
}
.poem-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--color-foreground);
  background: var(--color-muted);
  border: 0;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.poem-dialog__close:hover { background: var(--color-border); }
.poem-dialog__body {
  min-height: 220px;
  padding: var(--space-lg);
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 2;
  white-space: pre-wrap;
}

.intro-dialog {
  width: min(960px, calc(100% - 32px));
  max-height: min(90vh, 900px);
  margin: auto;
  padding: 0;
  color: var(--color-foreground);
  background: #1E0C19;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(76, 5, 34, .42);
  overflow: hidden;
}
.intro-dialog::backdrop {
  background: rgba(41, 6, 28, .74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.intro-dialog__panel { max-height: min(90vh, 900px); overflow-y: auto; }
.intro-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  color: #FFF4F8;
  background: linear-gradient(135deg, #4C1234, #7A174F);
}
.intro-dialog__header .eyebrow { margin-bottom: var(--space-xs); color: #F9A8C8; }
.intro-dialog__header h2 { margin-bottom: 0; color: #FFF; }
.intro-dialog__header .poem-dialog__close { color: #FFF4F8; background: rgba(255, 255, 255, .14); }
.intro-dialog__header .poem-dialog__close:hover { background: rgba(255, 255, 255, .25); }
.intro-dialog__body { padding: var(--space-sm); background: #1E0C19; }
.intro-dialog__video { display: block; width: 100%; max-height: calc(90vh - 110px); border-radius: var(--radius-md); background: #000; }
.intro-dialog__seek { display: flex; justify-content: center; gap: var(--space-xs); padding: var(--space-sm) 0 2px; }
.intro-dialog__seek-button {
  min-height: 40px;
  padding: 0 var(--space-sm);
  color: #FFF4F8;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-full);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.intro-dialog__seek-button:hover,
.intro-dialog__seek-button:focus-visible { background: rgba(255, 255, 255, .22); border-color: #F9A8C8; }

/* ============================================================
   Pull quote and trivia
   ============================================================ */
.quote-band {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.pull-quote {
  position: relative;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: 0;
  box-shadow: var(--shadow-sm);
}
.pull-quote__mark {
  position: absolute; top: 14px; left: 18px;
  color: var(--color-secondary); opacity: .45;
}
.pull-quote p {
  font-family: var(--font-display); font-style: italic;
  font-size: var(--text-xl); line-height: 1.6;
  margin: var(--space-md) 0 0; position: relative;
}
.pull-quote footer {
  margin-top: var(--space-md); font-size: var(--text-sm);
  color: var(--color-muted-foreground);
}

.trivia {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.trivia h3 { margin-top: 0; }
.trivia-dialog__body {
  min-height: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  white-space: normal;
}
.trivia-dialog__question {
  max-width: none;
  color: var(--color-muted-foreground);
  white-space: pre-wrap;
}
.trivia-dialog__answer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.75;
  white-space: pre-wrap;
}

/* Recipes */
.recipe-head { margin-bottom: var(--space-lg); }
.recipe-tools {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}
.recipe-tools .input {
  flex: 1;
  min-width: 0;
  border: 0;
  box-shadow: none;
}
.recipe-tools__count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
}
.recipe-tools__count strong { color: var(--color-foreground); }
.recipe-list {
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  list-style: none;
  overflow: hidden;
}
.recipe-list__item { min-width: 0; }
.recipe-list__item[hidden] { display: none; }
.recipe-list__item + .recipe-list__item { border-top: 1px solid var(--color-border); }
.recipe-list__button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(180px, 300px);
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 68px;
  padding: 14px var(--space-md);
  color: var(--color-foreground);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.recipe-list__button:hover { background: #FFF7FB; }
.recipe-list__number {
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
}
.recipe-list__title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}
.recipe-list__contributor {
  color: var(--color-muted-foreground);
  font-size: var(--text-xs);
}
.recipe-empty {
  padding: var(--space-lg);
  color: var(--color-muted-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}
.recipe-dialog__body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.8;
}

/* Story library */
.story-head { margin-bottom: var(--space-lg); }
.story-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.story-category-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: 6px 10px 6px var(--space-sm);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}
.story-category-tab:hover { text-decoration: none; }
.story-category-tab.is-active {
  color: var(--color-on-primary);
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.story-category-tab.is-active .badge {
  color: var(--color-foreground);
  background: #FFFFFF;
}
.story-tools {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}
.story-tools .input {
  flex: 1;
  min-width: 0;
  border: 0;
  box-shadow: none;
}
.story-tools__count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
}
.story-tools__count strong { color: var(--color-foreground); }
.story-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}
.story-list {
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  list-style: none;
  overflow: hidden;
}
.story-list__item { min-width: 0; }
.story-list__item[hidden] { display: none; }
.story-list__item + .story-list__item { border-top: 1px solid var(--color-border); }
.story-list__button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(220px, 340px);
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 68px;
  padding: 14px var(--space-md);
  color: var(--color-foreground);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.story-list__button:hover { background: #FFF7FB; }
.story-list__number {
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
}
.story-list__title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}
.story-list__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-muted-foreground);
  font-size: var(--text-xs);
}
.story-list__chapters { grid-column: 2; white-space: nowrap; }
.story-category-card a {
  display: block;
  min-height: 190px;
  padding: var(--space-lg);
  color: var(--color-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.story-category-card a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.story-category-card h2 { font-size: var(--text-2xl); }
.story-category-card p { color: var(--color-muted-foreground); }
.story-dialog__content { padding: var(--space-lg); }
.story-dialog__controls {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.story-dialog__controls label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-muted-foreground);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.story-dialog__reader {
  min-height: 260px;
  max-width: 68ch;
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 2;
  white-space: pre-wrap;
}

/* Song archive */
.song-head { margin-bottom: var(--space-lg); }
.song-search { margin-bottom: var(--space-md); }
.song-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
}
.song-results-head p { margin: 0; }
.song-results-head strong { color: var(--color-foreground); }
.song-list {
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  list-style: none;
  overflow: hidden;
}
.song-list__item + .song-list__item { border-top: 1px solid var(--color-border); }
.song-list__button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(200px, 320px);
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 72px;
  padding: 12px var(--space-md);
  color: var(--color-foreground);
  background: var(--color-card);
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.song-list__button:hover { background: #FFF7FB; }
.song-list__number {
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
}
.song-list__title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}
.song-list__meta {
  display: grid;
  gap: 4px;
  color: var(--color-muted-foreground);
  font-size: var(--text-xs);
}
.song-list__meta span:empty { display: none; }
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--space-xl);
}
.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}
.pagination__link:hover { text-decoration: none; }
.pagination__link.is-active {
  color: var(--color-on-primary);
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.pagination__step { padding-inline: var(--space-sm); }
.pagination__ellipsis { padding: 0 4px; color: var(--color-muted-foreground); }
.song-dialog__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--space-sm);
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
}
.song-dialog__meta span:empty { display: none; }
.song-dialog__lyrics {
  min-height: 260px;
  max-width: 68ch;
  padding: var(--space-lg);
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 2;
  white-space: pre-wrap;
}

/* Vietnamese lessons */
.lesson-head { margin-bottom: var(--space-lg); }
.lesson-tools {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}
.lesson-tools .input {
  flex: 1;
  min-width: 0;
  border: 0;
  box-shadow: none;
}
.lesson-tools__count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
}
.lesson-tools__count strong { color: var(--color-foreground); }
.lesson-list {
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  list-style: none;
  overflow: hidden;
}
.lesson-list__item { min-width: 0; }
.lesson-list__item[hidden] { display: none; }
.lesson-list__item + .lesson-list__item { border-top: 1px solid var(--color-border); }
.lesson-list__button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(210px, 320px);
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 68px;
  padding: 14px var(--space-md);
  color: var(--color-foreground);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.lesson-list__button:hover { background: #FFF7FB; }
.lesson-list__number {
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
}
.lesson-list__title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}
.lesson-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px var(--space-xs);
  color: var(--color-muted-foreground);
  font-size: var(--text-xs);
}
.lesson-list__meta span + span::before {
  margin-right: var(--space-xs);
  content: '·';
}
.lesson-dialog__body {
  min-height: 260px;
  max-width: 72ch;
  padding: var(--space-lg);
  color: var(--color-foreground);
  font-size: var(--text-base);
  line-height: 1.85;
  white-space: pre-wrap;
}

/* ============================================================
   Forms
   ============================================================ */
.field { display: grid; gap: 6px; margin-bottom: var(--space-sm); }
.field label { font-size: var(--text-sm); font-weight: 600; }
.field__hint { font-size: var(--text-xs); color: var(--color-muted-foreground); }

.input, .select {
  width: 100%; min-height: 48px;
  padding: 0 14px;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--color-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.input:focus, .select:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(219, 39, 119, .18);
}
.input::placeholder { color: #9A8899; }

.radio-row { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; font-weight: 400; font-size: var(--text-sm);
  cursor: pointer;
}

.search-bar {
  display: flex; gap: var(--space-xs); flex-wrap: wrap;
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 6px 6px 6px var(--space-sm);
  box-shadow: var(--shadow-md);
}
.search-bar .input {
  flex: 1 1 220px; min-width: 0;
  border: 0; box-shadow: none; background: transparent;
}
.search-bar .input:focus { box-shadow: none; }

.search-page__form { margin-bottom: var(--space-lg); }
.search-summary {
  margin: 0 0 var(--space-lg);
  color: var(--color-muted-foreground);
}
.search-summary strong { color: var(--color-foreground); }
.search-prompt {
  padding: var(--space-lg);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.search-prompt h2 { margin-bottom: var(--space-xs); font-size: var(--text-xl); }
.search-prompt p { margin: 0; color: var(--color-muted-foreground); }
.search-groups { display: grid; gap: var(--space-lg); }
.search-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}
.search-group__head h2 { margin: 0; font-size: var(--text-2xl); }
.search-results {
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  list-style: none;
  overflow: hidden;
}
.search-result + .search-result { border-top: 1px solid var(--color-border); }
.search-result__action {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(160px, 280px);
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 64px;
  padding: 12px var(--space-md);
  color: var(--color-foreground);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.search-result__action:hover {
  background: #FFF7FB;
  text-decoration: none;
}
.search-result__action:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.search-result__kind {
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.search-result__title {
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}
.search-result__meta { color: var(--color-muted-foreground); font-size: var(--text-xs); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-foreground);
  color: #F9D9E6;
  padding: var(--space-xl) 0 var(--space-md);
  margin-top: var(--space-2xl);
}
.site-footer a { color: #FBCFE8; }
.site-footer a:hover { color: #FFFFFF; }

.footer-grid {
  display: grid; gap: var(--space-lg);
  grid-template-columns: 1.4fr repeat(3, 1fr);
  margin-bottom: var(--space-lg);
}
.site-footer h3 {
  font-family: var(--font-body); font-size: var(--text-xs);
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #F9A8C8; margin-bottom: var(--space-sm);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 6px; }
.site-footer li a {
  display: inline-flex; min-height: 32px; align-items: center;
  font-size: var(--text-sm);
}
.site-footer p { color: #E7B9CE; font-size: var(--text-sm); }

.footer-bottom {
  border-top: 1px solid rgba(251, 207, 232, .22);
  padding-top: var(--space-md);
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  justify-content: space-between;
  font-size: var(--text-sm); color: #E7B9CE;
}

/* ============================================================
   Motion - stagger reveal (Standard tier: 400ms, back-out)
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(16px) scale(.96);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-back);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .poem-index__button:hover, .recipe-list__button:hover,
  .story-list__button:hover, .story-category-card a:hover { transform: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--space-lg); }
  .layout { grid-template-columns: 1fr; gap: var(--space-lg); }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
    --text-4xl: 2.125rem; --text-3xl: 1.75rem;
    --space-2xl: 56px; --space-xl: 40px;
  }
  .brand__banner { width: min(230px, calc(100vw - 116px)); }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--color-card); border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg); padding: var(--space-xs) var(--space-md) var(--space-md);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { min-height: 48px; border-radius: var(--radius-sm); }
  .main-nav__heart { display: none; }
  .quote-band { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .poem-card { padding: var(--space-md); }
  .poem-card__body { font-size: var(--text-base); line-height: 1.8; }
  .pull-quote p { font-size: var(--text-lg); }
  .poet-list__item a {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 64px;
    padding: 12px var(--space-sm);
  }
  .poet-list__count { min-width: 0; }
  .poem-dialog__header { padding: var(--space-md); }
  .poem-dialog__body { padding: var(--space-md); font-size: var(--text-base); }
  .story-dialog__content { padding: var(--space-md); }
  .story-dialog__reader { font-size: var(--text-base); line-height: 1.9; }
  .recipe-list__button {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px var(--space-xs);
    padding: 12px var(--space-sm);
  }
  .recipe-list__contributor { grid-column: 2; }
  .story-list__button {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px var(--space-xs);
    padding: 12px var(--space-sm);
  }
  .story-list__meta { grid-column: 2; }
  .song-dialog__lyrics { padding: var(--space-md); font-size: var(--text-base); line-height: 1.9; }
  .song-list__button {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px var(--space-xs);
    padding: 12px var(--space-sm);
  }
  .song-list__meta { grid-column: 2; }
  .lesson-list__button {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px var(--space-xs);
    padding: 12px var(--space-sm);
  }
  .lesson-list__meta { grid-column: 2; }
  .lesson-dialog__body { padding: var(--space-md); line-height: 1.75; }
  .search-page__form .btn { width: 100%; }
  .search-result__action {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 4px var(--space-xs);
    padding: 12px var(--space-sm);
  }
  .search-result__meta { grid-column: 2; }
}

@media (max-width: 420px) {
  .hero { padding-top: var(--space-lg); }
  .hero__actions .btn { width: 100%; }
}
