@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0d12;
  --bg-2: #0f1318;
  --bg-3: #141922;
  --bg-4: #1b2230;
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --text: #e8eaf0;
  --text-2: #8b93a8;
  --text-3: #525c72;
  --accent: #c8a96e;
  --accent-2: #e8c88e;
  --c-green: #4caf82;
  --c-teal: #3abeaa;
  --c-amber: #d4a843;
  --c-orange: #e07c3c;
  --c-red: #e05252;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --nav-h: 64px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,13,18,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.nav-logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--bg);
  font-weight: 600;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.nav-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
  font-weight: 400;
  letter-spacing: .02em;
}

.nav-name span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-2);
  text-decoration: none;
  letter-spacing: .02em;
  transition: color .2s, background .2s;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--accent); background: rgba(200,169,110,.08); }

.nav-link svg { width: 14px; height: 14px; opacity: .7; }

/* ─── PAGE CONTAINER ─── */
.page {
  display: none;
  min-height: 100vh;
  padding-top: var(--nav-h);
}
.page.active { display: block; }

/* ─── HERO ─── */
.hero {
  padding: 5rem 2rem 3rem;
  max-width: 1120px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-eyebrow::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 640px;
}

.hero h1 em { font-style: italic; color: var(--accent); }

.hero p {
  font-size: 15px;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.7;
}

/* ─── MAIN LAYOUT ─── */
.main-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

/* ─── CALCULATOR PANEL ─── */
.calc-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.form-card-header {
  padding: 1rem 1.5rem .75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.form-card-icon {
  width: 28px; height: 28px;
  background: rgba(200,169,110,.12);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}

.form-card-icon svg { width: 14px; height: 14px; stroke: var(--accent); }

.form-card-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.form-card-body {
  padding: 1.25rem 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .875rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.form-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: .03em;
}

.form-input, .form-select {
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: .625rem .875rem;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--text);
  width: 100%;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-select {
  font-family: var(--font-body);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .875rem center;
  padding-right: 2.25rem;
}

.form-select option {
  background: var(--bg-3);
  color: var(--text);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-4);
}

.form-input::placeholder { color: var(--text-3); }
.form-hint { font-size: 11px; color: var(--text-3); }

/* ─── SECTOR INFO CARD ─── */
.sector-info {
  display: none;
  background: rgba(200,169,110,.05);
  border: 1px solid rgba(200,169,110,.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.sector-info-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: .25rem;
}

.sector-info-pe {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: .75rem;
}

.sector-info-note {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: .875rem;
}

.sector-info-key {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: .625rem;
}

.weights-wrap { display: flex; flex-wrap: wrap; gap: .375rem; }

.info-badge {
  font-size: 11px;
  padding: .25rem .625rem;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  font-family: var(--font-mono);
}

.info-badge.info-badge-hi {
  background: rgba(200,169,110,.12);
  border-color: rgba(200,169,110,.3);
  color: var(--accent);
}

/* ─── CALCULATE BUTTON ─── */
.calc-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-lg);
  padding: 1rem 2rem;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: .04em;
  cursor: pointer;
  width: 100%;
  transition: background .2s, transform .1s;
}

.calc-btn:hover { background: var(--accent-2); }
.calc-btn:active { transform: scale(.99); }

/* ─── ERROR ─── */
.error-msg {
  display: none;
  align-items: center;
  gap: .75rem;
  background: rgba(224,82,82,.08);
  border: 1px solid rgba(224,82,82,.25);
  border-radius: var(--radius);
  padding: .875rem 1.25rem;
  font-size: 13px;
  color: #ef9f9f;
}

