:root {
  --paper: #fff4dd;
  --card: #fffdf7;
  --ink: #26201a;
  --ink-2: #5c5347;
  --ink-3: #877b6b;
  --accent: #ff5c2b;
  --accent-hover: #ee4518;
  --mint: #b9e6a6;
  --sky: #a5dcff;
  --rose: #ffb9cc;
  --peach: #ffb07a;
  --shadow-ink: var(--ink);
  --shadow: 4px 4px 0 var(--shadow-ink);
  --shadow-sm: 3px 3px 0 var(--shadow-ink);
  --border: 2px solid var(--ink);
  --radius: 14px;
  --measure: 58ch;
  --dot-ink: #26201a1a;
  --font-display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17130f;
    --card: #231d17;
    --ink: #f4ead8;
    --ink-2: #bdb09c;
    --ink-3: #8c8273;
    --mint: #6f9a5f;
    --sky: #5f90b4;
    --rose: #b4707f;
    --peach: #c07a48;
    --shadow-ink: #000;
    --dot-ink: #f6e8cf14;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(var(--dot-ink) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3, .btn, .step-num, .tab {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.1; margin: 0 0 .6rem; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 .35rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: inherit; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

/* ---- masthead ---- */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.brand img { width: 34px; height: 34px; border: var(--border); border-radius: 10px; background: var(--card); }
.masthead nav { display: flex; gap: .75rem; font-weight: 600; font-size: .95rem; }
.masthead nav a { text-decoration: none; border-bottom: 2px solid transparent; }
.masthead nav a:hover { border-color: var(--accent); }

/* ---- hero ---- */
.hero { padding: 2rem 0 1rem; }
.pill {
  display: inline-block; background: var(--mint); color: var(--ink);
  border: var(--border); border-radius: 999px; box-shadow: var(--shadow-sm);
  padding: .25rem .8rem; font-weight: 700; font-size: .85rem; margin-bottom: 1rem;
}
.lede { font-size: 1.1rem; color: var(--ink-2); }

.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.2rem; border: var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow); font-size: 1rem; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow-ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow-ink); }
.btn-accent { background: var(--accent); color: #fffdf7; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-sky { background: var(--sky); }

/* ---- cards ---- */
.card {
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin: 0 0 1.2rem;
}
section { padding: 2rem 0; }

/* ---- tabs ---- */
.tabs { display: flex; gap: .6rem; margin: 0 0 1.4rem; }
.tab {
  flex: 1; padding: .8rem 1rem; font-size: 1.05rem; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.tab[aria-selected="true"] { background: var(--accent); color: #fffdf7; box-shadow: var(--shadow); }
[hidden] { display: none !important; }

/* ---- steps ---- */
.steps { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1.2rem; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 0 1rem;
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem;
}
.step-num {
  grid-row: span 2; width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center;
  background: var(--peach); color: var(--ink);
  border: var(--border); border-radius: 50%; font-size: 1.05rem;
}
.step-body > :last-child { margin-bottom: 0; }
.step-body p { color: var(--ink-2); }
kbd {
  font-family: var(--font-body); font-weight: 700; font-size: .9em;
  background: var(--sky); border: 1.5px solid var(--ink); border-radius: 6px;
  padding: .05em .4em; box-shadow: 2px 2px 0 var(--shadow-ink);
}

/* ---- media slots ---- */
.shot { margin: .9rem 0 0; }
.shot img, .shot video {
  display: block; width: 100%; max-width: 320px; height: auto;
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  background: var(--paper);
}
.shot video { max-width: 420px; }
.shot figcaption { font-size: .85rem; color: var(--ink-3); margin-top: .4rem; }
/* Ảnh/video chưa có -> hiện khung chờ thay vì icon lỗi */
.shot.missing img, .shot.missing video { display: none; }
.shot.missing::before {
  content: attr(data-placeholder);
  display: grid; place-items: center; text-align: center;
  max-width: 320px; min-height: 160px; padding: 1rem;
  border: 2px dashed var(--ink-3); border-radius: var(--radius);
  color: var(--ink-3); font-size: .9rem;
}

/* ---- faq ---- */
details.card { padding: 0; }
details.card summary {
  padding: .9rem 1.2rem; cursor: pointer; font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
}
details.card[open] summary { border-bottom: var(--border); }
details.card .answer { padding: .9rem 1.2rem; }
details.card .answer > :last-child { margin-bottom: 0; }

/* ---- footer ---- */
footer {
  border-top: var(--border); margin-top: 2rem; padding: 1.5rem 0 2.5rem;
  color: var(--ink-2); font-size: .9rem;
}
footer a { text-decoration: none; border-bottom: 2px solid var(--accent); }

@media (max-width: 560px) {
  .masthead nav { display: none; }
  .tabs { flex-direction: column; }
  .step { grid-template-columns: 1fr; }
  .step-num { grid-row: auto; margin-bottom: .6rem; }
}
