/* ============================================
   ModBasement.com — Design System
   Dark, high-contrast "basement" theme with a
   stencil wordmark, marker-font headlines, and
   a red accent — restyled to match the brand
   reference. Content areas stay on light cards
   so long-form guides remain easy to read.
   ============================================ */

:root {
  /* Page canvas (dark) */
  --color-bg: #131218;
  --color-bg-alt: #1a1820;
  --color-black: #0a0a0d;

  /* Content surfaces (light, for readability of guides/tables/etc.) */
  --color-surface: #fdfbfa;
  --color-text-on-light: #201c29;
  --color-text-muted-on-light: #675f70;
  --color-heading-on-light: #1a1620;

  /* Text on the dark canvas */
  --color-text: #f1eef4;
  --color-text-muted: #b3aebd;
  --color-border: #e5e0ea;          /* used on light surfaces */
  --color-border-dark: rgba(255,255,255,0.12); /* used on dark canvas */

  /* Brand accent (red) */
  --color-primary: #ef4136;
  --color-primary-dark: #c92a21;
  --color-primary-light: #ffe1dc;

  --color-secondary: #0a0a0d;
  --color-secondary-light: #201f26;

  --color-accent: #ff6b57;
  --color-success: #1e8a5f;
  --color-success-light: #e2f6ec;
  --color-info: #2f6fed;
  --color-info-light: #e7eefe;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  --max-width: 1100px;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-stencil: 'Stardos Stencil', cursive;
  --font-marker: 'Permanent Marker', cursive;
  --font-tag: 'Oswald', var(--font-base);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--color-primary); text-decoration-thickness: 2px; }
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 { font-weight: 800; line-height: 1.25; color: #ffffff; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.5rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1rem; }

ul.plain { list-style: none; margin: 0; padding: 0; }

.text-muted { color: var(--color-text-muted); }
.small { font-size: 0.92rem; }

/* ---------- Light-surface override ----------
   Cards, callouts, tables, and dictionary entries
   keep dark text on a light background regardless
   of the dark page canvas around them. */
:is(.card, .callout, table.data-table, .dict-term) {
  color: var(--color-text-on-light);
}
:is(.card, .callout, table.data-table, .dict-term) :is(h1, h2, h3, h4) {
  color: var(--color-heading-on-light);
}
:is(.card, .callout, table.data-table, .dict-term) .text-muted {
  color: var(--color-text-muted-on-light);
}
:is(.card, .callout, table.data-table, .dict-term) a {
  color: var(--color-primary-dark);
}
/* The take-home calculator's result box inverts back to light-on-dark
   even though it's nested inside a .card */
.result-box, .result-box * { color: #fff; }
.result-box .amount { color: var(--color-accent); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Top banner ---------- */
.proto-banner {
  background: var(--color-black);
  color: #d8d4de;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border-dark);
}
.proto-banner a { color: var(--color-accent); }

/* ---------- Header / Nav ---------- */
header.site-header {
  background: var(--color-black);
  border-bottom: 1px solid var(--color-border-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo:hover .word-mod, .logo:hover .word-basement { color: var(--color-primary); }

.logo .logo-mark {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.logo .logo-mark svg { width: 100%; height: 100%; }

.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 0.92;
}
.word-mod, .word-basement {
  font-family: var(--font-stencil);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.7), 2px 2px 0 rgba(0,0,0,0.5);
}
.word-mod { font-size: 1.05rem; letter-spacing: 2px; }
.word-basement { font-size: 0.85rem; letter-spacing: 1.5px; }

nav.primary-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

nav.primary-nav a {
  color: #d8d4de;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  white-space: nowrap;
}
nav.primary-nav a:hover,
nav.primary-nav a.active { background: rgba(239,65,54,0.16); color: #ff8177; }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  nav.primary-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-black);
    border-bottom: 1px solid var(--color-border-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    box-shadow: var(--shadow);
  }
  nav.primary-nav.open { display: flex; }
  nav.primary-nav a { padding: 12px 14px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }

.btn-secondary { background: #fff; color: var(--color-black); }
.btn-secondary:hover { background: #e9e6ee; color: var(--color-black); }

.btn-outline { background: transparent; border-color: var(--color-border-dark); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-accent); }

.btn-disabled {
  background: #33313a;
  color: #837d8d;
  cursor: not-allowed;
  position: relative;
}
.btn-disabled:hover { background: #33313a; color: #837d8d; }

.btn-lg { padding: 16px 30px; font-size: 1.08rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Hero ---------- */
.hero {
  padding: 68px 0 52px;
  text-align: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(239,65,54,0.10), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(255,255,255,0.04), transparent 50%),
    var(--color-bg);
}
.hero .eyebrow {
  display: inline-block;
  font-family: var(--font-tag);
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}
.hero h1 {
  margin-bottom: 16px;
  font-family: var(--font-marker);
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.hero p.lead {
  max-width: 640px;
  margin: 0 auto 30px;
  font-size: 1.15rem;
  color: var(--color-text-muted);
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards / Grids ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card-link:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }

.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

/* ---------- Sections ---------- */
section.section { padding: 56px 0; }
section.section-alt { background: var(--color-bg-alt); border-top: 1px solid var(--color-border-dark); border-bottom: 1px solid var(--color-border-dark); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border-dark);
}
.card .checklist li { border-bottom-style: dashed; border-bottom-color: var(--color-border); }
.checklist li:last-child { border-bottom: none; }
.checklist .check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--color-success-light);
  color: var(--color-success);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  margin-top: 2px;
}

/* ---------- Steps (for guides) ---------- */
.step {
  display: flex;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--color-border-dark);
}
.step:last-child { border-bottom: none; }
.step-number {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.step-body h3 { margin-top: 0; color: #fff; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
  border: 1px solid var(--color-border);
  display: flex;
  gap: 14px;
}
.callout .callout-icon { font-size: 1.3rem; flex-shrink: 0; }
.callout-tip { background: var(--color-info-light); border-color: #cfe0fc; }
.callout-warning { background: #fff4e0; border-color: #ffe1a8; }
.callout-success { background: var(--color-success-light); border-color: #bfe9d3; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.98rem;
}
table.data-table th {
  background: var(--color-black);
  color: #fff;
  font-weight: 700;
}
table.data-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.badge-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text-muted-on-light); }
.badge-yellow { background: #fff3cf; color: #8a6800; }

/* ---------- Tier cards (products) ---------- */
.tier-card { position: relative; }
.tier-card.featured { border: 2px solid var(--color-primary); }
.tier-price { font-size: 2rem; font-weight: 900; color: var(--color-heading-on-light); margin: 8px 0 4px; }
.tier-card ul { padding-left: 20px; margin: 16px 0; }
.tier-card li { margin-bottom: 8px; }

/* ---------- Calculator ---------- */
.calc-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
@media (max-width: 780px) { .calc-wrap { grid-template-columns: 1fr; } }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { color: var(--color-text-muted-on-light); font-size: 0.88rem; margin-top: 4px; }
.field input[type="number"], .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text-on-light);
}
.field input:focus, .field select:focus, input:focus, button:focus, a:focus {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

.result-box {
  background: var(--color-black);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
}
.result-box .result-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  font-size: 0.98rem;
}
.result-box .result-line:last-of-type { border-bottom: none; }
.result-total {
  margin-top: 18px;
  text-align: center;
}
.result-total .amount {
  font-size: 2.6rem;
  font-weight: 900;
}
.result-total .label { font-size: 0.9rem; opacity: 0.85; }

/* ---------- Dictionary ---------- */
.dict-search {
  position: sticky;
  top: 63px;
  background: var(--color-bg);
  padding: 18px 0;
  z-index: 10;
}
.dict-search input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.05rem;
  border-radius: 999px;
  border: 2px solid var(--color-border-dark);
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text-on-light);
}
.az-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
}
.az-filter button {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border-dark);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.az-filter button.active, .az-filter button:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.dict-term {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
}
.dict-term h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.dict-term .why { color: var(--color-text-muted-on-light); font-size: 0.95rem; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--color-border); }
.dict-empty { text-align: center; color: var(--color-text-muted); padding: 40px 0; display: none; }