/* ─── SIDEBAR ─── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.sidebar-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.checklist { display: flex; flex-direction: column; gap: .5rem; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.check-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(200,169,110,.1);
  border: 1px solid rgba(200,169,110,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.check-icon svg { width: 9px; height: 9px; stroke: var(--accent); }

.glossary { display: flex; flex-direction: column; gap: .75rem; }

.glossary-item {}
.glossary-term {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: .125rem;
}

.glossary-def { font-size: 12px; color: var(--text-2); line-height: 1.55; }

/* ─── RESULTS ─── */
#results {
  display: none;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

/* ─── VERDICT ─── */
.result-header { margin-bottom: 1.5rem; }

.verdict-block {
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid;
}

.verdict-block.verdict-green { background: rgba(76,175,130,.07); border-color: rgba(76,175,130,.25); }
.verdict-block.verdict-teal { background: rgba(58,190,170,.07); border-color: rgba(58,190,170,.25); }
.verdict-block.verdict-amber { background: rgba(212,168,67,.07); border-color: rgba(212,168,67,.25); }
.verdict-block.verdict-orange { background: rgba(224,124,60,.07); border-color: rgba(224,124,60,.25); }
.verdict-block.verdict-red { background: rgba(224,82,82,.07); border-color: rgba(224,82,82,.25); }

.verdict-ticker {
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--font-mono);
  margin-bottom: .5rem;
  letter-spacing: .04em;
}

.verdict-ticker span { color: var(--text-3); }

.verdict-tag {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -.5px;
  line-height: 1;
  margin-bottom: .375rem;
}

.verdict-green .verdict-tag { color: var(--c-green); }
.verdict-teal .verdict-tag { color: var(--c-teal); }
.verdict-amber .verdict-tag { color: var(--c-amber); }
.verdict-orange .verdict-tag { color: var(--c-orange); }
.verdict-red .verdict-tag { color: var(--c-red); }

.verdict-label {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: .625rem;
}

.verdict-desc { font-size: 14px; color: var(--text-2); line-height: 1.65; max-width: 640px; }

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.stat-label { font-size: 11px; color: var(--text-3); letter-spacing: .04em; margin-bottom: .375rem; }
.stat-value { font-size: 17px; font-weight: 500; font-family: var(--font-mono); color: var(--text); }

/* ─── GAUGE ─── */
.gauge-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.gauge-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.gauge-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--c-red), var(--c-orange) 30%, var(--c-amber) 50%, var(--c-teal) 70%, var(--c-green));
  position: relative;
  margin-bottom: .625rem;
}

.gauge-thumb {
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  transform: translate(-50%, -50%);
  transition: left .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: .5rem;
}

.gauge-score {
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.gauge-score strong { color: var(--text); }

/* ─── METRICS LIST ─── */
.metrics-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 1rem 1.5rem .75rem;
  border-bottom: 1px solid var(--border);
}

.metrics-list { padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: .125rem; }

.metric-item {
  padding: .875rem 0;
  border-bottom: 1px solid var(--border);
}

.metric-item:last-child { border-bottom: none; padding-bottom: 0; }
.metric-item:first-child { padding-top: 0; }

.metric-item.metric-disabled { opacity: .45; }

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .25rem;
}

