/* =============================================================
   THE REASSIGNMENT — stylesheet
   Helvetica / Inter, black on white, one red reserved for debt.
   ============================================================= */

:root {
  --ink: #111111;
  --paper: #ffffff;
  --muted: #888888;
  --hair: #e6e6e6;
  --accent: #c8102e;      /* debt red. used sparingly. */
  --mono: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--pad);
  line-height: 1.35;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 4rem 0;
}

/* ---------- WORDMARK ---------- */

.wordmark {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  font-weight: 700;
}
.wordmark nav a { text-decoration: none; }
.wordmark nav a:hover { text-decoration: underline; }

/* ---------- HERO ---------- */

.hero {
  padding: 6rem 0 4rem;
}
.overline {
  font-size: clamp(0.95rem, 1.4vw, 1.125rem);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1.75rem 0;
  letter-spacing: 0.01em;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hair);
  max-width: 28rem;
}
.overline em { font-style: italic; }
.hero h1 {
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 2rem 0;
}
.hero h1 em {
  font-style: italic;
  font-weight: 900;
}
.hero .lede {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  max-width: 42ch;
  font-weight: 400;
  line-height: 1.45;
  margin: 0;
}
.small {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9em;
}

/* ---------- TOOL ---------- */

.tool {
  padding: 2rem 0;
}

.year-display {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.year-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--muted);
}
.year-number {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.slider-wrap {
  margin: 0 0 3rem 0;
}

input[type="range"]#year-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 0;
  outline: none;
  padding: 0;
  margin: 1.5rem 0 0.75rem 0;
}
input[type="range"]#year-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  cursor: grab;
  border: none;
  margin-top: 0;
  transition: transform 0.1s;
}
input[type="range"]#year-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
input[type="range"]#year-slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: var(--ink);
  cursor: grab; border: none;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- COMPOSITION BAR ---------- */

.composition {
  margin: 0 0 3rem 0;
}
.composition-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}
.composition-title {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--ink);
}
.composition-caption {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.composition-bar {
  display: flex;
  width: 100%;
  height: 140px;
  overflow: hidden;
  border: 1px solid var(--hair);
}
.seg {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  color: white;
  font-family: var(--mono);
  overflow: hidden;
  min-width: 0;
  transition: flex-basis 0.25s ease-out;
}
.seg-name {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-pct {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.seg-corp    { background: var(--ink);   color: #fff; }
.seg-ind     { background: #9a9a9a;      color: #fff; }
.seg-payroll { background: var(--accent); color: #fff; }
.seg-other   { background: #e2e2e2;      color: var(--ink); }

/* Segments that become very narrow hide their name to keep the % legible */
.seg-narrow .seg-name { opacity: 0; }

/* ---------- STATS ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  margin: 0 0 3rem 0;
}
.stat {
  background: var(--paper);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--muted);
}
.stat-value {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-debt .stat-label,
.stat-debt .stat-value {
  color: var(--accent);
}

.counterfactual {
  max-width: 42em;
}
.counterfactual-lead {
  font-size: clamp(1.25rem, 2.5vw, 1.875rem);
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 1rem 0;
  letter-spacing: -0.01em;
}
.counterfactual-lead strong {
  font-weight: 900;
  font-size: 1.25em;
  display: inline-block;
  letter-spacing: -0.02em;
}
.counterfactual-framing {
  font-size: 1rem;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}
.country-match {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}

/* ---------- SALARY ---------- */

.salary h2,
.share h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
}
.salary-intro {
  font-size: 1.0625rem;
  margin: 0 0 2rem 0;
  max-width: 42ch;
}

.salary-input {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.5rem;
  max-width: 24rem;
  margin-bottom: 2.5rem;
}
.salary-input .dollar {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--muted);
}
.salary-input input {
  flex: 1;
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.salary-output p {
  font-size: 1.0625rem;
  margin: 0 0 0.75rem 0;
  max-width: 55ch;
  line-height: 1.5;
}
.salary-verdict {
  font-weight: 500;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hair);
  margin-top: 1.25rem !important;
}

/* ---------- SHARE ---------- */

.share-intro {
  font-size: 1.0625rem;
  margin: 0 0 1.5rem 0;
  max-width: 42ch;
}
.share-button {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  padding: 1rem 2rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.share-button:hover { opacity: 0.85; }

#share-canvas {
  display: block;
  margin-top: 2rem;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--hair);
}

/* ---------- FOOTER ---------- */

footer {
  margin-top: 6rem;
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--hair);
}
.footer-line {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.01em;
  margin: 0 0 2rem 0;
}
.footer-meta {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}
.footer-meta .dot { margin: 0 0.75rem; }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 3rem 0 2rem; }
  hr { margin: 3rem 0; }
}

@media (max-width: 420px) {
  .year-display { flex-direction: column; gap: 0.25rem; align-items: flex-start; }
  .wordmark { font-size: 0.65rem; }
}
