:root {
  /* Declared light so Android force-dark and similar browser features do not
     invert the palette into black and white. */
  color-scheme: light;

  --paper: #FAF9F7;
  --card: #FFFFFF;
  --ink: #1A1A18;
  --ink-soft: #56534D;
  --muted: #8B887F;
  --faint: #B3AFA6;

  /* Soft hairlines, never hard black. Weight comes from space, not borders. */
  --line: rgba(26, 26, 24, 0.08);
  --line-strong: rgba(26, 26, 24, 0.14);
  --rule: #E9E6E1;
  --rule-mid: #C7C3BB;

  --accent: #0F5C52;
  --accent-soft: #EBF3F1;
  --good: #92897A;

  --shadow: 0 1px 2px rgba(26, 26, 24, 0.04), 0 4px 16px rgba(26, 26, 24, 0.03);

  --max: 1080px;
  --gut: 32px;
  --r: 10px;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  font-feature-settings: 'tnum' 1, 'cv05' 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.035em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }

p { margin: 0 0 0.9rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.narrow { max-width: 640px; }

.label { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.hand { font-size: 13px; color: var(--muted); }

/* ---------- header ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.topnav { display: flex; gap: 28px; }
.topnav a { font-size: 13.5px; color: var(--muted); }
.topnav a:hover { color: var(--ink); text-decoration: none; }

/* ---------- hero ---------- */

.hero { padding: 88px 0 56px; }
.hero h1 { max-width: 17ch; margin-top: 16px; }
.hero .lede { font-size: 17px; line-height: 1.55; color: var(--ink-soft); max-width: 46ch; margin-top: 20px; }
.hero-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; }
.hero-note::before { content: ''; width: 16px; height: 1px; background: var(--faint); }

/* ---------- calculator ---------- */

.calc {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 30px 32px; box-shadow: var(--shadow);
}
.salary-display { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rupee, #salary {
  font-size: clamp(32px, 5vw, 46px); font-weight: 500;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
#salary {
  padding: 0 2px; height: auto; color: var(--ink); background: transparent;
  border: none; border-bottom: 1.5px solid var(--line-strong); border-radius: 0;
  transition: border-color 0.15s;
}
#salary:focus { outline: none; border-bottom-color: var(--accent); }
.per-month { font-size: 13px; color: var(--muted); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 24px; margin: 20px 0 6px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--rule); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--rule); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -7.5px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--accent);
  box-shadow: 0 1px 3px rgba(26,26,24,0.12);
  transition: transform 0.12s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--accent);
}
.scale-marks { display: flex; justify-content: space-between; margin-bottom: 26px; font-size: 11.5px; color: var(--faint); }

.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; margin-bottom: 7px; }
input.plain, select {
  width: 100%; height: 42px; padding: 0 12px;
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 8px; appearance: none; transition: border-color 0.15s, box-shadow 0.15s;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238B887F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 32px;
}
input.plain:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 22px; white-space: nowrap;
  font-family: inherit; font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  color: #fff; background: var(--ink);
  border: 1px solid var(--ink); border-radius: 8px; cursor: pointer;
  transition: opacity 0.15s, transform 0.08s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.985); }
