:root {
  --bg: #f7f6f3;
  --bg-white: #fff;
  --border: #e2e0d8;
  --border-strong: #c8c5ba;
  --text-primary: #1a1917;
  --text-secondary: #6b6760;
  --text-dim: #a09c95;
  --accent: #1d4ed8;
  --accent-light: #eff4ff;
  --accent-border: #c7d7fc;
  --green: #15803d;
  --green-light: #f0fdf4;
  --green-border: #bbf7d0;
  --amber: #b45309;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(29,78,216,0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(21,128,61,0.06), transparent 22%),
    var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 40px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247,246,243,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark, .brand-mark svg { width: 28px; height: 28px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--accent); color: #fff;
}
.nav { display: flex; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text-secondary); padding: 6px 12px; border-radius: 8px; }
.nav a:hover { background: var(--bg-white); color: var(--text-primary); }

.hero { padding: 72px 0 28px; }
.hero-inner { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: center; }
.hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.05;
  font-weight: 400;
  margin: 14px 0 18px;
}
.hero-copy h1 em { color: var(--accent); font-style: italic; }
.hero-copy p { max-width: 680px; color: var(--text-secondary); font-size: 1rem; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border: 1px solid var(--accent-border);
  background: var(--accent-light); color: var(--accent);
  border-radius: 999px; font-size: 0.75rem; font-weight: 700;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent; font-weight: 600;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(29,78,216,0.22); }
.btn.ghost { background: var(--bg-white); color: var(--text-secondary); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn:hover { transform: translateY(-1px); }

.hero-card, .panel, .info-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.hero-card { padding: 24px; }
.hero-card-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 1.7px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }
.stat { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: 0; }
.stat span { color: var(--text-secondary); }
.stat strong { color: var(--text-primary); }

.section { padding: 28px 0 80px; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 22px; }
.eyebrow { font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); font-weight: 700; margin-bottom: 10px; }
.section h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.7rem, 2.4vw, 2.2rem); margin: 0; }
.section-head p, .info-card p { color: var(--text-secondary); max-width: 560px; margin: 0; }

.tabbar {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin: 4px 0 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabbar::-webkit-scrollbar { height: 0; }

.tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.tab-btn:hover { color: var(--text-primary); background: var(--bg-white); }
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(29,78,216,0.18);
}

.grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 20px; align-items: start; }
.panel { padding: 28px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; font-weight: 700; }
.field input, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; background: #fff;
  padding: 12px 14px; font: inherit; color: var(--text-primary); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent-border); box-shadow: 0 0 0 4px rgba(29,78,216,0.08); }

.switch-box {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  border: 1px solid var(--border); background: linear-gradient(180deg,#fff,#fbfaf7);
  border-radius: 14px; padding: 14px 16px; margin: 14px 0;
}
.switch-box strong { display: block; font-size: 0.88rem; }
.switch-box span { display: block; color: var(--text-dim); font-size: 0.76rem; }
.switch-box input { width: 48px; height: 28px; }

.result-top {
  padding: 22px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(29,78,216,0.08), rgba(29,78,216,0.03));
  border: 1px solid var(--accent-border); margin-bottom: 16px;
}
.result-label { color: var(--accent); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.7px; font-weight: 700; }
.result-value { font-family: var(--font-serif); font-size: 2rem; line-height: 1.1; margin: 8px 0; }
.result-sub { color: var(--text-secondary); font-size: 0.88rem; }
.metric { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.metric:last-of-type { border-bottom: 0; }
.metric span { color: var(--text-secondary); }
.metric strong { font-weight: 700; }
.metric-strong span { color: var(--text-primary); font-weight: 700; }
.metric-strong strong { font-size: 1.05rem; }
.note {
  margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: var(--amber-light); border: 1px solid var(--amber-border);
  color: #7c2d12; font-size: 0.84rem; line-height: 1.6;
}

.info-card { padding: 24px; }
.info-card h2 { margin-bottom: 10px; }

.hidden { display: none !important; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .hero-inner, .grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .section-head { flex-direction: column; align-items: start; }
  .row { grid-template-columns: 1fr; }
  .nav { display: none; }
  .tabbar { border-radius: 18px; }
}
