/* The Hormozi Glossary — editorial, system-font, light/dark. No network requests. */

:root {
  color-scheme: light dark;

  --max: 62rem;

  /* light palette */
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f6f4f0;
  --text: #1c1b1a;
  --muted: #6b655d;
  --border: #e7e2da;
  --accent: #b4531f;
  --accent-ink: #8a3f18;
  --callout-bg: #fdf4ec;
  --callout-border: #eec9a6;
  --code-bg: #f1eee8;

  --chip-bg: #f1eee9;
  --chip-border: #e2ddd5;
  --chip-active-bg: #1c1b1a;
  --chip-active-text: #fbfaf8;

  --conf-high-bg: #e2f2e5;   --conf-high-text: #1f7a34;
  --conf-medium-bg: #fbeecd; --conf-medium-text: #8a6100;
  --conf-low-bg: #eceae6;    --conf-low-text: #6b655d;

  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.03);
  --radius: 14px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1d1b19;
    --surface-2: #232019;
    --text: #ece7df;
    --muted: #a49d90;
    --border: #322e29;
    --accent: #e2854d;
    --accent-ink: #f2ac7b;
    --callout-bg: #241c14;
    --callout-border: #5b3f27;
    --code-bg: #26231e;

    --chip-bg: #26231e;
    --chip-border: #35312b;
    --chip-active-bg: #ece7df;
    --chip-active-text: #141312;

    --conf-high-bg: #17331d;   --conf-high-text: #82d897;
    --conf-medium-bg: #382c10; --conf-medium-text: #ecc46c;
    --conf-low-bg: #2a2723;    --conf-low-text: #a49d90;

    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.25);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { max-width: var(--max); margin: 0 auto; padding: 0 1.15rem 4rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }

/* ---------- header ---------- */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: -0.01em; color: var(--text); font-size: 1.02rem; }
.brand:hover { text-decoration: none; color: var(--accent); }
.site-nav { display: flex; gap: 1.15rem; font-size: .92rem; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 2.2rem 0 1.4rem; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5rem; letter-spacing: -0.02em; }
.hero .tagline {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--text);
  margin: 0 0 .7rem;
  max-width: 44rem;
}
.hero .intro { color: var(--muted); max-width: 44rem; margin: 0 0 1rem; }
.hero-narrow { max-width: 46rem; }
.meta-line { font-size: .9rem; color: var(--muted); margin: 0; }
.meta-line span { white-space: nowrap; }

/* ---------- toolbar (sticky search + chips) ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--border);
  margin: 0 -1.15rem 1.6rem;
  padding: .8rem 1.15rem .7rem;
}
.search-wrap { display: flex; align-items: center; gap: .8rem; }
#search {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: .62rem .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
#search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.match-count { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.chip {
  font: inherit;
  font-size: .84rem;
  padding: .32rem .7rem;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.is-active { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); }
.chip-count { opacity: .6; margin-left: .15rem; font-variant-numeric: tabular-nums; }

.no-results { text-align: center; color: var(--muted); padding: 2.5rem 0; font-family: var(--serif); font-size: 1.15rem; }

/* ---------- categories + term cards ---------- */
.category { margin: 0 0 2.4rem; }
.category-title {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: baseline; gap: .5rem;
}
.category-count { font-size: .8rem; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

.term {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
  scroll-margin-top: 6.5rem;
}
.term-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.term-name { font-size: 1.22rem; margin: 0; letter-spacing: -0.01em; }
.anchor {
  color: var(--muted);
  opacity: 0;
  margin-left: -1.05em;
  padding-right: .35em;
  font-weight: 400;
  transition: opacity .12s ease;
}
.term:hover .anchor, .anchor:focus { opacity: .55; }
.anchor:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 640px) { .anchor { margin-left: 0; opacity: .4; } }

.badges { display: flex; gap: .4rem; flex-wrap: wrap; flex-shrink: 0; }
.badge {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .18rem .5rem;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-cat { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.conf-high { background: var(--conf-high-bg); color: var(--conf-high-text); }
.conf-medium { background: var(--conf-medium-bg); color: var(--conf-medium-text); }
.conf-low { background: var(--conf-low-bg); color: var(--conf-low-text); }

.aliases { color: var(--muted); font-size: .88rem; margin: .35rem 0 0; font-style: italic; }
.short-def {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  margin: .7rem 0 .4rem;
  color: var(--text);
}
.full-def { font-family: var(--serif); font-size: 1.02rem; margin: .4rem 0; color: var(--text); }

.formula {
  font-family: var(--mono);
  font-size: .9rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .75rem;
  margin: .8rem 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.components { margin: .6rem 0; padding-left: 1.2rem; }
.components li { margin: .15rem 0; }

.callout {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: .75rem .9rem;
  margin: .9rem 0;
}
.callout-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: .3rem;
}
.callout p { margin: 0; font-family: var(--serif); }

.term-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .9rem;
  padding-top: .7rem;
  border-top: 1px dashed var(--border);
  font-size: .85rem;
}
.sources { color: var(--muted); }
.sources-label { font-weight: 600; margin-right: .3rem; }
.sources ul { display: inline; margin: 0; padding: 0; list-style: none; }
.sources li { display: inline; }
.sources li::after { content: " · "; color: var(--border); }
.sources li:last-child::after { content: ""; }
.first-seen { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* highlight a freshly deep-linked term */
.term.is-target { animation: flash 1.8s ease; }
@keyframes flash {
  0%, 15% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { }
}

/* ---------- changelog / markdown ---------- */
.markdown { max-width: 46rem; font-family: var(--serif); }
.markdown h1 { font-size: 1.8rem; }
.markdown h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
}
.markdown h3 { font-size: 1.05rem; font-family: var(--sans); }
.markdown ul { padding-left: 1.3rem; }
.markdown li { margin: .3rem 0; }
.markdown code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--code-bg);
  padding: .1em .35em;
  border-radius: 5px;
}
.markdown blockquote {
  margin: 1rem 0;
  padding: .3rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.15rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}
.disclaimer { max-width: 46rem; margin: 0 0 .6rem; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .term.is-target { animation: none; }
  * { transition: none !important; }
}
