/* ── CSS VARIABLES ──────────────────────────────────────────────────────── */
:root {
  --bg:        #f6f2e9;
  --surface:   #fffdf9;
  --alt:       #efe9dc;
  --border:    #e4ddcc;
  --border-hi: #c9bda4;
  --accent:    #9a6a16;      /* antique gold */
  --accent-2:  #c69537;      /* bright gilt */
  --accent-lo: rgba(154,106,22,0.10);
  --teal:      #127d77;      /* verdigris — ties in the CB logo */
  --teal-dk:   #0c302c;
  --ink:       #0c211e;      /* deep classical green-ink (dark surfaces) */
  --text:      #211e18;
  --text-mid:  #565047;
  --text-dim:  #978f80;
  --green:     #1f6b4a;
  --nav-bg:    #0c1a18;
  --nav-h:     60px;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(33,30,24,0.04), 0 1px 3px rgba(33,30,24,0.05);
  --shadow-md: 0 6px 16px rgba(33,30,24,0.08), 0 2px 5px rgba(33,30,24,0.05);
  --shadow-lg: 0 22px 48px rgba(33,30,24,0.14), 0 8px 18px rgba(33,30,24,0.08);
  --ring:      0 0 0 3px var(--accent-lo);
}

/* ── RESET & BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: Inter, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(18,125,119,0.05), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(198,149,55,0.07), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed, scroll;
}
::selection { background: rgba(198,149,55,0.28); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── NAV BAR ────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: linear-gradient(180deg, #11302b 0%, #0c1a18 100%);
  border-bottom: 1px solid rgba(198,149,55,0.18);
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 8px 28px rgba(0,0,0,0.22);
}
.navbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198,149,55,0.5), transparent);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Brand (logo + name) */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 32px;
}
.nav-logo {
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(201,151,58,0.25);
  transition: transform 0.2s ease;
}
.nav-brand:hover .nav-logo { transform: scale(1.06); }
.nav-brand-text {
  font-size: 1.06rem;
  font-weight: 500;
  color: #f4f1ea;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-brand-text strong {
  font-weight: 700;
  color: var(--accent-2);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  position: relative;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(245,241,233,0.62);
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.nav-link.active {
  color: #fff;
  font-weight: 600;
  background: rgba(198,149,55,0.14);
}
.nav-link.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: var(--accent-2); border-radius: 2px;
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-signin-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #b07d28, #9a6612);
  color: #fff;
  box-shadow: 0 2px 8px rgba(154,102,18,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-signin-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(154,102,18,0.45); }

/* Avatar + dropdown */
.nav-user-menu { position: relative; }
.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3500, #c9773a);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.nav-avatar:hover { border-color: var(--accent); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none;
  z-index: 200;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-header {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-size: 0.86rem;
  color: var(--text-mid);
  border-radius: 6px;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav-dropdown-item:hover {
  background: var(--alt);
  color: var(--text);
}
.nav-logout-btn { color: #fc8181; }
.nav-logout-btn:hover { background: rgba(252,129,129,0.1); }
.nav-dropdown-session {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.nav-session-row { font-size: 0.8rem; color: var(--text-mid); line-height: 1.7; }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-mid);
  border-radius: 2px;
  transition: 0.2s;
}

/* ── PAGE MAIN ──────────────────────────────────────────────────────────── */
.page-main {
  margin-top: var(--nav-h);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 40px 24px 80px;
}

/* ── HERO BAND ──────────────────────────────────────────────────────────── */
.cb-hero-band {
  background:
    linear-gradient(135deg, #0c302c 0%, #103a32 42%, #14463a 72%, #1a5a44 100%);
  border-radius: 18px;
  padding: 3.6rem 3.2rem 3.2rem;
  margin-bottom: 2.6rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(198,149,55,0.22);
}
.cb-hero-band::before {
  content: '';
  position: absolute;
  top: -45%; right: -8%;
  width: 62%; height: 170%;
  background: radial-gradient(ellipse at center, rgba(198,149,55,0.22), transparent 68%);
  pointer-events: none;
}
/* faint Greek-key corner motif */
.cb-hero-band::after {
  content: '';
  position: absolute; inset: 14px;
  border: 1px solid rgba(198,149,55,0.16);
  border-radius: 12px;
  pointer-events: none;
}
.cb-hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr minmax(220px, 320px);
  align-items: center; gap: 28px;
}
.cb-hero-art { position: relative; }
.cb-hero-art img { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35)); }
.cb-hero-photo { margin: 0; }
.cb-hero-photo img {
  width: 100%; height: auto; display: block;
  border-radius: 14px;
  border: 1px solid rgba(198,149,55,0.45);
  box-shadow: 0 16px 36px rgba(0,0,0,0.42);
  filter: sepia(0.22) saturate(1.05) contrast(1.02);
}
.cb-hero-photo figcaption {
  margin-top: 8px; text-align: right;
  font-size: 0.68rem; letter-spacing: 0.04em;
  color: rgba(244,240,231,0.5);
}
.cb-hero-photo figcaption a { color: rgba(220,180,110,0.85); text-decoration: none; }
.cb-hero-photo figcaption a:hover { color: var(--accent-2); text-decoration: underline; }
.cb-hero-band > *:not(.cb-hero-grid) { position: relative; z-index: 1; }
@media (max-width: 760px) {
  .cb-hero-grid { grid-template-columns: 1fr; }
  .cb-hero-art { display: none; }
}
.cb-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--accent-2);
  margin-bottom: 16px; font-family: Inter, sans-serif;
}
.cb-hero-eyebrow::before {
  content: ''; width: 26px; height: 1.5px; background: var(--accent-2); opacity: 0.7;
}
.cb-hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.2rem; font-weight: 700; color: #f7f2e8;
  letter-spacing: -0.02em; line-height: 1.08; margin-bottom: 18px;
}
.cb-hero-sub {
  font-size: 0.98rem; color: rgba(244,240,231,0.78);
  max-width: 540px; line-height: 1.75; margin-bottom: 22px;
}
.cb-hero-quote {
  font-family: 'Playfair Display', Georgia, serif; font-style: italic;
  font-size: 0.95rem; color: rgba(220,180,110,0.9); line-height: 1.5;
  padding-left: 14px; border-left: 2px solid rgba(198,149,55,0.45);
}
.cb-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 24px; }
.cb-hero-cta .btn-ghost {
  background: rgba(255,253,249,0.08); color: #f7f2e8;
  border: 1px solid rgba(247,242,232,0.22); backdrop-filter: blur(4px);
}
.cb-hero-cta .btn-ghost:hover { background: rgba(255,253,249,0.16); border-color: rgba(247,242,232,0.4); transform: translateY(-1px); }

