/* The referral program page (referrals.html). Loaded after interior-v2.css.
   Its opening is the offer itself: the headline beside the pair image, with the fee set on an Ink
   card that overlaps the photo. Then three steps drawn as small working parts of the program, the
   join form on an Ink band, the introduction form on Bone, the questions and the terms. */


/* ---------- Opening ---------- */
.ref-hero { padding-block: clamp(2.5rem, 6vh, 4.5rem) clamp(4rem, 8vh, 6.5rem); }
.ref-hero__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 2rem);
  align-items: center;
}
.ref-hero__head { grid-column: 1 / span 6; }
.ref-hero h1 { font-size: clamp(2.75rem, 1rem + 4.6vw, 5.25rem); line-height: .98; letter-spacing: -.05em; text-wrap: balance; }
.ref-hero h1 > span { display: block; }
.ref-hero h1 .w-light { font-weight: 300; letter-spacing: -.04em; }
.ref-hero .lede { margin-top: 1.5rem; color: var(--v2-text-soft); max-width: 34rem; }
.ref-hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: 2.25rem; }
.ref-hero__art { grid-column: 8 / -1; position: relative; margin: 0 0 7rem; }
.ref-hero__art img {
  display: block; width: 100%; height: auto; aspect-ratio: 1400 / 1364; object-fit: cover; object-position: 50% 100%;
  border-radius: var(--ah-radius-media); box-shadow: var(--v2-shadow-lg); background: var(--v2-sand);
}

/* The fee, on an Ink card that slides out from under the photo's lower left corner, over the floor. */
.ref-voucher {
  position: absolute; left: clamp(-3rem, -4vw, -1rem); bottom: -6.5rem; z-index: 1;
  display: grid; gap: .35rem; min-width: min(19rem, 86%);
  padding: 1.25rem 1.5rem 1.35rem; border-radius: var(--ah-radius-card);
  box-shadow: var(--v2-shadow-lg), var(--v2-edge);
}
.ref-voucher__label {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ah-emerald);
}
.ref-voucher__label .colon { --c: .32rem; }
.ref-voucher__amount { font-size: clamp(3rem, 2rem + 3vw, 4.5rem); font-weight: 600; line-height: 1; letter-spacing: -.05em; color: var(--ah-bone); }
.ref-voucher__per { font-size: .9375rem; color: var(--v2-bone-soft); }
.ref-voucher__facts {
  display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .65rem; padding-top: .8rem;
  border-top: 1px solid var(--v2-ink-line); font-size: .8125rem; font-weight: 650; color: var(--ah-bone);
}
.ref-voucher__facts span { display: inline-flex; align-items: center; gap: .45rem; }
.ref-voucher__facts span::before { content: ""; width: .4rem; height: .4rem; background: var(--ah-emerald); }

/* ---------- How it works ---------- */
.ref-how { padding-block: var(--v2-section); border-top: 1px solid var(--ah-border); }
.ref-how__head { max-width: 46rem; }
.ref-how__head .v2-label { color: var(--ah-link); margin-bottom: 1.25rem; }
.ref-how__lede { margin-top: 1.25rem; font-size: var(--v2-t-lede); line-height: 1.5; color: var(--v2-text-soft); }
.ref-steps { list-style: none; margin-top: clamp(2.5rem, 4vw, 4rem); border-bottom: 1px solid var(--ah-border); }
.ref-step {
  position: relative; display: grid; grid-template-columns: clamp(4.5rem, 7vw, 7rem) minmax(0, 1fr) minmax(0, 24rem);
  gap: 1.25rem clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(1.75rem, 3vw, 2.75rem);
}
.ref-step::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ah-border); transform-origin: left; }
.ref-step::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--ah-emerald); transform-origin: left; }
.ref-step__num { align-self: start; font-size: clamp(2.75rem, 1.8rem + 2.4vw, 4.25rem); font-weight: 300; line-height: 1; letter-spacing: -.05em; color: var(--ah-link); }
.ref-step__body { display: grid; gap: .65rem; justify-items: start; max-width: 34rem; }
.ref-step__body h3 { font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2.125rem); line-height: 1.12; letter-spacing: -.03em; }
.ref-step__body p { color: var(--v2-text-soft); line-height: 1.6; }
.ref-step__body .v2-link { margin-top: -.25rem; }
.ref-step__art { display: grid; gap: .75rem; justify-items: stretch; }

/* Small working parts of the program, drawn in the site's own controls. Decorative (hidden from screen
   readers); the form-like ones jump to the real form when tapped, so they never feel broken on a phone. */
