/* Phong Thủy Loan Đầu — warm ink / paper / cinnabar, mobile-first */
:root {
  --ink: #1a120b;
  --ink-2: #2a1d14;
  --paper: #f6efe2;
  --paper-2: #ebe1cf;
  --cinnabar: #b33a2b;
  --cinnabar-deep: #8e2c21;
  --gold: #c6a15b;
  --jade: #3f6b5a;
  --muted: #7a6a58;
  --line: rgba(42, 29, 20, 0.12);
  --shadow: 0 18px 50px rgba(26, 18, 11, 0.12);
  --radius: 1.1rem;
  --font: "Be Vietnam Pro", system-ui, sans-serif;
  --serif: "Noto Serif", "Times New Roman", serif;
  --pad: clamp(1rem, 3vw, 1.75rem);
  --max: 72rem;
  --topbar-h: 3.75rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -5%, rgba(198, 161, 91, 0.18), transparent 55%),
    radial-gradient(700px 380px at 100% 8%, rgba(179, 58, 43, 0.08), transparent 50%),
    linear-gradient(180deg, #fbf6ec 0%, var(--paper) 40%, #f3ead9 100%);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }
a { color: var(--cinnabar-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--cinnabar); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* —— Topbar —— */
.topbar {
  position: sticky; top: 0; z-index: 40;
  min-height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem var(--pad);
  background: rgba(246, 239, 226, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: inherit; text-decoration: none; min-width: 0;
}
.brand-mark {
  flex: 0 0 auto;
  width: 2.35rem; height: 2.35rem; border-radius: 999px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--cinnabar), var(--cinnabar-deep));
  color: var(--paper); font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(179, 58, 43, 0.28);
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block; font-size: 0.95rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58vw;
}
.brand-text small {
  display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.02em;
}

.nav-toggle {
  width: 2.6rem; height: 2.6rem; border: 1px solid var(--line);
  border-radius: 0.75rem; background: var(--paper-2);
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.28rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 1.15rem; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: none; flex-direction: column; gap: 0.15rem;
  padding: 0.75rem var(--pad) 1rem;
  background: rgba(246, 239, 226, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.site-nav.open { display: flex; }
.site-nav a {
  padding: 0.85rem 0.9rem; border-radius: 0.75rem;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.site-nav a:hover,
.site-nav a:focus-visible { background: var(--paper-2); }
.site-nav .nav-cta {
  margin-top: 0.35rem;
  background: var(--ink); color: var(--paper) !important; text-align: center;
}

/* —— Hero —— */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad) 1.5rem;
  display: grid;
  gap: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--cinnabar);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}

h1 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 6.2vw, 3.15rem);
  line-height: 1.18; font-weight: 700;
}
h1 em { color: var(--cinnabar); font-style: normal; }

.hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.12rem);
  max-width: 38rem;
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  margin: 1.35rem 0 1.1rem;
}

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.85rem; padding: 0.7rem 1.15rem;
  border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent;
}
.button.primary {
  background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-deep));
  color: #fff7ef;
  box-shadow: 0 10px 24px rgba(179, 58, 43, 0.25);
}
.button.ghost {
  background: transparent; color: var(--ink); border-color: rgba(42, 29, 20, 0.22);
}

.proof {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.55rem;
}
.proof li {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  color: var(--muted); font-size: 0.88rem;
}
.proof b { color: var(--gold); margin-right: 0.2rem; }

.hero-panel {
  background: linear-gradient(160deg, #2a1d14, #1a120b 60%);
  color: var(--paper);
  border-radius: calc(var(--radius) + 0.35rem);
  padding: 1.25rem 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.bagua-ring {
  position: relative;
  width: min(100%, 18rem);
  aspect-ratio: 1;
  margin: 0.4rem auto 0.9rem;
  border-radius: 50%;
  border: 1px solid rgba(198, 161, 91, 0.35);
  background:
    radial-gradient(circle at center, rgba(198, 161, 91, 0.18) 0 18%, transparent 19%),
    repeating-conic-gradient(from 0deg, rgba(246, 239, 226, 0.04) 0 8deg, transparent 8deg 16deg);
}
.dir {
  position: absolute; text-align: center; font-size: 0.78rem; line-height: 1.25; font-weight: 600;
  color: #f6efe2;
}
.dir small { display: block; color: rgba(246, 239, 226, 0.62); font-weight: 500; font-size: 0.68rem; }
.dir.n { left: 50%; top: 8%; transform: translateX(-50%); }
.dir.s { left: 50%; bottom: 8%; transform: translateX(-50%); }
.dir.e { right: 6%; top: 50%; transform: translateY(-50%); }
.dir.w { left: 6%; top: 50%; transform: translateY(-50%); }
.dir.center {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 4.2rem; height: 4.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold), #a8843d);
  color: var(--ink); font-family: var(--serif); font-size: 0.95rem;
}
.panel-note {
  margin: 0; text-align: center; color: rgba(246, 239, 226, 0.7); font-size: 0.86rem;
}

/* —— Sections —— */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem var(--pad) 2rem;
}
.section.soft {
  background: rgba(255, 255, 255, 0.35);
  border-block: 1px solid var(--line);
}
.section-head { max-width: 40rem; margin-bottom: 1.25rem; }
.section-head h2 {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4vw, 2rem);
}
.section-head p { margin: 0; color: var(--muted); }

