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

:root {
  --bg: #0d0f14;
  --bg2: #13161d;
  --bg3: #1a1e28;
  --card: #1e2330;
  --border: #2a2f3f;
  --gold: #c8a96e;
  --gold-light: #e2c88a;
  --green: #4ade9a;
  --text: #e8eaf0;
  --text-muted: #8890a4;
  --text-dim: #555d70;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,20,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.4rem;
  color: var(--text);
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}

.nav-logo span { color: var(--gold); }

.nav-links {
  display: flex; gap: 8px; list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-links a:hover { color: var(--text); background: var(--bg3); }

/* HERO */
.hero {
  padding: 80px 24px 60px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.25);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

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

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* SEARCH */
.search-wrap {
  max-width: 480px;
  margin: 0 auto 60px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 14px 24px 14px 48px;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.search-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,110,0.12); }
.search-wrap input::placeholder { color: var(--text-dim); }

.search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
}

/* AD SLOT */
.ad-slot {
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ad-slot-horizontal {
  width: 100%; height: 90px;
  max-width: 728px; margin: 0 auto 40px;
}

.ad-slot-sidebar {
  width: 300px; height: 250px;
  flex-shrink: 0;
}

.ad-slot-inline {
  width: 100%; height: 90px; margin: 32px 0;
}

/* SECTION */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.section-header h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.6rem;
  color: var(--text);
}

.section-header a {
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

/* CALCULATOR GRID */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(200,169,110,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.calc-card:hover { border-color: rgba(200,169,110,0.35); transform: translateY(-2px); box-shadow: var(--shadow); }
.calc-card:hover::before { opacity: 1; }

.calc-icon {
  width: 44px; height: 44px;
  background: rgba(200,169,110,0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

.calc-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.calc-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.calc-card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(74,222,154,0.1);
  color: var(--green);
  width: fit-content;
}

.calc-card .tag.popular {
  background: rgba(200,169,110,0.12);
  color: var(--gold);
}

/* CALCULATOR PAGE LAYOUT */
.calc-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.calc-main {}

.calc-sidebar { display: flex; flex-direction: column; gap: 20px; }

.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.calc-header { margin-bottom: 32px; }

.calc-header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 10px;
}

.calc-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
}

/* CALCULATOR WIDGET */
.calc-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.field-group.single { grid-template-columns: 1fr; }

.field {
  display: flex; flex-direction: column; gap: 8px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field input, .field select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.1);
}

.field select { cursor: pointer; }

.input-prefix {
  position: relative;
}

.input-prefix span {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 0.9rem; pointer-events: none;
}

.input-prefix input { padding-left: 28px; }

.range-wrap { display: flex; flex-direction: column; gap: 8px; }

.range-wrap input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  background: var(--border);
  border-radius: 100px;
  outline: none;
  padding: 0;
  border: none;
}

.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--bg);
}

.range-value {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  text-align: right;
}

.btn-calculate {
  width: 100%;
  background: var(--gold);
  color: #0d0f14;
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
  margin-top: 8px;
}

.btn-calculate:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,169,110,0.3); }

/* RESULTS */
.results-panel {
  background: linear-gradient(135deg, #1a2235 0%, #1e2330 100%);
  border: 1px solid rgba(200,169,110,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 24px;
  display: none;
}

.results-panel.visible { display: block; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-primary {
  text-align: center;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.results-primary .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.results-primary .amount {
  font-family: 'Instrument Serif', serif;
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-item {}

.result-item .r-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.result-item .r-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.result-item .r-value.positive { color: var(--green); }

/* SIDEBAR WIDGET */
.sidebar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.sidebar-widget h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.sidebar-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: var(--transition);
}

.sidebar-links a:hover { background: var(--bg3); color: var(--text); }
.sidebar-links a span { font-size: 1rem; }

/* INFO SECTION */
.info-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 24px;
}

.info-section h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.info-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.info-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 10px;
}

.faq-item { margin-bottom: 20px; }
.faq-item h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.faq-item p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }

/* FOOTER */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.footer-brand .logo span { color: var(--gold); }

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-disclaimer {
  max-width: 1200px;
  margin: 16px auto 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .calc-page { grid-template-columns: 1fr; }
  .calc-sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .field-group { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero { padding: 48px 24px 40px; }
}

/* UTILITY */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.mt-8 { margin-top: 8px; }
.chart-bar-wrap { margin-top: 20px; }
.chart-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.chart-bar-track { height: 8px; background: var(--bg2); border-radius: 100px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 100px; background: var(--gold); transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.chart-bar-fill.green { background: var(--green); }
