/* ---------- REFERRAL PROGRAM ----------
 *
 * The $500/month partner page. Its own stylesheet, the same split `pricing.css` and `auth.css`
 * already make: only `refer.html` loads it.
 *
 * Unlike the rest of the site, this page is a single bordered FRAME — nav, sections and footer
 * all sit inside one hairline box centred in the viewport, with the sections divided by rules
 * rather than by whitespace. That is why so much of main.css is overridden below: its `nav` is
 * fixed, its `section` carries 160px of padding and its `footer` has its own, none of which suit
 * a boxed layout. The frame is the page's defining shape — changing it means rewriting this file.
 *
 * Tokens all come from main.css. `--dim` plays the single "muted text" role throughout: every
 * label, caption and body paragraph that is not pure white uses it, so the page has exactly two
 * text colours plus the red accent.
 */

/* ---------- FRAME ---------- */

.refer-shell {
  padding: 20px 16px 96px;
}

.frame {
  margin: 0 auto;
  width: 100%;
  max-width: 1110px;
  border: 1px solid var(--line);
  /* Translucent so the fixed grain layer still reads through the panel. */
  background: rgba(10, 10, 10, 0.8);
}

/* main.css gives every `section` 160px of padding for the full-bleed home page. Inside the frame
   the rules between sections carry the separation instead, so the padding comes right down. */
.frame section {
  padding: 40px 20px;
}

.frame section + section {
  border-top: 1px solid var(--line);
}

/* ---------- FRAME NAV ---------- */

/* A `<header>`, deliberately not a `<nav>` — main.css pins `nav` to the viewport, and this one
   belongs to the frame. */
.frame-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.frame-nav .nav-status {
  gap: 22px;
}

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

/* One grid cell for the pitch, one for the calculator, sitting side by side from 1024px up and
   stacking below it. The 1.05/.95 split gives the headline the extra room it needs to break
   "Refer a business. / Get $500/month." across three lines rather than four. */
.hero-grid {
  display: grid;
  gap: 40px;
}

.hero-copy .term {
  margin-bottom: 20px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.hero-copy .cursor-blink {
  height: 12px;
  width: 6px;
  vertical-align: middle;
}

.hero-copy h1 {
  max-width: 650px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(39px, 6vw, 80px);
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--red);
}

.hero-copy .sub {
  margin-top: 24px;
  max-width: 570px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--dim);
}

.hero-copy .sub strong {
  color: var(--white);
  font-weight: 500;
}

.chips {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--red);
}

/* The third chip states a fact about cadence rather than about money, and the reference marks
   that shift with a green dot instead of the accent red. */
.chip-ok::before {
  background: #10B981;
}

.hero-cta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- BUTTONS ---------- */

/* Overrides main.css's `.btn` padding — these sit at a fixed 40px height beside each other, and
   `inline-flex` is what lets each one carry its icon. */
.frame .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--red);
  border-radius: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.frame .btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.frame .btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--white);
}

.frame .btn-quiet:hover {
  background: rgba(244, 242, 238, 0.06);
  border-color: var(--white);
}

/* ---------- CALCULATOR CARD ---------- */

.calc-card {
  border: 1px solid var(--line);
  background: rgba(24, 24, 24, 0.8);
  padding: 20px;
}

.calc-head {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.calc-head .on {
  color: var(--red);
}

.calc-card h2 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  /* main.css caps h2 at 22ch for the home page's display headings; in here the card width is the
     only constraint that should apply. */
  max-width: none;
}

.calc-card h2 em {
  font-style: normal;
  color: var(--red);
}

.calc-lede {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--dim);
}

.calc-lede strong {
  color: var(--white);
  font-weight: 500;
}

/* Bottom-aligned so the two figures share a baseline even though only the right column carries
   a third line underneath it. */
.calc-readouts {
  margin-top: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.readout span {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.readout strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  /* Both figures re-render on every slider step; tabular digits stop the line reflowing as the
     reader drags. */
  font-variant-numeric: tabular-nums;
}

.readout-payout {
  text-align: right;
}

.readout-payout strong {
  font-size: 30px;
  color: var(--red);
}

.readout small {
  display: block;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- SLIDER ---------- */

.calc-slider {
  margin-top: 28px;
}

/* The filled portion of the track is a gradient stop driven by `--fill`, which refer.js writes as
   a percentage on every input event. One element for the whole control, so the thing the keyboard
   and the screen reader operate stays the native input. The unfilled remainder is a dimmed red
   rather than a neutral hairline — the track reads as one continuous accent line either way. */
.calc-slider input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    to right,
    var(--red) 0%,
    var(--red) var(--fill, 0%),
    rgba(232, 53, 46, 0.25) var(--fill, 0%),
    rgba(232, 53, 46, 0.25) 100%
  );
  cursor: pointer;
}