.feature-grid {
  display: grid;
  gap: 0.85rem;
}
.feature {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.05rem;
}
.feature .num {
  display: inline-block; color: var(--gold); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em;
}
.feature h3 { margin: 0.35rem 0 0.35rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.steps {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 0.75rem;
}
.steps li {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cinnabar);
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
}

/* —— Curriculum —— */
.curriculum { display: grid; gap: 0.75rem; }
.module {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
}
.module summary {
  list-style: none; cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem 1rem;
}
.module summary::-webkit-details-marker { display: none; }
.module summary .count {
  grid-column: 2;
  color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem;
}
.mod-code {
  width: 2.1rem; height: 2.1rem; border-radius: 0.65rem;
  display: grid; place-items: center;
  background: rgba(179, 58, 43, 0.1); color: var(--cinnabar);
  font-weight: 700;
}
.module summary strong { display: block; }
.module summary small { color: var(--muted); font-weight: 400; }

.lessons {
  list-style: none; margin: 0; padding: 0 0.65rem 0.75rem;
}
.lessons li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 0.8rem 0.45rem;
  border-top: 1px solid var(--line);
}
.lessons b { color: var(--cinnabar-deep); margin-right: 0.25rem; }
.lessons em { display: block; color: var(--muted); font-style: normal; font-size: 0.9rem; margin-top: 0.15rem; }
.st {
  justify-self: start;
  font-size: 0.78rem; color: var(--muted);
  background: var(--paper-2); border-radius: 999px; padding: 0.25rem 0.6rem;
}
.st-rendered, .st-published { color: var(--jade); background: rgba(63, 107, 90, 0.12); }

.site-footer {
  margin-top: 1rem;
  padding: 2rem var(--pad) calc(2.5rem + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-brand { display: grid; gap: 0.15rem; margin-bottom: 0.55rem; }
.footer-brand strong { color: var(--ink); font-family: var(--serif); }

/* —— Tablet —— */
@media (min-width: 720px) {
  .brand-text strong { max-width: none; font-size: 1rem; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .lessons li {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .module summary {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  .module summary .count { grid-column: auto; margin-top: 0; }
  .hero-panel { padding: 1.5rem; }
}

/* —— Laptop / desktop —— */
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static; display: flex !important;
    flex-direction: row; align-items: center; gap: 0.35rem;
    padding: 0; background: transparent; border: 0; box-shadow: none;
  }
  .site-nav a { padding: 0.55rem 0.8rem; font-size: 0.95rem; }
  .site-nav .nav-cta {
    margin-top: 0; margin-left: 0.35rem;
    padding-inline: 0.95rem;
  }

  .hero {
    grid-template-columns: 1.25fr 0.9fr;
    align-items: center;
    gap: 2.5rem;
    padding-top: 3rem; padding-bottom: 2.5rem;
  }
  .section { padding-block: 2.5rem; }
}

/* Very small phones */
@media (max-width: 360px) {
  .brand-text small { display: none; }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
}

/* Curriculum lesson links */
.lessons .lesson-link {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  text-decoration: none;
  color: inherit;
  width: 100%;
}
.lessons .lesson-link:hover b {
  color: var(--cinnabar, #b23a2e);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Auth bar + locks */
.auth-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
  width: min(1100px, calc(100% - 2rem));
  margin: 0.5rem auto 0;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line, #d9c4a8);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  color: var(--ink-soft, #3d2e24);
}
.auth-bar-btn { margin: 0; }
.auth-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}
.auth-pill.ok { background: rgba(91, 184, 122, 0.2); color: #1b6b3a; }
.auth-pill.no { background: rgba(224, 138, 122, 0.25); color: #8b1e14; }
.lessons .st-gated::after {
  content: " · khóa";
  font-weight: 600;
  opacity: 0.85;
}
.lesson-lock {
  margin: 1rem auto;
  width: min(920px, calc(100% - 2rem));
  text-align: left;
}
.login-card {
  max-width: 28rem;
  margin: 2rem auto;
}
.login-card h1 {
  font-family: "Noto Serif", Georgia, serif;
  margin: 0.25rem 0 0.75rem;
}
