/* ───────────────────────────────────────────────────────────────────────────
   worth. — web
   Shares the design tokens of the extension side panel, but laid out for a
   wide viewport rather than a 400px rail.
─────────────────────────────────────────────────────────────────────────── */

/* Cabinet Grotesk (Fontshare, ITF Free Font Licence), self-hosted so every page
   gets it with no third-party request. There is no 600 weight. */
@font-face { font-family: 'Cabinet Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/cabinet-grotesk-400.woff2') format('woff2'); }
@font-face { font-family: 'Cabinet Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/cabinet-grotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Cabinet Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/cabinet-grotesk-700.woff2') format('woff2'); }
@font-face { font-family: 'Cabinet Grotesk'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/cabinet-grotesk-800.woff2') format('woff2'); }

:root {
  --black:        #12121A;
  --yellow:       #FFF06B;
  --pink:         #FFD2EA;
  --mint:         #79E8B3;
  --blue-light:   #BBEFFF;
  --pink-soft:    #FFA4D4;
  --purple:       #7938BE;
  --blue-accent:  #2F5FD0;

  --bg:           #F1F1F5;
  --surface:      #fff;
  --surface-dim:  #FCFCFE;
  --border:       #12121A;
  --border-light: #EDEDF3;

  --text-primary:   #12121A;
  --text-secondary: #3A3A4A;
  --text-muted:     #5A5A6B;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  12px;
  --radius-xl:  14px;

  --maxw: 1040px;
}

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

body {
  font-family: 'Cabinet Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--black); }

.hidden { display: none !important; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
}
/* The wordmark on a black tile, yellow full stop — as in the design. */
.logo { display: inline-flex; text-decoration: none; }
.logo-tile {
  display: inline-flex;
  padding: 6px 11px 8px;
  background: var(--black);
  border: 2px solid var(--black);
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}
.dot { color: var(--yellow); }
.site-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  font-weight: 600;
}
.site-nav a { color: var(--text-secondary); }
.site-nav a:hover { color: var(--black); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 24px 64px;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero { text-align: center; }
.hero-title {
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 800;
  letter-spacing: -0.035em;
  /* 1.04 clipped descenders on words like "job" */
  line-height: 1.12;
  text-wrap: balance;
}
.hl {
  background: var(--yellow);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hero-sub {
  max-width: 560px;
  margin: 20px auto 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ─── Paste card ─────────────────────────────────────────────────────────── */
.paste-card {
  margin: 32px auto 0;
  max-width: 720px;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
}
.paste-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 9px;
}
.paste-input {
  width: 100%;
  resize: vertical;
  min-height: 210px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--surface-dim);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
}
.paste-input:focus {
  outline: none;
  border-color: var(--border);
  background: var(--surface);
}
.paste-input::placeholder { color: #A0A0B4; }

.paste-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}
.char-count { font-size: 12px; color: var(--text-muted); }
.paste-error {
  margin-top: 11px;
  padding: 9px 12px;
  background: var(--pink-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
}

/* Link first; the text box is the fallback. */
.url-field {
  display: flex;
  gap: 10px;
}
.url-input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-dim);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
}
.url-input:focus { outline: none; border-color: var(--border); background: var(--surface); }
.url-input::placeholder { color: #A0A0B4; }
.text-toggle {
  margin-top: 14px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.paste-panel { margin-top: 16px; }
.likely-line {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.likely-line:empty { display: none; }
@media (max-width: 560px) {
  .url-field { flex-direction: column; }
}

.trust-line {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.btn-primary { background: var(--black); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-primary:disabled {
  background: #C9C9D6;
  border-color: #C9C9D6;
  color: #fff;
  cursor: not-allowed;
}
.btn-ghost { background: var(--surface); color: var(--black); }
.btn-ghost:hover { background: #F3F3F8; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-back { margin-bottom: 22px; }

/* ─── Explainer ──────────────────────────────────────────────────────────── */
.explainer {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.explainer-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.explainer-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--purple);
  margin-bottom: 9px;
}
.explainer-item h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 8px;
  text-wrap: pretty;
}
.explainer-item p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ─── Loading ────────────────────────────────────────────────────────────── */
.loading-wrap {
  padding: 90px 0;
  text-align: center;
}
.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 18px;
  border: 3px solid var(--border-light);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 17px; font-weight: 700; }
.loading-sub { margin-top: 7px; font-size: 14px; color: var(--text-muted); }

/* ─── Result ─────────────────────────────────────────────────────────────── */
.result-head { margin-bottom: 22px; }
.result-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}
.result-sub {
  margin-top: 7px;
  font-size: 15px;
  color: var(--text-secondary);
}

.result-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .result-grid { grid-template-columns: 1fr; }
}
.result-main, .result-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Verdict card */
.verdict-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--surface);
}
.verdict-card.below-spec    { background: var(--pink); }
.verdict-card.proportionate { background: var(--mint); }
.verdict-card.no-verdict    { background: var(--yellow); }
.verdict-card.no-salary     { background: var(--blue-light); }