.btn-ghost { background: var(--card); color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); opacity: 1; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-row { display: flex; align-items: center; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.btn-row .privacy { font-size: 12.5px; color: var(--faint); }

/* ---------- results ---------- */

.results { display: none; }
.results.on { display: block; animation: fade 0.4s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.headline { text-align: center; padding: 84px 0 68px; }
.headline .above { margin-bottom: 14px; }
.headline .figure {
  font-size: clamp(72px, 13vw, 148px); font-weight: 500;
  line-height: 0.9; letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.headline .after { margin-top: 14px; font-size: 14px; color: var(--muted); }
.headline .lowband { font-size: clamp(24px, 3.6vw, 36px); font-weight: 500; letter-spacing: -0.03em; max-width: 18ch; margin: 0 auto; line-height: 1.2; }
.chip {
  display: inline-block; margin-top: 22px;
  background: var(--accent-soft); color: var(--accent);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
}
.share-wrap { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.trio {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.trio > div { padding: 24px 26px; }
.trio > div + div { border-left: 1px solid var(--line); }
.trio .v { font-size: 32px; font-weight: 500; letter-spacing: -0.035em; margin: 10px 0 5px; font-variant-numeric: tabular-nums; }
.trio .d { font-size: 12.5px; color: var(--muted); }
.est {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  font-size: 10.5px; font-weight: 500; color: var(--muted);
  background: var(--rule); padding: 2px 6px; border-radius: 4px;
}

.section { padding: 58px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.note { font-size: 13px; color: var(--faint); text-align: right; }

/* chart */
.chart-frame { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px 18px; box-shadow: var(--shadow); }
.chart-frame svg { width: 100%; height: auto; display: block; touch-action: none; }
#curve { cursor: crosshair; }
.chart-readout {
  display: flex; gap: 26px; flex-wrap: wrap; min-height: 20px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.chart-readout b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 12px; font-size: 12px; color: var(--faint); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }

/* tiles */
.tiles { display: grid; gap: 12px; }
.tiles.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tiles.cities { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; text-align: left;
  font-family: inherit; width: 100%; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile:active { transform: none; }
.tile.static, .tile.static:hover { cursor: default; transform: none; box-shadow: none; border-color: var(--line); }
.tile.here { border-color: var(--accent); background: var(--accent-soft); }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 500; letter-spacing: -0.035em; margin: 7px 0 3px; font-variant-numeric: tabular-nums; }
.tile .d { font-size: 12.5px; color: var(--muted); }
.tile .d.accent { color: var(--accent); }

/* share bar */
.share-bar { display: flex; height: 44px; border-radius: 8px; overflow: hidden; }
.share-bar > div { display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 500; }
.share-key { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* table */
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th {
  text-align: left; padding: 0 14px 12px 0;
  font-size: 12px; font-weight: 500; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.dtable th.r, .dtable td.r { text-align: right; padding-right: 0; }
.dtable td { padding: 15px 14px 15px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tr:last-child td { border-bottom: none; }
.dtable tr.you td { background: var(--accent-soft); }
.dtable tr.you td:first-child { border-radius: 8px 0 0 8px; padding-left: 14px; }
.dtable tr.you td:last-child { border-radius: 0 8px 8px 0; }
.dtable .g { font-weight: 500; }
.dtable .you-mark { color: var(--accent); font-size: 11px; font-weight: 500; margin-left: 8px; }
.dtable .num { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.dtable .bar { display: inline-block; width: 76px; height: 5px; margin-right: 10px; background: var(--rule); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.dtable .bar i { display: block; height: 100%; background: var(--rule-mid); border-radius: 3px; }
.dtable tr.you .bar i { background: var(--accent); }
.dtable .pctv { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dtable .entry { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable .entry small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* reference bars */
.cmp { padding: 14px 0; }
.cmp + .cmp { border-top: 1px solid var(--line); }
.cmp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 9px; }
.cmp-top .amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.cmp-track { height: 5px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.cmp-fill { height: 100%; background: var(--rule-mid); border-radius: 3px; transition: width 0.4s ease; }
.cmp.mine .cmp-fill { background: var(--accent); }
.cmp.mine .cmp-top { font-weight: 500; }
.cmp-src { font-size: 11.5px; color: var(--faint); margin-top: 6px; }

/* paywall */
.paycard {
  display: flex; gap: 34px; align-items: center; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 34px 36px; margin: 40px 0;
}
.paycard-left { flex: 1; min-width: 260px; }
.paycard .label { color: rgba(255,255,255,0.55); }
.paycard h2 { color: #fff; margin-top: 10px; }
.paylist { margin: 16px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: rgba(255,255,255,0.7); }
.paylist li { padding: 4px 0 4px 18px; position: relative; }
.paylist li::before { content: ''; position: absolute; left: 0; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.paycard-right { text-align: center; min-width: 190px; }
.price { font-size: 12.5px; color: rgba(255,255,255,0.55); margin-bottom: 12px; }
.price .num { display: block; font-size: 40px; font-weight: 500; color: #fff; letter-spacing: -0.04em; }
.paycard .btn { background: #fff; border-color: #fff; color: var(--ink); width: 100%; }
.paynote { font-size: 11.5px; color: rgba(255,255,255,0.5); margin: 10px 0 0; }
.payerror { font-size: 12px; color: #FF9C7A; margin: 8px 0 0; min-height: 16px; }

#lockedZone.locked { position: relative; max-height: 520px; overflow: hidden; }
#lockedZone.locked::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 20%, var(--paper) 92%); }
.skel { background: var(--rule); border-radius: 4px; height: 10px; animation: pulse 1.8s ease-in-out infinite; }
.skel.wide { height: 22px; margin: 9px 0 6px; }
.skel.short { width: 55%; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* caveat, method, footer */
.caveat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; font-size: 14px; color: var(--ink-soft); }
.caveat strong { font-weight: 500; color: var(--ink); }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.method h3 { margin-bottom: 8px; }
.method p { font-size: 13.5px; color: var(--ink-soft); }
.method .src { font-size: 12.5px; color: var(--faint); }
.foot { padding: 44px 0 60px; font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--line); }
.foot .fl { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

@media (max-width: 860px) {
  :root { --gut: 22px; }
  .trio { grid-template-columns: 1fr; }
  .trio > div + div { border-left: none; border-top: 1px solid var(--line); }
  .topnav { display: none; }
  .dtable .hide-sm { display: none; }
  .hero { padding: 56px 0 40px; }
}
@media (max-width: 560px) {
  .calc { padding: 22px 20px; }
  .calc-row { grid-template-columns: 1fr; }
  .btn-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .section-head { flex-direction: column; gap: 6px; }
  .note { text-align: left; }
  .headline { padding: 56px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
