/* Atlas — Executive Banking Field Guide */

:root {
  --paper: #f7f8fa;
  --surface: #ffffff;
  --ink: #1c2430;
  --ink-soft: #4a5568;
  --ink-faint: #8a94a3;
  --line: #e4e7ec;
  --line-soft: #edf0f4;
  --navy: #17324D;
  --accent: #17324D;
  --teal: #2E7D74;
  --ok: #5F7D4E;
  --chip: #f0f2f6;
  --callout: #f2f4f8;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.05), 0 4px 16px rgba(28, 36, 48, 0.06);
  --shadow-lift: 0 2px 4px rgba(28, 36, 48, 0.07), 0 10px 28px rgba(28, 36, 48, 0.10);
  --radius: 14px;
  --display: "Manrope", "Inter", -apple-system, "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101418;
    --surface: #171c22;
    --ink: #e8e6e1;
    --ink-soft: #b3b9c2;
    --ink-faint: #79818c;
    --line: #2a313a;
    --line-soft: #232930;
    --navy: #8fb4d9;
    --accent: #8fb4d9;
    --teal: #66BFB2;
    --ok: #8FAE7E;
    --chip: #1f252c;
    --callout: #1c2229;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35);
  }
  /* Muted atlas accents need lifting to stay legible as text on dark surfaces */
  .areacard .num, .areatag { color: color-mix(in srgb, var(--area-accent, var(--navy)) 60%, #d5dbe3); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 760px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(to bottom, var(--navy), #2B4964); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 18px;
}
@media (prefers-color-scheme: dark) { .brand-mark { color: #101418; } }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: 0.01em; }
.topnav { display: flex; gap: 4px; }
.iconbtn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px; color: var(--ink-soft);
  border: none; background: none; cursor: pointer;
}
.iconbtn:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.badge {
  position: absolute; top: 4px; right: 3px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--teal); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}

/* ---------- Layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 24px 18px 56px; min-height: 70vh; }
.loading { text-align: center; padding: 96px 0; color: var(--ink-faint); }
.loading-mark {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px;
  background: var(--navy); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 30px; font-weight: 600;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .loading-mark { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Home ---------- */
.hero { padding: 22px 0 8px; }
.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(30px, 6vw, 40px); line-height: 1.15;
  margin: 0 0 10px; letter-spacing: -0.01em;
}
.hero p.lede { color: var(--ink-soft); font-size: 17px; margin: 0 0 20px; max-width: 56ch; }
.searchbox { position: relative; margin-bottom: 10px; }
.searchbox svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.searchbox input {
  width: 100%; padding: 14px 16px 14px 46px;
  font: 500 16px var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow);
}
.searchbox input::placeholder { color: var(--ink-faint); }
.searchbox input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.progressline { color: var(--ink-faint); font-size: 13.5px; margin: 14px 2px 22px; display: flex; align-items: center; gap: 8px; }
.progressline .bar { flex: 1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; max-width: 160px; }
.progressline .bar i { display: block; height: 100%; background: var(--teal); border-radius: 2px; }

.areagrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .areagrid { grid-template-columns: 1fr 1fr; } }
.areacard {
  position: relative; display: block; padding: 18px 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.areacard::before {
  /* Atlas signature: a quiet depth gradient, darker at the top, lightening as it falls */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--area-accent, var(--navy)) 86%, #0e2033),
    color-mix(in srgb, var(--area-accent, var(--navy)) 80%, #ffffff));
}
.areacard:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.areacard .num {
  font: 600 11px var(--sans); letter-spacing: 0.12em;
  /* Legibility floor: keep the shade progression but never let light blues wash out */
  color: color-mix(in srgb, var(--area-accent, var(--navy)) 72%, var(--ink));
}
.areacard h2 { font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.25; margin: 6px 0 4px; }
.areacard p { margin: 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.areacard .meta { margin-top: 10px; font-size: 12px; color: var(--ink-faint); display: flex; gap: 10px; align-items: center; }
.dotdone { color: var(--ok); font-weight: 600; }

/* ---------- Generic page furniture ---------- */
.crumbs { font-size: 13px; color: var(--ink-faint); margin: 2px 0 18px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-faint); }
.crumbs a:hover { color: var(--accent); }
.pagehead h1 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 5.4vw, 34px); line-height: 1.16; margin: 0 0 8px; letter-spacing: -0.01em; }
.pagehead .tagline { color: var(--ink-soft); font-size: 16px; margin: 0 0 6px; }
.pagehead .intro { color: var(--ink-soft); font-size: 15px; margin: 10px 0 22px; max-width: 60ch; }