/* ---------- Forum ---------- */
.forum-cat {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
}
.forum-cat .cat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--color-info-light);
  color: var(--color-info);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.forum-cat .cat-meta { margin-left: auto; text-align: right; flex-shrink: 0; }
.forum-cat .cat-meta .count { font-weight: 800; color: var(--color-heading-on-light); }
.forum-cat .cat-meta .count-label { display: block; font-size: 0.78rem; color: var(--color-text-muted-on-light); }

.thread-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 4px;
  border-bottom: 1px solid var(--color-border);
}
.thread-row:last-child { border-bottom: none; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.thread-row .thread-meta { color: var(--color-text-muted-on-light); font-size: 0.88rem; }
.thread-row .replies { margin-left: auto; text-align: center; flex-shrink: 0; }
.thread-row .replies .num { font-weight: 800; color: var(--color-heading-on-light); display:block; }
.thread-row .replies .lbl { font-size: 0.75rem; color: var(--color-text-muted-on-light); }

/* Tooltip for disabled/coming-soon buttons */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%; left: 50%;
  transform: translateX(-50%);
  background: var(--color-black);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
[data-tooltip]:hover::after, [data-tooltip]:focus::after { opacity: 1; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--color-black);
  color: rgba(255,255,255,0.78);
  padding: 48px 0 28px;
  margin-top: 60px;
  border-top: 1px solid var(--color-border-dark);
}
footer.site-footer a { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { text-decoration: none; opacity: 0.8; font-size: 0.95rem; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.85rem;
  opacity: 0.65;
  text-align: center;
}

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.space-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
