/* ==========================================================================
   Brain — design system
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --bg: #0b0c0f;
  --bg-elev: #15171d;
  --bg-elev-2: #1b1e25;
  --bg-elev-3: #21242c;
  --border: #272a33;
  --border-soft: #1e2129;

  --cream: #ece3d2;
  --cream-dim: #d8cfbd;

  --text: #ece9e4;
  --text-dim: #9b9da6;
  --text-faint: #686b75;

  --orange: #e08a3c;
  --orange-dim: #c97830;
  --orange-wash: rgba(224,138,60,.14);

  --green: #7fae6f;
  --green-wash: rgba(127,174,111,.14);
  --blue: #6f93c7;
  --blue-wash: rgba(111,147,199,.14);
  --purple: #a98fd1;
  --purple-wash: rgba(169,143,209,.14);
  --rose: #c97b84;
  --rose-wash: rgba(201,123,132,.14);

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;

  --shadow-card: 0 1px 0 rgba(255,255,255,.02) inset, 0 10px 30px -18px rgba(0,0,0,.6);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ color-scheme: dark; }
body{
  margin:0;
  background:
    radial-gradient(900px 420px at 85% -80px, rgba(224,138,60,.13), transparent 70%),
    radial-gradient(700px 400px at 5% 30%, rgba(111,147,199,.06), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}
p{ margin:0; }
a{ color: inherit; text-decoration: none; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family: inherit; cursor:pointer; }
input, textarea, select, button{ font-family: inherit; color: inherit; }
img{ max-width:100%; display:block; }

.container{ max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px){ .container{ padding: 0 18px; } }

/* ---------- Navbar ---------- */
.navbar{
  display:flex; align-items:center; gap: 28px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top:0; z-index: 50;
  background: rgba(11,12,15,.86);
  backdrop-filter: blur(10px);
}
.brand{ display:flex; align-items:center; gap:9px; font-family: var(--font-display); font-size: 19px; font-weight:600; color: var(--text); white-space:nowrap; }
.brand-mark{ width:22px; height:22px; flex:none; }
.brand-mark circle{ fill:none; stroke: var(--orange); stroke-width: 2.4; }