.conceptlist { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.conceptrow {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  color: var(--ink); transition: box-shadow 0.15s ease;
}
.conceptrow:hover { text-decoration: none; box-shadow: var(--shadow-lift); }
.conceptrow .txt { flex: 1; min-width: 0; }
.conceptrow h3 { margin: 0 0 3px; font: 600 16px var(--sans); display: flex; align-items: center; gap: 8px; }
.conceptrow p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.visited-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.rowmark { color: var(--ink-faint); flex: none; margin-top: 2px; }
.rowmark.on { color: var(--teal); }

/* ---------- Concept page ---------- */
.concepthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.concepthead h1 { font-family: var(--display); font-weight: 600; font-size: clamp(27px, 5.6vw, 36px); line-height: 1.14; margin: 0; letter-spacing: -0.01em; }
.bookmarkbtn {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 600 13px var(--sans); color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.bookmarkbtn.on { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.bookmarkbtn svg { flex: none; }
.oneliner {
  font-family: var(--display); font-size: 20px; line-height: 1.45; font-weight: 500;
  color: var(--ink); margin: 14px 0 6px; max-width: 58ch;
}
.areatag {
  display: inline-block; font: 600 11px var(--sans); letter-spacing: 0.09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--area-accent, var(--navy)) 72%, var(--ink));
  background: color-mix(in srgb, var(--area-accent, var(--navy)) 10%, transparent);
  padding: 4px 11px; border-radius: 999px; margin-bottom: 12px;
}

.csection { margin-top: 26px; }
.csection > h2 {
  font: 700 12px var(--sans); letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.csection > h2::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.csection p { margin: 0 0 12px; max-width: 62ch; }
.csection p:last-child { margin-bottom: 0; }

.example {
  background: var(--callout); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--teal);
  border-radius: 12px; padding: 16px 18px;
}
.example .exlabel { font: 700 11px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); display: block; margin-bottom: 6px; }
.example p { font-size: 15px; }

.termlist { display: flex; flex-direction: column; gap: 8px; }
.termitem { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px; font-size: 14px; }
.termitem b { font-weight: 600; }
.termitem span { color: var(--ink-soft); }

details.deepdive {
  margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
details.deepdive summary {
  cursor: pointer; list-style: none; padding: 15px 18px;
  font: 600 14px var(--sans); color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
details.deepdive summary::-webkit-details-marker { display: none; }
details.deepdive summary .chev { transition: transform 0.2s ease; color: var(--ink-faint); }
details.deepdive[open] summary .chev { transform: rotate(180deg); }
details.deepdive .ddbody { padding: 0 18px 18px; border-top: 1px solid var(--line-soft); }
details.deepdive .ddbody p { margin: 12px 0 0; max-width: 62ch; font-size: 15px; }

.relatedchips { display: flex; flex-wrap: wrap; gap: 8px; }
.relatedchips a {
  padding: 8px 13px; border-radius: 999px; font: 500 13.5px var(--sans);
  background: var(--chip); color: var(--ink); border: 1px solid var(--line-soft);
}
.relatedchips a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

.sources { font-size: 13px; color: var(--ink-faint); }
.sources ul { margin: 6px 0 0; padding-left: 18px; }
.sources li { margin-bottom: 4px; }
.pagenav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; border-top: 1px solid var(--line-soft); padding-top: 18px; font-size: 14px; }
.pagenav a { max-width: 46%; }
.pagenav .dir { display: block; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- Acronyms ---------- */
.acrofilter { margin: 4px 0 18px; }
.acrogroup h2 { font-family: var(--display); font-size: 22px; margin: 26px 0 10px; color: var(--ink-soft); }
.acroitem { padding: 11px 2px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.acroitem b { font-weight: 700; font-variant-numeric: tabular-nums; }
.acroitem .full { color: var(--ink-soft); font-style: italic; }
.acroitem p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13.5px; max-width: 62ch; }

/* ---------- Regions & landscape ---------- */
.obsblock { background: var(--callout); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; margin-top: 26px; }
.obsblock > h2 { font: 700 12px var(--sans); letter-spacing: 0.11em; text-transform: uppercase; color: var(--teal); margin: 0 0 4px; }
.obsblock .obsnote { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 12px; }
.obsitem { padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px; }
.obsitem:first-of-type { border-top: none; }
.obsitem .src { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-faint); }
.landcat { margin-top: 30px; }
.landcat h2 { font-family: var(--display); font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.landcat .ctx { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; }
.landentry { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 8px; font-size: 14.5px; }
.landentry b { font-weight: 600; }
.landentry .src { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-faint); }
.notecallout { background: var(--callout); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 8px; }

/* ---------- Search & empty states ---------- */
.resultcount { color: var(--ink-faint); font-size: 13.5px; margin: 12px 0 14px; }
.emptystate { text-align: center; color: var(--ink-faint); padding: 60px 20px; }
.emptystate .big { font-size: 40px; margin-bottom: 10px; }
.kicker { font: 700 12px var(--sans); letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-faint); margin: 22px 0 8px; }

/* ---------- Footer (standard Appbundance footer pattern — only the app name changes per app) ---------- */
.foot { max-width: 760px; margin: 0 auto; padding: 40px 18px 56px; border-top: 1px solid var(--line-soft); color: var(--ink-faint); font-size: 12px; line-height: 1.7; }
.foot p { margin: 0; max-width: 68ch; }
.foot a { color: var(--ink-soft); }
.foot-brand { font-family: var(--display); font-weight: 600; font-size: 13.5px; color: var(--ink-soft); letter-spacing: 0.01em; margin-bottom: 14px !important; }
.foot-brand .tm { font-size: 9px; vertical-align: super; opacity: 0.8; }
.foot-legal { margin-bottom: 18px !important; }
.foot-copy { margin-bottom: 4px !important; }
.foot-eco { margin-bottom: 18px !important; }
.foot-eco a { color: var(--navy); font-weight: 500; }
.foot-reviewed { font-size: 11.5px; opacity: 0.85; }