.mini-card {
  display: grid; gap: .55rem; padding: 1rem; border-radius: var(--ah-radius-card);
  background: var(--ah-surface); border: 1px solid var(--ah-border); box-shadow: var(--v2-shadow-md);
  font-size: .875rem; line-height: 1.3;
}
a.mini-card { color: inherit; text-decoration: none; transition: transform 200ms var(--v2-ease), box-shadow 200ms var(--v2-ease); }
@media (hover: hover) and (pointer: fine) { a.mini-card:hover { transform: translateY(-2px); box-shadow: var(--v2-shadow-lg); } }
.mini-form__title { font-weight: 700; letter-spacing: -.01em; }
.mini-field {
  display: flex; align-items: center; min-height: 2.25rem; padding: 0 .75rem;
  border: 1px solid var(--ah-control-border); border-radius: var(--ah-radius-control); background: #fff; color: #8a8d86;
}
.mini-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.25rem; padding: 0 .9rem;
  border-radius: var(--ah-radius-control); background: var(--ah-emerald); color: var(--ah-ink); font-weight: 650;
}
.mini-form .mini-button { justify-self: start; }
.mini-share { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.mini-share__link {
  display: flex; align-items: center; min-height: 2.25rem; padding: 0 .75rem; overflow: hidden; white-space: nowrap;
  border: 1px solid var(--ah-control-border); border-radius: var(--ah-radius-control); background: #fff; color: var(--v2-text-soft);
}
.mini-share__link b { font-weight: 700; color: var(--ah-link); }
.mini-mail { gap: 0; padding-block: .35rem; }
.mini-mail__row { display: grid; grid-template-columns: 2.25rem 1fr; padding: .45rem 0; border-top: 1px solid var(--ah-border); color: var(--ah-ink); }
.mini-mail__row:first-child { border-top: 0; }
.mini-mail__row i { font-style: normal; font-weight: 700; color: var(--ah-muted); }
.mini-paid { grid-template-columns: 1fr auto; align-items: end; padding: 1.1rem 1.25rem; border-color: transparent; background: var(--ah-ink); }
.mini-paid__label {
  grid-column: 1 / -1; display: inline-flex; align-items: center; gap: .55rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ah-emerald);
}
.mini-paid__label .colon { --c: .3rem; }
.mini-paid__amount { font-size: 2.25rem; font-weight: 600; line-height: 1; letter-spacing: -.04em; color: var(--ah-bone); }
.mini-paid__state {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 1.9rem; padding: 0 .7rem;
  border-radius: var(--ah-radius-control); background: rgb(0 168 120 / .16); color: var(--ah-emerald); font-weight: 700;
}
.mini-paid__state::before { content: ""; width: .45rem; height: .45rem; background: var(--ah-emerald); }

/* ---------- Forms (join on Ink, introduce on Bone) ---------- */
.ref-join { padding-block: var(--v2-section); }
.ref-join__grid, .ref-intro__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 2rem); row-gap: 2.5rem; align-items: start;
}
.ref-join__head, .ref-intro__head { grid-column: 1 / span 5; display: grid; gap: 1.25rem; align-content: start; }
.ref-join__head .v2-label { color: var(--ah-emerald); }
.ref-join__head .h2 .w-light { color: var(--v2-bone-soft); }
.ref-join__head > p:not(.v2-label) { font-size: 1.125rem; line-height: 1.6; color: var(--v2-bone-soft); max-width: 30rem; }
.ref-join__facts { list-style: none; display: grid; gap: 0; margin-top: .5rem; max-width: 30rem; }
.ref-join__facts li { padding: .9rem 0; border-top: 1px solid var(--v2-ink-line); color: var(--v2-bone-soft); line-height: 1.55; }
.ref-join__facts strong { color: var(--ah-bone); font-weight: 700; }
.ref-panel {
  grid-column: 7 / -1; position: relative; padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--ah-radius-card); background: var(--ah-bone); color: var(--ah-ink); box-shadow: var(--v2-shadow-lg);
  --ah-focus: #006447;
}
.ref-panel :focus-visible { outline-color: var(--ah-focus); }
.ref-panel--light { background: var(--ah-surface); border: 1px solid var(--ah-border); box-shadow: var(--v2-shadow-md); }

.ref-form { display: grid; gap: 1.1rem; }
.ref-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ref-field { grid-column: 1 / -1; display: grid; gap: .4rem; align-content: start; }
.ref-field--half { grid-column: span 1; }
.ref-field label { font-size: .9375rem; font-weight: 650; }
.ref-optional { margin-left: .35rem; font-size: .8125rem; font-weight: 500; color: var(--ah-muted); }
.ref-field textarea { min-height: 5.5rem; resize: vertical; }
.ref-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ref-fieldset + .ref-fieldset { margin-top: .5rem; padding-top: 1.25rem; border-top: 1px solid var(--ah-border); }
.ref-fieldset legend { padding: 0; margin-bottom: .9rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ah-link); }
.ref-check { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: start; font-size: .9375rem; line-height: 1.5; cursor: pointer; }
.ref-check input { width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; accent-color: var(--ah-emerald); cursor: pointer; }
.ref-check a { color: var(--ah-link); font-weight: 650; }
.ref-form .field-error { margin: 0; font-size: .9375rem; line-height: 1.4; color: var(--ah-error); }
.ref-form__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .25rem; }
.ref-form button[disabled] { opacity: .6; cursor: progress; }
.ref-status { min-height: 1.5rem; font-size: .9375rem; line-height: 1.5; color: var(--ah-muted); }
.ref-status:empty { min-height: 0; }
.ref-status a, .ref-done__note a { color: var(--ah-link); font-weight: 650; }
.ref-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* After joining: the link, ready to copy. */
.ref-done { display: grid; gap: 1rem; }
.ref-done[hidden] { display: none; }
.ref-done > .ah-action { justify-self: start; }
.ref-done__label {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ah-link);
}
.ref-done__label .colon { --c: .32rem; }
.ref-done__title { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); line-height: 1.08; letter-spacing: -.035em; }
.ref-done__title:focus { outline: none; }
.ref-done__field { font-size: .9375rem; font-weight: 650; }
.ref-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; margin-top: -.5rem; }
.ref-copy .ah-field { font-weight: 650; color: var(--ah-link); text-overflow: ellipsis; }
.ref-done__actions { display: flex; align-items: center; gap: .75rem 1.5rem; flex-wrap: wrap; }
.ref-done__note { color: var(--v2-text-soft); line-height: 1.6; }
.ref-email { min-height: 15rem; font-size: .875rem; line-height: 1.55; white-space: pre-wrap; resize: vertical; }
.ref-textlink {
  justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 .9375rem/1.4 var(--ah-font); color: var(--ah-muted); text-decoration: underline; text-underline-offset: .2em;
}