.nav-links{ display:flex; align-items:center; gap:4px; }
.nav-links a{
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; color: var(--text-dim); font-weight:500;
  transition: background .15s, color .15s;
}
.nav-links a:hover{ color: var(--text); }
.nav-links a.active{ background: var(--cream); color:#17181b; }

.nav-search{
  display:flex; align-items:center; gap:8px;
  background: var(--bg-elev); border:1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; color: var(--text-faint); font-size: 13px; flex: 1; max-width: 260px;
}
.nav-search input{ background:none; border:none; outline:none; color: var(--text); width:100%; font-size:13px; }
.nav-search input::placeholder{ color: var(--text-faint); }
.nav-search svg{ flex:none; opacity:.7; }

.navbar-right{ display:flex; align-items:center; gap:10px; margin-left:auto; }

.xp-pill{
  display:flex; flex-direction:column; gap:4px;
  padding: 7px 14px; border-radius: 12px; background: var(--bg-elev); border:1px solid var(--border);
  font-size:11.5px; min-width: 128px;
}
.xp-pill .xp-row{ display:flex; justify-content:space-between; gap:8px; color: var(--text-dim); }
.xp-pill .xp-row b{ color: var(--text); font-weight:600; }
.xp-track{ height:4px; border-radius:2px; background: var(--border); overflow:hidden; }
.xp-fill{ height:100%; background: var(--orange); border-radius:2px; }

.streak-pill{
  display:flex; align-items:center; gap:6px;
  padding: 9px 14px; border-radius: 999px; background: var(--orange-wash); color: var(--orange);
  font-size: 12.5px; font-weight:600; border:1px solid rgba(224,138,60,.25); white-space:nowrap;
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding: 10px 18px; border-radius: 999px; border:1px solid transparent;
  font-size: 13.5px; font-weight: 600; transition: transform .12s, opacity .12s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active{ transform: scale(.97); }
.btn-cream{ background: var(--cream); color:#17181b; }
.btn-cream:hover{ background: var(--cream-dim); }
.btn-outline{ background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover{ border-color:#3a3e49; }
.btn-ghost{ background: var(--bg-elev-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover{ background: var(--bg-elev-3); }
.btn-link{ background:none; color: var(--orange); padding: 6px 2px; font-weight:600; }
.btn-sm{ padding: 7px 13px; font-size:12.5px; }
.btn[disabled]{ opacity:.45; cursor:not-allowed; }

/* ---------- Cards / surfaces ---------- */
.card{
  background: var(--bg-elev); border:1px solid var(--border); border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
}
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.badge-cream{ background: #17181b; color: var(--cream); }
.badge-lock{ background: var(--orange-wash); color: var(--orange); }
.tag{
  display:inline-flex; align-items:center; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight:600; background: var(--bg-elev-3); color: var(--text-dim);
}
.dot{ width:8px; height:8px; border-radius:50%; display:inline-block; flex:none; }

.stars{ display:inline-flex; gap:2px; }
.stars svg{ width:15px; height:15px; }
.star-filled{ fill: var(--orange); }
.star-empty{ fill: none; stroke: var(--text-faint); stroke-width:1.4; }

.progress-bar{ height:6px; border-radius:3px; background: var(--bg-elev-3); overflow:hidden; }
.progress-fill{ height:100%; border-radius:3px; background: var(--orange); }

.section-title{ font-size: 22px; margin-bottom: 4px; }
.section-sub{ color: var(--text-dim); font-size: 13.5px; }
.eyebrow{ font-size: 11.5px; font-weight:700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }

.page-head{ padding: 44px 0 28px; }
.page-head h1{ font-size: 36px; margin-bottom: 8px; }
.page-head p{ color: var(--text-dim); font-size: 14.5px; max-width: 560px; }

.main{ padding-bottom: 80px; }

.scrollbar-x{ overflow-x:auto; scrollbar-width: thin; }

/* ---------- Breadcrumb / focus toggle ---------- */
.subbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding: 14px 32px; border-bottom: 1px solid var(--border-soft);
}
.breadcrumb{ display:flex; align-items:center; gap:7px; font-size: 13px; color: var(--text-faint); }
.breadcrumb a:hover{ color: var(--text); }
.breadcrumb .current{ color: var(--text); font-weight:600; }

/* ---------- empty / misc ---------- */
.empty{
  padding: 48px 24px; text-align:center; color: var(--text-faint); border:1px dashed var(--border); border-radius: var(--radius-m);
}
.hr{ height:1px; background: var(--border-soft); border:none; margin: 0; }

::selection{ background: var(--orange-wash); color: var(--text); }

/* scrollbars */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--bg-elev-3); border-radius: 6px; border: 2px solid var(--bg); }

/* ---------- Modal ---------- */
.modal-backdrop{
  position: fixed; inset:0; background: rgba(5,6,8,.72); backdrop-filter: blur(3px);
  display:flex; align-items:center; justify-content:center; z-index: 200; padding: 20px;
}
.modal{
  width: 100%; max-width: 380px; background: var(--bg-elev-2); border:1px solid var(--border);
  border-radius: var(--radius-l); padding: 28px; box-shadow: 0 30px 80px -24px rgba(0,0,0,.7);
}
.modal h3{ font-size: 21px; margin-bottom: 6px; }
.modal p{ color: var(--text-dim); font-size: 13.5px; margin-bottom: 18px; }
.field{ margin-bottom: 14px; }
.field label{ display:block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight:600; }
.field input, .field textarea{
  width:100%; background: var(--bg); border:1px solid var(--border); border-radius: var(--radius-s);
  padding: 10px 12px; font-size: 14px; outline:none; transition: border-color .15s;
}
.field input:focus, .field textarea:focus{ border-color: var(--orange-dim); }
.modal-actions{ display:flex; gap:10px; margin-top: 18px; }
.modal-close{ position:absolute; }
.modal-error{ color: var(--rose); font-size: 12.5px; margin-top: -6px; margin-bottom: 12px; display:none; }
.modal-error.show{ display:block; }

/* ---------- toast ---------- */
.toast{
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--cream); color:#17181b; padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight:600; box-shadow: 0 16px 40px -12px rgba(0,0,0,.6);
  opacity:0; pointer-events:none; transition: opacity .2s, transform .2s; z-index: 300;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px){
  .navbar{ flex-wrap:wrap; gap:12px; padding: 14px 18px; }
  .nav-links{ order:3; width:100%; overflow-x:auto; }
  .nav-search{ max-width:none; order:2; flex:1 1 160px; }
}
