:root {
  --ink: #13251f;
  --muted: #63736d;
  --paper: #f1f3ed;
  --panel: rgba(252, 253, 248, .88);
  --line: #cdd6cf;
  --lime: #c8f24b;
  --lime-dark: #739b00;
  --coral: #ff6f57;
  --blue: #4f70ff;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .25; pointer-events: none; z-index: -1; }
.ambient-one { width: 420px; height: 420px; background: var(--lime); top: -190px; right: 5%; }
.ambient-two { width: 330px; height: 330px; background: #91a4ff; bottom: 5%; left: -180px; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .shell, footer { width: min(1180px, calc(100% - 40px)); margin: auto; }
.header-inner { min-height: 116px; display: flex; align-items: center; gap: 36px; }
.brand {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  font-size: clamp(3.6rem, 8vw, 6.4rem); line-height: .8; letter-spacing: -.09em; font-weight: 800;
}
.brand:hover, .brand:focus-visible { color: var(--blue); }
.tagline { margin: 0; font-size: .78rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: .08em; }
.status-chip { margin-left: auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font: 500 .72rem "DM Mono", monospace; text-transform: uppercase; }
.status-chip span { display: inline-block; width: 7px; height: 7px; background: var(--lime-dark); border-radius: 50%; margin-right: 7px; }

.shell { padding: 34px 0 80px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 20px 30px; margin-bottom: 34px; }
.control-cluster { display: grid; gap: 8px; }
.market-cluster { flex: 1; min-width: 420px; }
.control-label, .section-kicker, .eyebrow { font: 500 .69rem "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.segmented, .market-strip { display: flex; gap: 5px; padding: 5px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 999px; }
.segmented button, .market-strip button, .table-tabs button {
  border: 0; background: transparent; border-radius: 999px; padding: 10px 15px; cursor: pointer; white-space: nowrap; font-size: .82rem; font-weight: 700;
}
.segmented button.active, .market-strip button.active { background: var(--ink); color: white; }
.market-strip { overflow-x: auto; scrollbar-width: none; }
.market-strip::-webkit-scrollbar { display: none; }

.lookup-form { display: flex; width: 100%; gap: 12px; align-items: end; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.lookup-form label { display: grid; gap: 8px; }
.lookup-form label:first-child { flex: 1; }
input, select { height: 48px; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 0 14px; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(79,112,255,.18); border-color: var(--blue); }
.analyze-button { height: 48px; border: 0; background: var(--lime); border-radius: 12px; padding: 0 20px; font-weight: 800; cursor: pointer; }
.analyze-button:hover { background: #b7e331; }

.hero { min-height: 380px; display: grid; grid-template-columns: 1.5fr .75fr; gap: 60px; padding: clamp(32px, 6vw, 72px); border-radius: 32px; background: var(--ink); color: white; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 330px; height: 330px; border: 70px solid var(--lime); border-radius: 50%; right: -170px; bottom: -190px; opacity: .95; }
.eyebrow { color: var(--lime); margin: 0 0 28px; }
.hero h1, .about-view h1 { margin: 0; font-size: clamp(3rem, 7vw, 6.7rem); line-height: .93; letter-spacing: -.065em; font-weight: 500; }
.hero h1 em, .about-view h1 em { color: var(--lime); font-style: normal; }
.hero-meta { align-self: end; display: grid; gap: 16px; position: relative; z-index: 1; }
.hero-meta div { padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.2); display: grid; gap: 5px; }
.hero-meta span { font: .68rem "DM Mono", monospace; color: #aebdb6; text-transform: uppercase; letter-spacing: .08em; }
.hero-meta strong { font-size: 1rem; }

.method-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.method-row p { margin: 0; color: var(--muted); font: .73rem "DM Mono", monospace; text-transform: uppercase; }
.method-switch button.active { background: var(--lime); color: var(--ink); }

.narrative-card { display: grid; grid-template-columns: 60px 1fr; gap: 20px; margin: 46px 0; padding: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 50px rgba(35, 57, 47, .06); }
.section-number { font: 500 .72rem "DM Mono", monospace; color: var(--blue); }
.section-kicker { margin: 0 0 12px; }
#narrative p { margin: 0 0 12px; max-width: 850px; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.65; }
#narrative strong { box-shadow: inset 0 -.45em var(--lime); }

.results-section { padding: 46px 0; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 60px 1fr; gap: 20px; margin-bottom: 32px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.045em; }
.metric-group { margin: 0 0 34px 80px; }
.metric-group h3 { margin: 0 0 13px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric-card { min-height: 128px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card span { color: var(--muted); font-size: .78rem; }
.metric-card strong { font-size: clamp(1.15rem, 2.2vw, 1.85rem); letter-spacing: -.035em; }
.metric-card.positive strong { color: #497200; }
.metric-card.negative strong { color: #c73d29; }

.table-tabs { margin-left: 80px; display: flex; flex-wrap: wrap; gap: 7px; }
.table-tabs button { border: 1px solid var(--line); }
.table-tabs button.active { background: var(--ink); color: white; border-color: var(--ink); }
.table-caption { margin: 18px 0 12px 80px; color: var(--muted); font-size: .82rem; }
.table-wrap { margin-left: 80px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: .8rem; }
th { position: sticky; top: 0; background: #e4e8e1; text-align: left; font: 500 .67rem "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: rgba(200,242,75,.15); }
.empty-state { margin-left: 80px; border: 1px dashed var(--line); border-radius: 16px; padding: 32px; }
.empty-state p { color: var(--muted); margin-bottom: 0; }

.skeleton { margin: 46px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.skeleton div { height: 140px; border-radius: 16px; background: linear-gradient(100deg, #e4e8e1 30%, #f7f8f4 50%, #e4e8e1 70%); background-size: 400%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.notice { margin: 30px 0; padding: 18px 20px; border: 1px solid #e7a596; border-radius: 14px; background: #fff0eb; color: #8e2f20; }

.about-view { padding: 40px 0 100px; }
.about-view > .eyebrow { color: var(--blue); margin-top: 80px; }
.about-view h1 { max-width: 1050px; }
.about-view h1 em { color: var(--blue); }
.back-button { border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; background: transparent; cursor: pointer; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-top: 70px; padding-top: 40px; border-top: 1px solid var(--line); }
.about-lead { margin: 0; font-size: clamp(1.35rem, 3vw, 2.2rem); line-height: 1.35; letter-spacing: -.035em; }
.about-copy h2 { margin: 0 0 10px; font-size: 1rem; }
.about-copy p { margin: 0 0 32px; color: var(--muted); line-height: 1.75; }
.about-copy .about-note { color: var(--ink); border-left: 4px solid var(--lime); padding-left: 18px; font-weight: 700; }

footer { border-top: 1px solid var(--line); padding: 36px 0 60px; display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
footer > div:first-child { display: grid; align-content: start; }
footer strong { font-size: 1.5rem; letter-spacing: -.06em; }
footer span, .footer-notes { color: var(--muted); font-size: .75rem; }
.footer-notes p { margin: 0 0 7px; }

@media (max-width: 800px) {
  .header-inner, .shell, footer { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 94px; gap: 18px; }
  .brand { font-size: 3.7rem; }
  .tagline { display: none; }
  .status-chip { font-size: .62rem; }
  .market-cluster { min-width: 100%; }
  .hero { grid-template-columns: 1fr; min-height: 480px; gap: 40px; padding: 30px 24px; }
  .hero h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .hero::after { display: none; }
  .method-row { align-items: flex-start; flex-direction: column; }
  .lookup-form { align-items: stretch; flex-direction: column; }
  .narrative-card, .section-heading { grid-template-columns: 36px 1fr; gap: 10px; padding-left: 0; padding-right: 0; background: transparent; border: 0; box-shadow: none; }
  .metric-group, .table-tabs, .table-caption, .table-wrap, .empty-state { margin-left: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; padding: 16px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  footer { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  .metric-grid { grid-template-columns: 1fr; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