.ref-intro { padding-block: var(--v2-section); background: var(--v2-bone-deep); }
.ref-intro__head .v2-label { color: var(--ah-link); }
.ref-intro__head > p:not(.v2-label) { font-size: 1.125rem; line-height: 1.6; color: var(--v2-text-soft); max-width: 30rem; }
.ref-intro__alt { padding-top: 1.25rem; border-top: 1px solid var(--ah-border); }
.ref-intro__alt a { color: var(--ah-link); font-weight: 650; }

/* ---------- Questions and terms ---------- */
.ref-faq { border-top: 0; }
.ref-faq .faq__list dd a { font-weight: 650; }
.ref-terms { padding-block: 0 clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }
.ref-terms .v2-shell > * { max-width: 52rem; }
.ref-terms h2 { font-size: 1.3125rem; letter-spacing: -.02em; }
.ref-terms ol { margin-top: 1rem; padding-left: 1.25rem; display: grid; gap: .6rem; }
.ref-terms li { padding-left: .25rem; font-size: .9375rem; line-height: 1.65; color: var(--v2-text-soft); }
.ref-terms li::marker { color: var(--ah-link); font-weight: 700; }

/* ---------- Arrival motion (once, skipped for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-off) .ref-hero__head { animation: rise-in .9s var(--v2-ease) both; }
  html:not(.motion-off) .ref-hero__art img { animation: fade-lift 1.2s var(--v2-ease) .1s both; }
  html:not(.motion-off) .ref-voucher { animation: panel-rise 1s var(--v2-ease) .45s both; }
}

/* ---------- Scroll motion, like How we work: each part arrives once and never re-hides ----------
   Scroll Craft adds .sc-in to every [data-sc-in] as it enters. A step draws its Emerald line, then its
   working parts rise, and the paid slip counts up to $1,000.00 (data-sc-count). Paused or reduced
   motion shows everything settled. */
.motion-ready .ref-step[data-sc-in] { transition-duration: 700ms; }
.motion-ready .ref-step::after { transform: scaleX(0); transition: transform 1.1s var(--v2-ease) .1s; }
.motion-ready .ref-step.sc-in::after { transform: scaleX(1); }
.motion-ready .ref-step__art {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s var(--v2-ease) .3s, transform .8s var(--v2-ease) .3s;
}
.motion-ready .ref-step.sc-in .ref-step__art { opacity: 1; transform: none; }
.motion-ready .ref-panel[data-sc-in] { transition-duration: 700ms; transition-delay: .12s; }
.motion-ready .page-close__body[data-sc-in] { transition-delay: .1s; }
.motion-off .ref-step::after { transform: none !important; }
.motion-off .ref-step__art { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .ref-step::after { transform: none !important; }
  .ref-step__art { opacity: 1 !important; transform: none !important; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .ref-step { grid-template-columns: clamp(4rem, 7vw, 6rem) minmax(0, 1fr); }
  .ref-step__art { grid-column: 2; max-width: 26rem; }
}
@media (max-width: 900px) {
  .ref-hero__head, .ref-hero__art { grid-column: 1 / -1; }
  .ref-hero__art { margin: 2.5rem 0 3rem; }
  .ref-hero__art img { aspect-ratio: 1.15; }
  .ref-voucher { left: 1rem; bottom: -2.5rem; }
  .ref-join__head, .ref-intro__head, .ref-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ref-step { grid-template-columns: 1fr; gap: .9rem; }
  .ref-step__num { font-size: 2.5rem; }
  .ref-step__art { grid-column: 1; }
  .ref-fields { grid-template-columns: 1fr; }
  .ref-field--half { grid-column: 1 / -1; }
  .ref-copy { grid-template-columns: 1fr; }
  .ref-voucher { position: relative; left: auto; bottom: auto; margin: -2.5rem 1rem 0; min-width: 0; }
  .ref-hero__art { margin-bottom: 0; }
}