/* ── FEATURE CARDS ──────────────────────────────────────────────────────── */
.cb-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 2.5rem;
}
@media (max-width: 800px) { .cb-feature-grid { grid-template-columns: 1fr; } }

.cb-feature-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
  overflow: hidden;
}
.cb-feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.cb-feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--border-hi); }
.cb-feature-icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(154,106,22,0.12), rgba(198,149,55,0.06));
  border: 1px solid rgba(154,106,22,0.22);
  color: var(--accent);
}
.cb-feature-icon svg { width: 26px; height: 26px; display: block; }
.cb-feature-bar { width: 32px; height: 3px; border-radius: 2px; margin-bottom: 14px; }
.cb-feature-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.cb-feature-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.18rem; font-weight: 700; color: var(--text);
  margin-bottom: 10px; line-height: 1.25; letter-spacing: -0.01em;
}
.cb-feature-body {
  font-size: 0.86rem; color: var(--text-mid); line-height: 1.68;
}

/* ── PAGE HEADER (used on inner pages) ─────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-header::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 64px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.page-header-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 8px; font-family: Inter, sans-serif;
}
.page-header-eyebrow::before {
  content: ''; width: 22px; height: 1.5px; background: var(--accent); opacity: 0.6;
}
.page-header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.25rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.1;
}
.page-header-sub {
  color: var(--text-mid); font-size: 0.9rem; margin-top: 8px;
  max-width: 600px; line-height: 1.55;
}

/* ── DECORATIVE BANNER SVG ──────────────────────────────────────────────── */
.page-banner { width: 100%; border-radius: 10px; overflow: hidden; margin-bottom: 1.8rem; display: block; }

/* ── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 9px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s, border-color 0.15s, color 0.15s;
  border: none; gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, #b07d28, #9a6612); color: #fff;
  box-shadow: 0 2px 8px rgba(154,102,18,0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(154,102,18,0.38); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline {
  background: var(--surface); color: var(--text-mid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ── FORM INPUTS ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-mid);
  margin-bottom: 6px; letter-spacing: 0.01em;
}
.form-input {
  width: 100%; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lo); }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── CARDS / PANELS ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-sm { padding: 16px; }
.card-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.card-sub { font-size: 0.82rem; color: var(--text-mid); }

/* ── CHIPS / PILLS ──────────────────────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text-mid); cursor: pointer;
  background: var(--surface); transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.selected {
  background: linear-gradient(135deg, #b07d28, #9a6612); border-color: transparent;
  color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(154,106,22,0.28);
}

/* ── SEGMENTED CONTROL ──────────────────────────────────────────────────── */
.seg-control {
  display: inline-flex; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--alt); padding: 3px; gap: 2px;
}
.seg-btn {
  padding: 6px 16px; font-size: 0.82rem; font-weight: 500; color: var(--text-mid);
  cursor: pointer; transition: all 0.15s; background: transparent; border: none; border-radius: 7px;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--surface); color: var(--accent); font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ── CHAT ───────────────────────────────────────────────────────────────── */
.chat-wrap { display: flex; flex-direction: column; gap: 0; }
.chat-input-area {
  display: flex; gap: 10px; margin-bottom: 24px; align-items: flex-end;
}
.chat-input {
  flex: 1; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 0.92rem; resize: none;
  outline: none; transition: border-color 0.15s; line-height: 1.5;
  min-height: 48px; max-height: 200px;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lo); }