.verdict-badge {
  display: inline-flex;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--surface);
}
.label-xs {
  margin-top: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.verdict-range {
  margin-top: 5px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.confidence-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  font-size: 12px;
  color: var(--text-secondary);
}
.conf-bars { display: flex; align-items: flex-end; gap: 2px; }
.conf-bars span {
  width: 4px;
  background: rgba(18, 18, 26, 0.22);
  border-radius: 1px;
}
.conf-bars span.active { background: var(--blue-accent); }

.verdict-divider {
  height: 2px;
  background: var(--border);
  opacity: 0.16;
  margin: 16px 0;
}
.verdict-explanation {
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Position of the stated salary within the band — the number the range alone
   can't give. Sits between the confidence row and the divider. */
.percentile-line {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* The plain-English read. Leads the card; the range and percentile below it
   are the evidence. */
.verdict-headline {
  margin-top: 14px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
}
.verdict-reasons {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.55;
}
.verdict-reasons:empty { display: none; }
.verdict-reasons li + li { margin-top: 4px; }

/* Cards */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-yellow { background: var(--yellow); }
.card-hd {
  padding: 10px 15px;
  background: var(--surface-dim);
  border-bottom: 1px solid var(--border-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.card-dark .card-hd { background: var(--black); color: #fff; border-bottom: none; }

.asks-list {
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ask-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}
.ask-row strong {
  flex: none;
  min-width: 92px;
  font-weight: 800;
}
.ask-row span { color: var(--text-secondary); }

.ignored-list {
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.ignored-item { display: flex; gap: 9px; }
.ignored-x { color: var(--text-muted); font-weight: 700; }

/* Flags */
.flags-list { display: flex; flex-direction: column; gap: 10px; }
.flag {
  display: flex;
  gap: 11px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  background: var(--surface);
}
.flag--yellow { background: var(--yellow); }
.flag--pink   { background: var(--pink-soft); }
.flag--blue   { background: var(--blue-light); }
.flag-icon {
  flex: none;
  width: 19px;
  height: 19px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: var(--surface);
}
.flag-content { display: flex; flex-direction: column; gap: 3px; }
.flag-title { font-size: 14px; font-weight: 800; }
.flag-detail { font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); text-wrap: pretty; }

/* ─── Error ──────────────────────────────────────────────────────────────── */
.error-card { max-width: 560px; margin: 40px auto; padding: 24px; }
.error-heading { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.error-sub { margin-top: 10px; font-size: 15px; line-height: 1.55; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 2px solid var(--border);
  background: var(--surface);
  padding: 26px 28px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.site-footer p { max-width: var(--maxw); margin: 0 auto; }
.footer-fine { margin-top: 8px !important; color: var(--text-muted); }
.footer-links { margin-top: 8px !important; font-size: 13px; }
