:root {
  --navy: #10233f;
  --navy-2: #183252;
  --navy-deep: #0a1830;
  --ink: #142033;
  --muted: #5c6b7a;
  --faint: #8a96a3;
  --paper: #f6f3ec;
  --paper-2: #efe9dd;
  --white: #ffffff;
  --line: #e6dfd2;
  --line-2: #d9d1c3;
  --green: #0c7a5a;
  --green-2: #0a6a4e;
  --green-soft: #e4f3ed;
  --gold: #b8892e;
  --gold-soft: #f8efd8;
  --purple: #5b3a9e;
  --purple-soft: #efe8fa;
  --coral: #c24e2c;
  --coral-soft: #fbe8e2;
  --blue-soft: #e7eef8;
  --danger: #b42318;
  --warn: #b54708;
  --good: #0c7a5a;
  --mid: #b8892e;
  --bad: #c24e2c;
  --shadow: 0 10px 30px rgba(16, 35, 63, 0.08);
  --shadow-sm: 0 2px 8px rgba(16, 35, 63, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 68px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", "Times New Roman", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 560; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
ul { margin: 0; padding: 0; list-style: none; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 99; }

/* Layout */
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.page-main { flex: 1; padding: 16px 16px calc(var(--nav-h) + 28px); max-width: 1120px; width: 100%; margin: 0 auto; }
.page-main.wide { max-width: 1240px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px; max-width: 1120px; margin: 0 auto; width: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--navy); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-weight: 650; font-size: 18px;
}
.brand span { letter-spacing: -0.03em; }
.eyebrow {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: 6px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(247, 244, 238, .92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; text-align: center; font-size: 11px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
}
.bottom-nav a.active { color: var(--navy); font-weight: 700; }
.bottom-nav svg { width: 22px; height: 22px; }

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card h3 { font-size: 18px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13px; }
.small { font-size: 13px; }
.tiny { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer;
  font-weight: 650; background: var(--navy); color: #fff; line-height: 1.2;
}
.btn:hover { background: var(--navy-2); }
.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-2); }
.btn-ghost {
  background: transparent; color: var(--navy); border: 1px solid var(--line-2);
}
.btn-ghost:hover { background: var(--paper-2); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line);
}
.chip-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip-gold { background: var(--gold-soft); color: #7a5a14; border-color: transparent; }
.chip-purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.chip-coral { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.chip-blue { background: var(--blue-soft); color: var(--navy); border-color: transparent; }
.chip-good { background: var(--green-soft); color: var(--good); border: 0; }
.chip-mid { background: var(--gold-soft); color: var(--warn); border: 0; }
.chip-bad { background: var(--coral-soft); color: var(--bad); border: 0; }

.progress {
  height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.progress.warn > span { background: var(--gold); }
.progress.bad > span { background: var(--coral); }

.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 650; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 650; margin: 0 0 6px; }
.field { margin-bottom: 12px; }
.input, select, textarea {
  width: 100%; border: 1px solid var(--line-2); background: #fff;
  border-radius: 12px; padding: 11px 12px; outline: none;
}
.input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(16,35,63,.12); }
textarea { min-height: 110px; resize: vertical; }
.choice {
  display: block; border: 1px solid var(--line); background: #fff;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--navy); background: var(--blue-soft); }
.choice input { margin-right: 8px; }

.flash {
  border-radius: 12px; padding: 10px 12px; margin: 8px 0 14px; font-size: 14px;
}
.flash-success { background: var(--green-soft); color: var(--green-2); }
.flash-error { background: var(--coral-soft); color: var(--danger); }
.flash-info { background: var(--blue-soft); color: var(--navy); }

/* Hero / marketing */
.hero {
  background: var(--navy-deep);
  color: #f4efe4;
  padding: 28px 20px 48px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -40px; top: -40px; width: 220px; height: 220px;
  border: 18px solid rgba(184,137,46,.25); border-radius: 50%;
}
.hero-inner { max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(34px, 8vw, 64px); color: #fff; max-width: 16ch; margin: 8px 0 12px; }
.hero p.lead { font-size: 17px; max-width: 42ch; color: #d7d0c3; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero .btn-gold { color: var(--navy-deep); }
.section { max-width: 1080px; margin: 0 auto; padding: 36px 16px; }
.journey {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; overflow: auto;
}
.journey span {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 8px; text-align: center; font-size: 12px; font-weight: 700;
}
.kicker { font-family: var(--display); font-size: 28px; }

/* Career / timeline */
.timeline { border-left: 2px solid var(--line); margin: 8px 0 0 10px; padding-left: 18px; }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--navy); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--navy);
}
.tl-item.done::before { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.tl-phase { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-weight: 700; }

/* Practice */
.q-card { padding: 18px; }
.q-meta { display: flex; gap: 8px; margin-bottom: 12px; }
.option {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  margin-bottom: 8px; background: #fff; cursor: pointer; width: 100%; text-align: left;
}
.option b {
  width: 28px; height: 28px; border-radius: 8px; background: var(--paper-2);
  display: grid; place-items: center; flex: none;
}
.option.selected { border-color: var(--navy); background: var(--blue-soft); }
.option.right { border-color: var(--green); background: var(--green-soft); }
.option.wrong { border-color: var(--coral); background: var(--coral-soft); }

/* Tutor */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 150px); }
.chat-log { flex: 1; overflow: auto; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 88%; padding: 11px 13px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap;
}
.bubble.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.bot strong { font-weight: 700; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2 } 40% { opacity: 1 } }
.chat-input {
  display: flex; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 6px 6px 6px 12px; align-items: flex-end;
}
.chat-input textarea {
  border: 0; min-height: 42px; max-height: 120px; padding: 8px 0; box-shadow: none; resize: none;
}
.suggest { display: flex; gap: 8px; overflow: auto; padding: 4px 0 10px; }
.suggest button { white-space: nowrap; }