.chat-send-btn {
  padding: 12px 20px; background: linear-gradient(135deg, #b07d28, #9a6612); color: #fff;
  border-radius: 10px; font-weight: 600; font-size: 0.88rem;
  white-space: nowrap; transition: transform 0.15s, box-shadow 0.15s;
  height: 48px; box-shadow: 0 2px 8px rgba(154,102,18,0.28);
}
.chat-send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(154,102,18,0.38); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chat-chip {
  padding: 5px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s; border: none;
}
.chat-chip:hover { opacity: 0.82; }
.chip-myth     { background: #6b2100; color: #f5d9b8; }
.chip-history  { background: #1a3a5c; color: #c8e0f4; }
.chip-language { background: #1a3a20; color: #b8e8c8; }
.chip-culture  { background: #2a1a40; color: #d8c8f0; }

.chat-history { display: flex; flex-direction: column; gap: 20px; }
.chat-item { display: flex; flex-direction: column; gap: 10px; }
.chat-user-bubble {
  align-self: flex-end;
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: 12px 12px 4px 12px;
  padding: 10px 16px;
  max-width: 75%;
  font-size: 0.9rem; color: var(--text);
}
.chat-bot-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  padding: 14px 18px;
  max-width: 90%;
}
.chat-bot-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.chat-bot-body { font-size: 0.9rem; color: var(--text); line-height: 1.7; }
.chat-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-source-chip {
  padding: 3px 10px; border-radius: 4px; font-size: 0.72rem; font-weight: 600;
  background: var(--accent-lo); color: var(--accent); border: 1px solid rgba(201,151,58,0.2);
}
.chat-divider {
  height: 1px; background: var(--border); margin: 8px 0;
}

/* Source excerpts accordion */
.chat-excerpts-toggle {
  font-size: 0.76rem; color: var(--text-dim); cursor: pointer;
  background: none; border: none; margin-top: 6px;
  padding: 0; text-align: left;
}
.chat-excerpts-toggle:hover { color: var(--text-mid); }
.chat-excerpts { display: none; margin-top: 10px; }
.chat-excerpts.open { display: block; }
.chat-excerpt-item {
  background: var(--alt); border-radius: 6px; padding: 10px 12px;
  margin-bottom: 8px; font-size: 0.8rem; color: var(--text-mid); line-height: 1.6;
}
.chat-excerpt-source { font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* Chat spinner */
.chat-spinner {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; color: var(--text-dim); padding: 12px 0;
}
.spinner-dots span {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%; margin-right: 4px;
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.spinner-dots span:nth-child(2) { animation-delay: 0.2s; }
.spinner-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── QUESTIONS PAGE ─────────────────────────────────────────────────────── */
.q-controls { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.q-controls-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
@media (max-width: 640px) { .q-controls-row { grid-template-columns: 1fr; } }
.q-control-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}
.q-num-slider { width: 100%; accent-color: var(--accent); }
.q-num-label { font-size: 0.88rem; color: var(--text-mid); }

.q-output { display: flex; flex-direction: column; gap: 18px; }
.q-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

/* Skeleton placeholders shown while questions generate */
.q-skeleton-note {
  text-align: center; font-size: 0.85rem; color: var(--text-dim); padding: 4px 0 2px;
}
.q-skel-line {
  height: 12px; border-radius: 6px; margin: 10px 0;
  background: linear-gradient(90deg, var(--border) 25%, var(--accent-lo) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: q-shimmer 1.4s ease-in-out infinite;
}
.q-skel-badge { width: 64px; height: 18px; margin: 0 0 14px; border-radius: 4px; }
.q-skel-line.w80 { width: 80%; }
.q-skel-line.w60 { width: 60%; }
.q-skel-line.w35 { width: 35%; margin-top: 18px; }
@keyframes q-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .q-skel-line { animation: none; } }
.q-badge {
  display: inline-block; border-radius: 4px; padding: 2px 9px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 12px;
}
.badge-myth     { background: #fff3e6; color: #7c3500; border: 1px solid #c9773a; }
.badge-history  { background: #e8f2fa; color: #1a3a5c; border: 1px solid #4a7fa8; }
.badge-language { background: #e8f6ee; color: #1a4028; border: 1px solid #3a8a5a; }
.badge-culture  { background: #faeaea; color: #5c1a1a; border: 1px solid #a84a4a; }
.badge-literature { background: #f0eaf8; color: #2e1a5c; border: 1px solid #7a5aaa; }

.q-question { font-size: 0.95rem; color: var(--text); line-height: 1.7; margin-bottom: 14px; white-space: pre-wrap; }
.q-answer-row { display: flex; align-items: center; gap: 10px; }
.q-answer-label { font-size: 0.72rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.q-answer {
  display: none; font-size: 0.95rem; font-weight: 700; color: var(--accent);
}
.q-answer.revealed { display: inline; }
.q-reveal-btn {
  font-size: 0.78rem; padding: 4px 12px; border-radius: 6px;
  background: var(--alt); border: 1px solid var(--border);
  color: var(--text-mid); cursor: pointer; transition: all 0.14s;
}
.q-reveal-btn:hover { border-color: var(--accent); color: var(--accent); }
.q-reveal-btn.hidden { display: none; }

/* Bonus section */
.q-bonus-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.q-bonus-gate { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.q-bonus-section .q-bonus-gate { border-top: none; padding-top: 0; }
.q-bonus-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}

/* Empty state */
.q-empty {
  text-align: center; padding: 60px 0;
  font-size: 0.9rem; color: var(--text-dim);
}

/* ── SCANSION PAGE ──────────────────────────────────────────────────────── */
.scan-input-area { margin-bottom: 28px; }
.scan-input-row { display: flex; gap: 10px; align-items: flex-end; }
.scan-text-input {
  flex: 1; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 1rem; font-family: 'Playfair Display', Georgia, serif; font-style: italic;
  outline: none; transition: border-color 0.15s;
}
.scan-text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lo); }
.scan-text-input::placeholder { color: var(--text-dim); font-style: italic; }

.scan-result {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 20px; display: none; box-shadow: var(--shadow-sm);
}
.scan-result.visible { display: block; }
.scan-result-line {
  font-family: monospace; font-size: 1.2rem; color: var(--text);
  letter-spacing: 0.06em; margin-bottom: 16px; line-height: 1.8;
}
.scan-feet { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.scan-foot {
  display: inline-block; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 14px; font-family: monospace; font-size: 0.9rem;
  background: var(--alt); color: var(--text);
}
.scan-dactyl { border-color: var(--accent); color: var(--accent); background: rgba(201,151,58,0.08); }
.scan-spondee { border-color: #4a7fa0; color: #4a7fa0; background: rgba(74,127,160,0.08); }
.scan-not-found { color: var(--text-mid); font-size: 0.9rem; }

.scan-mosaic-row {
  display: flex; gap: 6px; margin-bottom: 1.6rem; height: 72px;
}
.scan-tile {
  flex: 1; border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 8px 4px;
  position: relative; overflow: hidden;
}
.scan-tile-symbol { font-family: monospace; font-size: 1.3rem; font-weight: 400; line-height: 1; }
.scan-tile-label { font-size: 0.55rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.scan-tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.45s;
}
.scan-tile:hover::after { transform: translateX(100%); }

/* Sub-nav tabs (How to scan / Practice / Lookup) */
.scan-subnav { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.scan-tab {
  padding: 10px 16px; font-size: 0.88rem; font-weight: 500; color: var(--text-mid);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.14s;
  background: none; border-top: none; border-left: none; border-right: none;
}
.scan-tab:hover { color: var(--text); }
.scan-tab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }

.scan-section { display: none; }
.scan-section.active { display: block; }

.scan-h2 {
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin: 1.6rem 0 0.6rem; border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.scan-h3 {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin: 1.1rem 0 0.4rem;
}
.scan-rule {
  background: var(--alt); border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 10px 0;
  font-size: 0.87rem; color: var(--text-mid); line-height: 1.65;
}
.scan-note {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 16px; margin: 8px 0; font-size: 0.85rem; color: var(--text-mid); line-height: 1.65;
}
.scan-example {
  font-family: monospace; background: var(--alt); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 10px; display: inline-block;
  font-size: 0.9rem; color: var(--text); margin: 2px 0;
}

/* ── RESOURCES ──────────────────────────────────────────────────────────── */
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 2rem; }
@media (max-width: 680px) { .res-grid { grid-template-columns: 1fr; } }
.res-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.res-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.res-card-eyebrow {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.res-card-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.res-card-body { font-size: 0.85rem; color: var(--text-mid); margin-bottom: 16px; line-height: 1.55; }
.res-card-link {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 0.8rem; font-weight: 600; padding: 7px 18px; border-radius: 6px;
  text-decoration: none; transition: opacity 0.15s;
}
.res-card-link:hover { opacity: 0.86; }

/* ── ACCOUNT PAGE ───────────────────────────────────────────────────────── */
.acc-hero {
  width: 100%; height: 180px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #0c302c 0%, #103a32 45%, #14463a 72%, #1a5a44 100%);
  position: relative; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.acc-hero-border {
  position: absolute; inset: 3px; border-radius: 9px;
  border: 1.5px solid rgba(201,151,58,0.45); pointer-events: none;
}
.acc-hero-stripe {
  position: absolute; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, transparent 0%, rgba(201,151,58,0.7) 50%, transparent 100%);
}
.acc-hero-stripe-top { top: 0; }
.acc-hero-stripe-bot { bottom: 0; }
.acc-hero-center { position: relative; z-index: 1; text-align: center; }
.acc-hero-label {
  font-family: 'Playfair Display', Georgia, serif; font-size: 13px; font-style: italic;
  letter-spacing: 6px; text-transform: uppercase; color: rgba(201,151,58,0.7); margin-bottom: 6px;
}
.acc-hero-title {
  font-family: 'Playfair Display', Georgia, serif; font-size: 46px; font-weight: 700;
  color: #fff; letter-spacing: -1px; line-height: 1;
}
.acc-hero-sub {
  margin-top: 8px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,220,160,0.55);
}

.acc-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.acc-tab {
  padding: 10px 20px; font-size: 0.88rem; font-weight: 500; color: var(--text-mid);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; border-top: none; border-left: none; border-right: none;
  transition: color 0.14s;
}
.acc-tab:hover { color: var(--text); }
.acc-tab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.acc-tab-content { display: none; }
.acc-tab-content.active { display: block; }

.acc-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3500, #c9773a);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff;
  border: 3px solid var(--accent); margin-bottom: 12px;
}
.acc-username { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.acc-email { font-size: 0.85rem; color: var(--text-dim); margin-top: 2px; }

.acc-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
@media (max-width: 600px) { .acc-stat-grid { grid-template-columns: 1fr 1fr; } }
.acc-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 18px; text-align: center;
}
.acc-stat-num { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.acc-stat-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* Auth forms (login/register) */
.auth-card {
  max-width: 400px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-title { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-sub { font-size: 0.85rem; color: var(--text-mid); margin-bottom: 24px; }
.auth-switch { font-size: 0.84rem; color: var(--text-mid); text-align: center; margin-top: 18px; }
.auth-switch a { color: var(--accent); cursor: pointer; }

/* ── HOME ABOUT SECTION ─────────────────────────────────────────────────── */
.home-about-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; margin-top: 2rem; }
@media (max-width: 700px) { .home-about-grid { grid-template-columns: 1fr; } }

/* ── ALERTS / TOAST ─────────────────────────────────────────────────────── */
.alert {
  padding: 10px 16px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px;
  border: 1px solid;
}
.alert-error { background: rgba(252,129,129,0.1); border-color: rgba(252,129,129,0.3); color: #fc8181; }
.alert-success { background: rgba(104,211,145,0.1); border-color: rgba(104,211,145,0.3); color: var(--green); }
.alert-info { background: var(--accent-lo); border-color: rgba(201,151,58,0.25); color: var(--accent); }

/* ── LOADING SPINNER ────────────────────────────────────────────────────── */
.loading-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,17,23,0.7);
  z-index: 2000; align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── STATS PAGE ─────────────────────────────────────────────────────────── */
.stats-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
@media (max-width: 900px) { .stats-metric-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .stats-metric-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-metric:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1rem; font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em; line-height: 1.1;
}
.stat-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-mid); margin-top: 6px;
}
.stats-table {
  width: 100%; border-collapse: collapse; font-size: 0.86rem;
}
.stats-table th {
  text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 8px 14px; border-bottom: 2px solid var(--border);
}
.stats-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-mid);
}
.stats-table tr:last-child td { border-bottom: none; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-main { padding: 28px 16px 60px; }
  .cb-hero-title { font-size: 2rem; }
  .cb-hero-band { padding: 2rem 1.5rem; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; background: var(--nav-bg);
    border-bottom: 1px solid var(--border); padding: 12px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }
  .nav-link { border-radius: 6px; }
  .nav-inner { position: relative; }
}

/* ══ REDESIGN ADDITIONS ════════════════════════════════════════════════════ */

/* ── SECTION HEADINGS (home) ────────────────────────────────────────────── */
.cb-section-head {
  display: flex; align-items: center; gap: 16px;
  margin: 2.6rem 0 1.4rem;
}
.cb-section-head h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
  white-space: nowrap;
}
.cb-section-head .cb-rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-hi), transparent);
}
.cb-section-eyebrow {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}

/* ── DECORATIVE MEANDER DIVIDER ─────────────────────────────────────────── */
.cb-meander {
  display: block; width: 100%; height: 24px; margin: 2.4rem 0;
  color: var(--accent);
  opacity: 0.5;
  background-repeat: repeat-x; background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cpath fill='none' stroke='%239a6a16' stroke-width='1.6' d='M2 18 H14 V8 H8 V14 H20 V4 H26 V18 H38 V8 H32 V14 H44'/%3E%3C/svg%3E");
}

/* ── HOW-IT-WORKS / STEPS ───────────────────────────────────────────────── */
.cb-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .cb-steps { grid-template-columns: 1fr; } }
.cb-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow-sm); position: relative;
}
.cb-step-num {
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.5rem; font-weight: 700;
  color: var(--accent-2); line-height: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(154,106,22,0.08); border: 1px solid rgba(154,106,22,0.2);
  margin-bottom: 14px;
}
.cb-step-title { font-weight: 700; color: var(--text); margin-bottom: 6px; font-size: 0.98rem; }
.cb-step-body { font-size: 0.84rem; color: var(--text-mid); line-height: 1.65; }

/* ── EMPTY-STATE ILLUSTRATIONS ──────────────────────────────────────────── */
.cb-empty {
  text-align: center; padding: 54px 24px;
  color: var(--text-dim); font-size: 0.92rem;
}
.cb-empty img, .cb-empty svg {
  width: 116px; height: auto; margin: 0 auto 18px; display: block; opacity: 0.92;
}
.cb-empty-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; color: var(--text-mid); margin-bottom: 4px; }

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 64px;
  background: linear-gradient(180deg, #0c1a18, #0a1513);
  color: rgba(244,240,231,0.7);
  position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background-repeat: repeat-x; background-position: center; opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='6' viewBox='0 0 48 6'%3E%3Cpath fill='none' stroke='%23c69537' stroke-width='1.4' d='M0 5 H12 V2 H22 V5 H34 V2 H44 V5 H48'/%3E%3C/svg%3E");
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 40px 24px 32px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px;
}
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; gap: 24px; } }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(198,149,55,0.3); }
.footer-brand-name { font-size: 1.15rem; color: #f7f2e8; }
.footer-brand-name strong { color: var(--accent-2); }
.footer-tag { font-size: 0.85rem; line-height: 1.65; max-width: 320px; color: rgba(244,240,231,0.6); }
.footer-quote {
  font-family: 'Playfair Display', Georgia, serif; font-style: italic;
  font-size: 0.88rem; color: rgba(220,180,110,0.85); margin-top: 14px;
}
.footer-col-title {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 14px;
}
.footer-link { display: block; font-size: 0.86rem; color: rgba(244,240,231,0.7); padding: 4px 0; transition: color 0.15s; }
.footer-link:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(247,242,232,0.1);
  padding: 16px 24px; text-align: center; font-size: 0.78rem; color: rgba(244,240,231,0.45);
}
.footer-bottom strong { color: rgba(244,240,231,0.7); font-weight: 600; }