.calc-slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--k1);
  box-shadow: 0 0 0 1px var(--red);
  cursor: grab;
}

.calc-slider input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--k1);
  box-shadow: 0 0 0 1px var(--red);
  cursor: grab;
}

/* Firefox paints its own track behind the background above; blanking it leaves only the gradient,
   so both engines draw the same single line. */
.calc-slider input[type='range']::-moz-range-track {
  background: transparent;
  height: 2px;
}

.calc-slider input[type='range']:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.slider-ends {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.calc-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}

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

/* Full-bleed inside the frame: no padding of its own, so the row's rules meet the frame's own
   left and right borders. */
.stats {
  display: grid;
  background: rgba(24, 24, 24, 0.5);
}

.frame section.stats {
  padding: 0;
}

.stat-cell {
  padding: 24px 20px;
  text-align: center;
}

.stat-cell + .stat-cell {
  border-top: 1px solid var(--line);
}

.stat-cell span {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.stat-cell strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--white);
}

.stat-cell small {
  display: block;
  font-size: 12px;
  color: var(--dim);
}

/* ---------- SECTION HEADS ---------- */

.frame .label {
  margin-bottom: 20px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* Section counter set inline inside the `.label` rather than in main.css's `.sec-index` corner
   slot — this page reads its own position out loud ("How to refer · 01 / 03"). */
.label .ix {
  font-style: normal;
  color: var(--dim);
}

.frame h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.sec-lede {
  margin-top: 14px;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--dim);
}

/* ---------- HOW TO REFER ---------- */

.steps {
  margin-top: 40px;
  display: grid;
  gap: 32px;
}

.step {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.step .n {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--red);
}

.step h3 {
  margin-top: 12px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.step p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--dim);
}

/* ---------- REFERRAL LINK BAR ---------- */

.link-bar {
  margin-top: 40px;
  border: 1px solid var(--line);
  background: rgba(24, 24, 24, 0.5);
  padding: 20px;
}

.link-bar .term {
  margin-bottom: 14px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Read-only rather than plain text: the value still selects and copies by hand on the browsers
   where the clipboard API is unavailable or refused, which is the fallback refer.js relies on. */
.link-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white);
  background: var(--k0);
  border: 1px solid var(--line);
  padding: 0 14px;
  text-overflow: ellipsis;
}

.copy-msg {
  margin-top: 12px;
  min-height: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.copy-msg.ok {
  color: var(--red);
}

/* ---------- PROGRAM TERMS ---------- */

/* Reuses main.css's `.faq-item` accordion — same three-column summary, same rotating arrow — at
   the tighter rhythm the frame runs at. */
.terms {
  margin-top: 40px;
}

.frame .faq-item summary {
  grid-template-columns: 40px 1fr 24px;
  gap: 20px;
  padding: 20px 0;
}

.frame .faq-item summary .n {
  font-size: 9px;
  letter-spacing: 0.1em;
}

.frame .faq-item summary h3 {
  font-size: 16px;
}

.frame .faq-item .faq-a {
  margin-left: 60px;
  padding-bottom: 22px;
}

.frame .faq-item .faq-a p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--dim);
}

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

.frame-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 20px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.frame-foot a {
  color: inherit;
  text-decoration: none;
}

.frame-foot a:hover {
  color: var(--white);
}

.frame-foot .mark {
  font-weight: 700;
  color: var(--white);
}

/* ---------- VISUALLY HIDDEN ---------- */

/* The slider and the link field both need a real `<label>` — their visible headings are separate
   elements that `for=` cannot point at. Not main.css's `.hp`: that one is the form honeypot, and
   a label borrowing it would read as a trap field. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- BREAKPOINTS ---------- */

@media (min-width: 640px) {
  .refer-shell {
    padding: 32px 28px 96px;
  }

  .frame section {
    padding: 48px 32px;
  }

  .frame-nav,
  .frame-foot {
    padding-left: 32px;
    padding-right: 32px;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Horizontal once the cells sit side by side — the stacked rule above would draw across the
     top of two of them instead of between all three. */
  .stat-cell + .stat-cell {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .calc-card {
    padding: 28px;
  }

  .calc-card h2 {
    font-size: 24px;
  }

  .hero-copy .sub {
    font-size: 18px;
  }

  .frame-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 56px;
  }
}

/* main.css drops the accordion to a single column under 860px and hides the number and the arrow
   with it. The `.frame` rules above are more specific, so without this they would hold the
   three-column grid open around two elements that are no longer drawn — 40px and 24px of dead
   gutter either side of the text. Follow main.css back down instead. */
@media (max-width: 860px) {
  .frame .faq-item summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .frame .faq-item .faq-a {
    margin-left: 0;
  }
}

/* Below this the link bar's field and button no longer fit side by side. */
@media (max-width: 560px) {
  .link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .link-row .btn {
    width: 100%;
  }
}
