@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --paper: #f4efe8;
  --ink: #191919;
  --muted: #595959;
  --line: #ded4c8;
  --surface: #fffdf9;
  --brand: #312c59;
  --brand-soft: #f3f2f8;
  --cta: #b2461f;
  --cta-dark: #8f3111;
  --budget: #2e7d32;
  --balanced: #0f5f73;
  --power: #8f3111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7f2ea 0%, #f2ece3 220px, #efe8de 100%);
}

.shell {
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #f9f8fb;
}

.utility-bar {
  border-bottom: 1px solid #e6e2eb;
  background: #f3f4f9;
}

.utility-inner {
  min-height: 36px;
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.utility-inner a {
  color: #54507a;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.header-main {
  border-bottom: 1px solid #e3e0ea;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--brand);
}

.logo-image {
  height: 88px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.brand-name-wrap {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  color: #083f6d;
  font-weight: 800;
  font-size: 1.42rem;
  letter-spacing: 0.01em;
}

.brand-tagline {
  color: #5a6672;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.academy-link {
  color: var(--brand);
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-nav {
  background: #fff;
  border-top: 1px solid #ece8e0;
  box-shadow: 0 2px 8px rgba(18, 12, 36, 0.06);
  position: relative;
  z-index: 30;
}

.topics {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 64px;
  overflow: visible;
  white-space: nowrap;
  position: relative;
}

.nav-item {
  position: relative;
}

.nav-trigger {
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0;
}

.nav-trigger:hover {
  background: transparent;
}

.nav-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  min-width: 210px;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6dfd5;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(26, 18, 44, 0.12);
  z-index: 10;
}

.dropdown a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
}

.dropdown a:hover {
  background: #f5f3fa;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  display: flex;
}

.search-chip {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #1ea5a0;
  font-size: 1.8rem;
  padding: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1rem;
  margin-top: 1.1rem;
}

.hero-main,
.callout {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.hero-main {
  padding: 1.25rem;
}

.hero-main h1 {
  margin: 0.5rem 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  line-height: 1.2;
}

.hero-main p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-image {
  width: 100%;
  border-radius: 10px;
  margin-top: 0.85rem;
  border: 1px solid #d9e5f0;
}

.hero-side {
  display: grid;
  gap: 0.75rem;
}

.callout {
  padding: 0.85rem 0.95rem;
}

.callout h2 {
  margin: 0.3rem 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.25rem;
}

.callout p {
  margin: 0;
}

.callout.soft {
  background: #fff6ec;
}

.label {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  color: #8d4316;
  margin: 0;
  font-weight: 700;
}

main {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface);
}

.section-head h2 {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
}

.section-head p {
  margin: 0.3rem 0 0.9rem;
  color: var(--muted);
}

.quick-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.pick-card,
.quiz-card,
.glossary article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  background: #fffcf7;
}

.pick-card h3,
.quiz-card h3,
.glossary h3 {
  margin: 0 0 0.4rem;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1rem;
}

.article-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2d8cc;
  margin-bottom: 0.55rem;
}

.article-btn {
  margin-top: 0.35rem;
}

.article-link {
  text-decoration: none;
}

a.article-btn {
  display: inline-block;
}

.badge-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
}

.badge.budget {
  background: var(--budget);
}

.badge.balanced {
  background: var(--balanced);
}

.badge.power {
  background: var(--power);
}

.filters,
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.9rem;
  color: #352f2a;
}

input,
select,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 0.52rem 0.62rem;
  background: #fff;
}

button {
  border-color: transparent;
  background: var(--cta);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--cta-dark);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.66rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  color: #0f5f73;
  text-decoration: underline;
  padding: 0;
}

.small,
.score {
  color: var(--muted);
  font-size: 0.78rem;
}

.quiz-results,
.glossary {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer {
  margin-bottom: 2rem;
  color: #744628;
}

.article-page {
  max-width: 860px;
  margin: 1rem auto 2rem;
}

.article-page h1 {
  margin: 0.4rem 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
}

.article-hero {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #dfd4c7;
  margin: 0.65rem 0 0.85rem;
}

dialog {
  width: min(700px, 95vw);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

dialog::backdrop {
  background: rgba(33, 20, 10, 0.34);
}

@media (max-width: 980px) {
  .academy-link {
    font-size: 1.4rem;
  }

  .topics {
    gap: 1rem;
    min-height: 56px;
    overflow-x: auto;
    overflow-y: visible;
  }

  .nav-trigger {
    font-size: 0.96rem;
  }

  .nav-link {
    font-size: 0.96rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .masthead {
    min-height: 70px;
  }

  .logo-image {
    height: 64px;
    max-width: none;
  }

  .brand-name {
    font-size: 1.08rem;
  }

  .brand-tagline {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .academy-link {
    font-size: 1.1rem;
  }

  .topics {
    padding-bottom: 0.25rem;
  }

  .utility-inner {
    gap: 0.7rem;
  }

  .utility-inner a {
    font-size: 0.7rem;
  }
}
