:root {
  --bg: #0c111a;
  --bg-elevated: #141c29;
  --bg-card: #182232;
  --bg-input: #0f1622;
  --border: #263449;
  --border-strong: #374a66;
  --text: #edf2f7;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.14);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --max-w: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(245, 158, 11, 0.08), transparent 60%),
    radial-gradient(760px 380px at 90% -5%, rgba(56, 189, 248, 0.07), transparent 55%),
    var(--bg);
}

a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
.is-hidden { display: none !important; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 17, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-soft);
  font-size: 0.91rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-card);
  color: var(--gold);
  text-decoration: none;
}

.menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
}

/* Main */
main { flex: 1; padding: 28px 0 56px; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold); }

/* Hero */
.hero {
  background: linear-gradient(135deg, rgba(24, 34, 50, 0.96), rgba(17, 25, 39, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.1vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--text-soft);
  max-width: 74ch;
  font-size: 1rem;
}
.unlock-callout {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
  font-size: 0.9rem;
}
.unlock-callout strong { color: var(--sky); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--gold);
  color: #0b0f17;
}
.btn-primary:hover { background: #fbbf24; }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 6px 12px; font-size: 0.84rem; }

/* Grid & Cards (Accessible stretched-link pattern) */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}
.card-interactive {
  transition: border-color 0.15s, transform 0.15s;
}
.card-interactive:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.card-title-link {
  color: var(--text);
  text-decoration: none;
}
.card-title-link:hover {
  color: var(--gold);
  text-decoration: none;
}
.card-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.card-icon {
  font-size: 1.55rem;
  margin-bottom: 10px;
  line-height: 1;
}
.card h2, .card h3 {
  margin: 0 0 8px;
  font-size: 1.14rem;
  line-height: 1.3;
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}
.card-cta {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
}

.section-title {
  margin: 34px 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.section-sub {
  margin: -4px 0 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Calculator Layout */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 20px;
  align-items: start;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.field small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.field input[type="number"],
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-soft);
}
.checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
  cursor: pointer;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.preset-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.preset-chip:hover,
.preset-chip.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

.boss-meta-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--sky);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.boss-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin-top: 6px;
}
.boss-meta-box strong { color: var(--text); }

/* Result Panel */
.result-panel {
  background: linear-gradient(180deg, #162030, #121a27);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.result-header h2 { margin: 0; font-size: 1.12rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stat-box {
  background: rgba(12, 17, 26, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}
.stat-box.wide { grid-column: 1 / -1; }
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  margin-top: 4px;
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.sky { color: var(--sky); }
.stat-note {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-banner {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.status-safe {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}
.status-danger {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}
.status-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-safe { background: var(--green-soft); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); }
.pill-danger { background: var(--red-soft); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.pill-info { background: var(--sky-soft); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.pill-gold { background: var(--gold-soft); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.35); }

.bar-track {
  width: 100%;
  height: 10px;
  background: #0b1019;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 8px;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #fbbf24);
  transition: width 0.2s ease;
}
.bar-fill.safe { background: linear-gradient(90deg, #16a34a, #22c55e); }
.bar-fill.danger { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }
tr.clickable-row { cursor: pointer; transition: background 0.12s; }
tr.clickable-row:hover { background: rgba(245, 158, 11, 0.07); }

/* Skill chips */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 12px;
}
.skill-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s;
}
.skill-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.skill-card a {
  color: var(--text);
  font-weight: 700;
  font-size: 0.96rem;
}
.skill-card a:hover { color: var(--gold); text-decoration: none; }
.skill-card a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
}
.skill-icon { font-size: 1.35rem; }
.skill-cat { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

/* Content & Prose */
.prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-top: 24px;
}
.prose h2 { margin-top: 24px; margin-bottom: 10px; font-size: 1.25rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 18px; margin-bottom: 8px; font-size: 1.05rem; color: var(--gold); }
.prose p, .prose li { color: var(--text-soft); font-size: 0.96rem; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.formula-box {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: #fde68a;
  overflow-x: auto;
  margin: 12px 0;
}

/* FAQ */
.faq-list { display: grid; gap: 12px; margin-top: 14px; }
details.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
details.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  list-style: none;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::before {
  content: "+ ";
  color: var(--gold);
  font-weight: 800;
}
details.faq-item[open] summary::before { content: "− "; }
details.faq-item p {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.93rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #090d14;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}
.footer-grid h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.95rem;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--gold);
  color: #0b0f17;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Ad Slots (Responsive, dark-matched, zero mobile overflow) */
.ad-slot {
  margin: 26px auto;
  padding: 12px 14px 14px;
  background: rgba(15, 22, 34, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
}
.ad-slot-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ad-slot-native {
  min-height: 120px;
}
.ad-slot-banner {
  min-height: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-slot-banner iframe {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
@media (max-width: 780px) {
  .ad-slot-banner { display: none; }
}

@media (max-width: 900px) {
  .calc-layout,
  .grid-4,
  .grid-3,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-2, .boss-meta-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #0e1420;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .field-grid, .stat-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
}
