/* study.cokavi.com — design system (vanilla, no build).
   Hướng: editorial / luxury. Palette: kem (nền) + emerald (chính) + gold (nhấn).
   KHUNG SCAFFOLD — tokens + base + nav/footer. Trang chi tiết sẽ polish khi execute. */

:root {
  /* ----- màu ----- */
  --cream:      #f7f2e7;   /* nền chính */
  --cream-2:    #efe7d4;   /* surface dịu */
  --ink:        #1b1a14;   /* chữ chính */
  --ink-soft:   #4d4a3d;   /* chữ phụ */
  --emerald:    #0f6b4f;   /* thương hiệu chính */
  --emerald-2:  #0b513c;   /* emerald đậm */
  --gold:       #c39b3f;   /* nhấn cao cấp */
  --gold-soft:  #e3c87f;
  --line:       rgba(27, 26, 20, .12);
  --danger:     #b4452f;

  /* ----- typography ----- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-mono:    'Space Mono', ui-monospace, monospace;

  --text-hero: clamp(2.6rem, 1.4rem + 5vw, 5rem);
  --text-h2:   clamp(1.6rem, 1.1rem + 2vw, 2.6rem);
  --text-base: clamp(1rem, .95rem + .25vw, 1.125rem);

  /* ----- nhịp & hình ----- */
  --space-section: clamp(3.5rem, 2.5rem + 4vw, 8rem);
  --radius:    14px;
  --radius-lg: 22px;
  --shadow:    0 18px 50px -28px rgba(11, 81, 60, .45);

  --duration: 240ms;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand { font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: min(1140px, 92vw); margin-inline: auto; }

/* grain phủ nhẹ tạo chất giấy editorial */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .5;
  background-image: radial-gradient(rgba(27,26,20,.04) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 1.5rem; padding: 1rem 0; }
.brand { font-size: 1.4rem; display: inline-flex; align-items: center; gap: .5rem; }
.brand em { color: var(--gold); font-style: italic; font-weight: 500; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--emerald); }
.nav-links { display: flex; gap: 1.4rem; margin-left: 1rem; }
.nav-links a { color: var(--ink-soft); font-weight: 500; }
.nav-links a.active, .nav-links a:hover { color: var(--emerald); }
.nav-auth { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.nav-auth .link { color: var(--ink-soft); font-weight: 500; }
.nav-cta {
  background: var(--emerald); color: var(--cream);
  padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600;
  transition: background var(--duration) var(--ease);
}
.nav-cta:hover { background: var(--emerald-2); }
.burger { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; }
.burger span { width: 24px; height: 2px; background: var(--ink); display: block; }

@media (max-width: 820px) {
  .nav-links, .nav-auth { display: none; }
  .nav.open .nav-links, .nav.open .nav-auth {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream); padding: 1rem 4vw; border-bottom: 1px solid var(--line); margin: 0; gap: 1rem;
  }
  .burger { display: flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; cursor: pointer; font-family: inherit; font-weight: 600;
  padding: .8rem 1.4rem; border-radius: 999px; transition: all var(--duration) var(--ease);
}
.btn-em { background: var(--emerald); color: var(--cream); }
.btn-em:hover { background: var(--emerald-2); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }

/* ---------- layout helpers ---------- */
main { position: relative; z-index: 2; min-height: 60vh; }
.section { padding-block: var(--space-section); }
.tag {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--emerald);
}
.card {
  background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.muted { color: var(--ink-soft); }
.placeholder {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 2rem; text-align: center; color: var(--ink-soft); font-family: var(--font-mono); font-size: .9rem;
}

/* ---------- footer ---------- */
.foot { background: var(--emerald-2); color: var(--cream); margin-top: var(--space-section); position: relative; z-index: 2; }
.foot .wrap { padding-block: 3rem 1.5rem; }
.fgrid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.foot .brand { color: var(--cream); }
.foot .brand .dot { background: var(--gold); }
.foot h4 { font-family: var(--font-body); font-size: .95rem; margin-bottom: .8rem; color: var(--gold-soft); }
.fcol a { display: block; color: rgba(247,242,231,.8); padding: .2rem 0; }
.fcol a:hover { color: var(--cream); }
.fbrand p { color: rgba(247,242,231,.7); margin-top: .8rem; max-width: 34ch; }
.fbar {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid rgba(247,242,231,.15); margin-top: 2rem; padding-top: 1.2rem;
  font-size: .85rem; color: rgba(247,242,231,.65);
}
@media (max-width: 820px) { .fgrid { grid-template-columns: 1fr 1fr; } }

/* ---------- toast ---------- */
.toast-host { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 100; display: grid; gap: .6rem; }
.toast {
  background: var(--ink); color: var(--cream); padding: .8rem 1.2rem; border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 320px; font-size: .95rem;
}
.toast-error { background: var(--danger); }
.toast-success { background: var(--emerald); }

/* ---------- auth (login/register) ---------- */
.authwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding-block: var(--space-section); }
.authside .tag { display: inline-block; margin-bottom: 1rem; }
.authside h2 { font-size: var(--text-h2); margin-bottom: 1rem; }
.formcard { background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow); }
.formcard h1 { font-size: var(--text-h2); margin-bottom: .3rem; }
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field label { font-weight: 500; font-size: .9rem; }
.field input {
  font-family: inherit; font-size: 1rem; padding: .75rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream);
}
.field input:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
.swap, .note { font-size: .9rem; color: var(--ink-soft); margin-top: 1rem; }
.swap a, .note a { color: var(--emerald); font-weight: 600; }
@media (max-width: 820px) { .authwrap { grid-template-columns: 1fr; } .authside { display: none; } }

/* ---------- catalog grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.pcard { background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform var(--duration) var(--ease); }
.pcard:hover { transform: translateY(-4px); }
.pcard .pbody { padding: 1.2rem; }
.pcard .ptype { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; color: var(--gold); letter-spacing: .08em; }
.pcard h3 { font-size: 1.15rem; margin: .3rem 0 .6rem; }
.pcard .price { font-weight: 700; color: var(--emerald); }