/* Tables */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:hover td { background: #fcfaf6; }

/* Portal */
.portal { display: grid; min-height: 100dvh; }
.side {
  display: none; background: var(--navy-deep); color: #e8e2d6; padding: 22px 16px;
}
.side a { display: block; padding: 8px 10px; border-radius: 10px; color: #d7d0c3; margin-bottom: 2px; }
.side a.active, .side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side .brand { color: #fff; margin-bottom: 22px; }
.portal-main { padding: 18px 16px 80px; }

.demo-banner {
  background: var(--gold-soft); color: #6b4d12; font-size: 12px; font-weight: 700;
  text-align: center; padding: 6px 10px;
}
.notice-demo {
  font-size: 12px; color: var(--muted); background: var(--paper-2);
  border-radius: 10px; padding: 8px 10px; margin-top: 10px;
}

.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.ring {
  width: 86px; height: 86px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--paper-2) 0);
}
.ring::after {
  content: ""; position: absolute; inset: 8px; background: #fff; border-radius: 50%;
}
.ring b { position: relative; z-index: 1; font-family: var(--display); font-size: 20px; }

.searchbar { display: flex; gap: 8px; }
.searchbar .input { flex: 1; }

.empty {
  text-align: center; padding: 28px 12px; color: var(--muted);
}

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-pill {
  background: var(--gold-soft); border-radius: 12px; padding: 8px 10px; font-size: 12px; font-weight: 700;
}

@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .page-main { padding-top: 18px; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex !important; gap: 16px; align-items: center; font-weight: 650; font-size: 14px; }
  .desktop-nav a { color: var(--muted); }
  .desktop-nav a.active, .desktop-nav a:hover { color: var(--navy); }
  .portal { grid-template-columns: 240px 1fr; }
  .side { display: block; }
  .portal-main { padding: 28px 32px; }
  .chat-wrap { height: calc(100dvh - 120px); }
}
.desktop-nav { display: none; }

/* Landing extras */
.feature { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.feature h3 { font-size: 20px; }
.quote {
  background: var(--navy); color: #f4efe4; border-radius: 20px; padding: 22px;
  font-family: var(--display); font-size: 22px;
}
.logo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-row span {
  border: 1px dashed var(--line-2); border-radius: 10px; padding: 6px 10px; font-size: 12px; color: var(--muted);
}
footer.site {
  border-top: 1px solid var(--line); padding: 24px 16px 40px; color: var(--muted); font-size: 13px;
  max-width: 1080px; margin: 0 auto;
}
