/*
  CXO Republic tools pages (/tools/ and the tools under it), 2026-10-14.
  Loaded after styles.css. Uses only the design system tokens in tokens.css.
*/

/* ---------- Header link (tools pages have no main nav) ---------- */

.header-link {
  color: var(--ink);
  font-size: var(--caption-size);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.header-link:hover {
  color: var(--gold-deep);
}

/* ---------- Tools list ---------- */

.tool-list {
  display: grid;
  gap: 24px;
  list-style: none;
}

@media (min-width: 720px) {
  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-list > .tool:first-child {
    grid-column: 1 / -1;
  }
}

.tool__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--space-sm);
}

.tool .numeral {
  font-size: 3rem;
}

.tool__hook {
  font-size: var(--body-size);
  font-weight: 300;
  line-height: 1.5;
}

.tool__foot {
  margin-top: auto;
  padding-top: var(--space-sm);
}

.tool--soon .title,
.tool--soon .tool__hook {
  color: var(--ink);
}

.tool--soon p:not(.tool__hook) {
  color: var(--ink-muted);
}

.status {
  flex: none;
  padding: 4px 12px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-pill);
  font-size: var(--eyebrow-size);
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.status--live {
  border-color: var(--gold);
  background: var(--gold-wash);
  color: var(--gold-deep);
}

@media (min-width: 1000px) {
  .tool-list > .tool:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-lg);
    align-content: start;
  }
  .tool-list > .tool:first-child .tool__head,
  .tool-list > .tool:first-child .title {
    grid-column: 1;
  }
  .tool-list > .tool:first-child .tool__hook {
    grid-column: 1;
    font-size: var(--subtitle-size);
  }
  .tool-list > .tool:first-child > p:not(.tool__hook) {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: end;
  }
  .tool-list > .tool:first-child .tool__foot {
    grid-column: 2;
    grid-row: 4;
  }
}

/* ---------- Calculator ---------- */

.calc {
  display: grid;
  gap: 24px;
  align-items: start;
  scroll-margin-top: 24px;
}

@media (min-width: 900px) {
  .calc {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }
  .calc__result {
    position: sticky;
    top: 24px;
  }
}

.calc__inputs {
  gap: 24px;
}

.calc__inputs .eyebrow {
  margin-bottom: 0;
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-affix input {
  padding-right: 40px;
  font-variant-numeric: tabular-nums;
}

.input-affix--before input {
  padding-right: 14px;
  padding-left: 32px;
}

.input-affix__unit {
  position: absolute;
  right: 14px;
  color: var(--ink-muted);
  pointer-events: none;
}

.input-affix--before .input-affix__unit {
  right: auto;
  left: 14px;
}

/* Hide number spinners: the inputs are typed, not stepped. */
.calc input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.calc input[type="number"]::-webkit-outer-spin-button,
.calc input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 var(--space-xs);
  max-width: none;
  font-size: var(--stat-size);
  font-weight: 200;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat--secondary {
  font-size: 2.25rem;
}

.stat__unit {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

@media (max-width: 480px) {
  .stat {
    font-size: 2.75rem;
  }
  .stat--secondary {
    font-size: 1.75rem;
  }
}

.calc__message {
  margin: var(--space-sm) 0;
}

.calc__result .caption {
  margin: auto 0 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--gold-line);
}

.calc__h2 {
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.calc__h2:focus {
  outline: none;
}

.calc__gate {
  background: var(--surface);
}

.choice {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.choice__options {
  display: flex;
  gap: 12px;
}

.choice__option {
  position: relative;
  cursor: pointer;
}

.choice__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 48px;
  padding: 10px 24px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-weight: 500;
  color: var(--ink);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.choice__option:hover span {
  border-color: var(--gold);
}

.choice__option input:checked + span {
  border-color: var(--gold);
  background: var(--gold-fill-gradient);
  color: var(--on-gold);
}

.choice__option input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.breakdown strong {
  color: var(--ink);
}

.breakdown [data-out] {
  font-weight: 500;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}

.calc__next {
  margin-top: var(--space-md);
}

/* The next-step panel is the one key block in the breakdown, so the statement above it stays quiet. */
.statement--quiet {
  background: var(--surface-raised);
}

.calc__next.panel--insight {
  border-color: var(--gold);
  background: var(--gold-wash);
  box-shadow: var(--glow-gold);
}

.calc__next .btn-row {
  margin-top: var(--space-sm);
}

.calc__next .placeholder {
  margin-bottom: 0;
}

[hidden] {
  display: none !important;
}