.metric-left { display: flex; align-items: center; gap: .625rem; flex: 1; min-width: 0; }
.metric-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-weight { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); flex-shrink: 0; }
.metric-right { display: flex; align-items: center; gap: .625rem; flex-shrink: 0; }
.metric-value { font-size: 14px; font-weight: 500; font-family: var(--font-mono); color: var(--text); min-width: 56px; text-align: right; }
.metric-sub { font-size: 11.5px; color: var(--text-3); margin-bottom: .375rem; }
.metric-bar { height: 4px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: 2px; transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ─── BADGES ─── */
.badge {
  font-size: 11px;
  padding: .25rem .625rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: .02em;
}

.badge-green { background: rgba(76,175,130,.15); color: #6ed4a8; border: 1px solid rgba(76,175,130,.25); }
.badge-teal { background: rgba(58,190,170,.12); color: #5dd4c4; border: 1px solid rgba(58,190,170,.25); }
.badge-amber { background: rgba(212,168,67,.12); color: #d4a843; border: 1px solid rgba(212,168,67,.25); }
.badge-orange { background: rgba(224,124,60,.12); color: #e0924a; border: 1px solid rgba(224,124,60,.25); }
.badge-red { background: rgba(224,82,82,.12); color: #e07272; border: 1px solid rgba(224,82,82,.25); }
.badge-gray { background: var(--bg-4); color: var(--text-3); border: 1px solid var(--border); }

/* ─── DISCLAIMER ─── */
.disclaimer {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.65;
}

.disclaimer strong { color: var(--accent); }

/* ════════════════════════════════════════
   HOW IT WORKS PAGE
═══════════════════════════════════════ */
.how-hero {
  padding: 5rem 2rem 3rem;
  max-width: 800px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.how-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.how-hero p { font-size: 15px; color: var(--text-2); line-height: 1.7; }

.how-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.how-intro {
  background: rgba(200,169,110,.05);
  border: 1px solid rgba(200,169,110,.18);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.75;
}

.how-intro strong { color: var(--accent); }

.how-section {}
.how-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.how-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.metric-cards { display: flex; flex-direction: column; gap: 1rem; }

.metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
}

.metric-card-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(200,169,110,.1);
  border: 1px solid rgba(200,169,110,.2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.metric-card-body {}
.metric-card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .25rem;
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-wrap: wrap;
}

.metric-card-formula {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .125rem .5rem;
  color: var(--accent);
}

.metric-card-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: .875rem;
}

.metric-card-thresholds {
  display: flex;
  gap: .375rem;
  flex-wrap: wrap;
}

.threshold-item {
  font-size: 11.5px;
  padding: .25rem .625rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.th-green { background: rgba(76,175,130,.12); color: var(--c-green); border: 1px solid rgba(76,175,130,.2); }
.th-amber { background: rgba(212,168,67,.12); color: var(--c-amber); border: 1px solid rgba(212,168,67,.2); }
.th-red { background: rgba(224,82,82,.12); color: var(--c-red); border: 1px solid rgba(224,82,82,.2); }

.score-explainer {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.score-table { width: 100%; border-collapse: collapse; }
.score-table th {
  background: var(--bg-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: .75rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.score-table td {
  padding: .75rem 1.5rem;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.score-table tr:last-child td { border-bottom: none; }
.score-table td:first-child { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--text); width: 60px; }

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

.sector-card-how {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.sector-card-name { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: .25rem; }
.sector-card-pe { font-size: 11px; color: var(--accent); font-family: var(--font-mono); margin-bottom: .5rem; }
.sector-card-key { font-size: 12px; color: var(--text-2); }
.sector-card-key span { color: var(--text-3); }

.verdict-guide {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.verdict-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1.25rem;
}

.verdict-row-score {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  min-width: 110px;
  flex-shrink: 0;
}

.verdict-row-tag { font-size: 13.5px; font-weight: 500; }
.verdict-row-tag.clr-green { color: var(--c-green); }
.verdict-row-tag.clr-teal { color: var(--c-teal); }
.verdict-row-tag.clr-amber { color: var(--c-amber); }
.verdict-row-tag.clr-orange { color: var(--c-orange); }
.verdict-row-tag.clr-red { color: var(--c-red); }

.warning-box {
  background: rgba(224,124,60,.05);
  border: 1px solid rgba(224,124,60,.2);
  border-left: 3px solid var(--c-orange);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

.warning-box strong { color: var(--c-amber); }
.warning-box ul { margin-top: .75rem; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .375rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .sidebar { position: static; }
  #results { padding: 0 1rem 4rem; }
}

@media (max-width: 600px) {
  .navbar-inner { padding: 0 1rem; }
  .nav-name { display: none; }
  .hero, .main-layout, .how-hero, .how-content { padding-left: 1rem; padding-right: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
