/* ==========================================================================
   Pax Family — Referrals page styles
   Implementation of marketing_mocks/page-referrals.html from Claude Design.
   Loads after tokens.css. Everything scoped under .page.ref.

   Same warm v3/v4 palette. Hero has a layered "coupon stack" of three
   rotated credit-style cards on the right; rest is steps + math + FAQ.
   ========================================================================== */

/* Page-frame override — warm cream */
.page.ref { background: #FBF5EA; }
.ref .topnav { padding-top: 28px; }

/* ===== HERO ===== */
.ref-hero {
    padding: 32px var(--page-gutter) 96px;
    display: grid; grid-template-columns: 1.05fr .95fr;
    gap: 56px; align-items: center;
    position: relative;
}
.ref-hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 60px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1440' height='60' viewBox='0 0 1440 60' preserveAspectRatio='none'><path d='M0 30 Q 180 60 360 30 T 720 30 T 1080 30 T 1440 30 L 1440 60 L 0 60 Z' fill='%23ffffff'/></svg>") no-repeat center/cover;
}
.ref-hero .eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #F4E4BC; color: #8A6A1F;
    font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
}
.ref-hero .eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #C9A227; }
.ref-hero h1 {
    font-family: var(--font-display); font-size: 72px; font-weight: 800;
    letter-spacing: -0.035em; line-height: .98; color: #1b2a3a;
    margin: 22px 0 20px;
}
.ref-hero h1 em { font-style: italic; color: #66A367; font-weight: 800; }
.ref-hero h1 .pencil { display: inline-block; position: relative; color: #095FA1; }
.ref-hero h1 .pencil::after {
    content: ""; position: absolute; left: -2%; right: -2%; bottom: 2px; height: 10px; z-index: -1;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'><path d='M0 6 Q 50 0 100 5 T 200 4' stroke='%23E9B949' stroke-width='5' fill='none' stroke-linecap='round'/></svg>") no-repeat center/100% 100%;
}
.ref-hero p.sub {
    font-size: 19px; line-height: 1.55; color: #4a5568;
    max-width: 520px; margin: 0 0 28px;
}
.ref-hero .cta-row { display: flex; gap: 18px; align-items: center; }
.ref-hero .sec-link {
    color: #095FA1; font-weight: 600; font-size: 15px; text-decoration: none;
}
.ref-hero .badges { margin-top: 32px; display: flex; gap: 22px; flex-wrap: wrap; }
.ref-hero .badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; color: #4a5568;
}
.ref-hero .badge .b-ic {
    width: 28px; height: 28px; border-radius: 8px;
    background: #E8F0E9; color: #66A367;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
}

/* ===== HERO RIGHT — coupon stack ===== */
.ref-stack { position: relative; min-height: 520px; }
.ref-stack .sticker {
    position: absolute; top: -4px; right: 18px; z-index: 5;
    background: #FDE68A; color: #7C2D12;
    font-family: var(--font-display); font-weight: 800;
    font-size: 13px; padding: 8px 14px; border-radius: 999px;
    transform: rotate(6deg);
    box-shadow: 0 4px 0 #F59E0B, 0 6px 12px rgba(0,0,0,.08);
}
.coupon {
    position: absolute; width: 400px;
    background: #fff; border-radius: 20px;
    padding: 22px 26px; border: 1px solid #f0e7d5;
    box-shadow: 0 18px 40px rgba(15,23,42,.12);
    display: grid; grid-template-columns: auto 1fr auto;
    gap: 18px; align-items: center;
}
.coupon::before, .coupon::after {
    content: ""; position: absolute; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    background: #FBF5EA; border-radius: 50%;
}
.coupon::before { left: -10px; }
.coupon::after { right: -10px; }
.coupon .stamp {
    width: 60px; height: 60px; border-radius: 50%;
    background: #C9A227; color: #fff;
    font-family: var(--font-display); font-weight: 800;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 10px; line-height: 1.05; text-align: center;
    box-shadow: 0 4px 0 #8A6A1F; flex-shrink: 0;
}
.coupon .stamp .big { font-size: 20px; }
.coupon .body .lbl {
    font-size: 11px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: #8A6A1F;
}
.coupon .body .h {
    font-family: var(--font-display); font-weight: 800; font-size: 17px;
    color: #1b2a3a; letter-spacing: -0.01em; margin: 2px 0 4px;
}
.coupon .body .meta { font-size: 12px; color: #64748b; }
.coupon .by {
    text-align: right; font-size: 11px; color: #94a3b8;
    line-height: 1.4; white-space: nowrap;
}
.coupon .by strong {
    display: block; color: #1b2a3a; font-weight: 800;
    font-size: 13px; margin-bottom: 2px;
}
.coupon.c1 { transform: rotate(-5deg); top: 24px; left: -8px; }
.coupon.c2 { transform: rotate(2deg); top: 170px; left: 60px; }
.coupon.c3 {
    transform: rotate(-2deg); top: 316px; left: -4px;
    background: linear-gradient(135deg,#095FA1,#0d7cc4);
    color: #fff; border: 0;
}
.coupon.c3 .body .lbl { color: #FDE68A; }
.coupon.c3 .body .h { color: #fff; }
.coupon.c3 .body .meta { color: rgba(255,255,255,.75); }
.coupon.c3 .by { color: rgba(255,255,255,.6); }
.coupon.c3 .by strong { color: #fff; }
.coupon.c3 .stamp { background: #E9B949; box-shadow: 0 4px 0 #C9A227; }

/* ===== HOW IT WORKS ===== */
.ref-how { background: #fff; padding: 100px var(--page-gutter); }
.ref-how .sec-h h2 { font-size: 48px; }
.ref-how .sec-h h2 em { font-style: italic; color: #66A367; }
.ref-how .steps {
    display: grid; grid-template-columns: repeat(3,1fr);
    gap: 28px; margin-top: 56px;
    max-width: 1200px; margin-left: auto; margin-right: auto;
}
.ref-how .step {
    background: #FBF5EA; border-radius: 24px; padding: 32px 28px;
    border: 1px solid #F0E7D5; position: relative; overflow: hidden;
    display: flex; flex-direction: column;
}
.ref-how .step:nth-child(2) {
    background: #E8F1F9; border-color: #C9DBEE;
    transform: translateY(-12px);
}
.ref-how .step:nth-child(3) {
    background: #EEF6EC; border-color: #D4E8D3;
}
.ref-how .step .num {
    font-family: var(--font-display); font-size: 80px; font-weight: 800;
    line-height: 1; color: rgba(9,95,161,.12);
    position: absolute; top: 14px; right: 18px;
}
.ref-how .step:nth-child(2) .num { color: rgba(9,95,161,.18); }
.ref-how .step:nth-child(3) .num { color: rgba(102,163,103,.22); }
.ref-how .step h3 {
    font-family: var(--font-display); font-size: 22px; font-weight: 800;
    letter-spacing: -0.01em; margin: 0 0 8px; color: #1b2a3a;
}
.ref-how .step p { font-size: 15px; line-height: 1.55; color: #4a5568; margin: 0 0 16px; }
.ref-how .step .ic {
    width: 48px; height: 48px; border-radius: 12px; background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; box-shadow: 0 2px 0 rgba(0,0,0,.04);
    margin-bottom: 16px;
}
.ref-how .step .demo {
    margin-top: auto; background: #fff; border-radius: 12px;
    padding: 12px 14px; display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #1b2a3a;
    border: 1px dashed rgba(15,23,42,.12);
}
.ref-how .step .demo.url {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 12px; color: #095FA1;
}
.ref-how .step .demo .copy-btn {
    margin-left: auto;
    font-family: var(--font-body); font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 999px;
    background: #E8F1F9; color: #095FA1;
}
.ref-how .step .demo .pill {
    font-size: 11px; padding: 3px 10px; border-radius: 999px;
    font-weight: 700;
    background: #FDF4DC; color: #8A6A1F; white-space: nowrap;
}

/* ===== MATH ===== */
.ref-math { padding: 100px var(--page-gutter); background: #FBF5EA; }
.ref-math .sec-h h2 { font-size: 48px; }
.ref-math .sec-h h2 em { font-style: italic; color: #66A367; }
.ref-math .row {
    max-width: 1100px; margin: 48px auto 0;
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 24px; align-items: center;
}
.ref-math .panel {
    background: #fff; border-radius: 24px; padding: 32px;
    border: 1px solid #f0e7d5;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.ref-math .panel h3 {
    font-family: var(--font-display); font-size: 18px; font-weight: 800;
    margin: 0 0 14px; color: #1b2a3a;
    display: flex; align-items: center; gap: 10px;
}
.ref-math .panel h3 .p {
    font-size: 11px; padding: 4px 10px; border-radius: 999px;
    font-weight: 800; white-space: nowrap;
}
.ref-math .panel.give h3 .p { background: #E8F1F9; color: #095FA1; }
.ref-math .panel.get h3 .p { background: #EEF6EC; color: #166534; }
.ref-math .ledger { display: flex; flex-direction: column; gap: 8px; }
.ref-math .ln {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: #FBF5EA; border-radius: 10px;
    font-size: 14px; color: #1b2a3a;
}
.ref-math .ln .av {
    width: 30px; height: 30px; border-radius: 50%;
    color: #fff; font-weight: 800; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ref-math .ln .who { flex: 1; font-weight: 700; }
.ref-math .ln .when { font-size: 11px; color: #64748b; }
.ref-math .ln .credit {
    font-family: var(--font-display); font-weight: 800; font-size: 13px;
    background: #EEF6EC; color: #166534;
    padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.ref-math .arrow {
    width: 64px; height: 64px; border-radius: 50%;
    background: #095FA1; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 800;
    box-shadow: 0 8px 24px rgba(9,95,161,.3);
}
.ref-math .total {
    margin-top: 18px; padding: 16px; border-radius: 14px;
    background: linear-gradient(135deg,#66A367,#5a9159);
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
}
.ref-math .total .lbl {
    font-size: 12px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; opacity: .9;
}
.ref-math .total .v {
    font-family: var(--font-display); font-size: 30px; font-weight: 800;
    letter-spacing: -0.02em; line-height: 1; text-align: right;
}
.ref-math .total .v small {
    display: block; font-size: 12px; font-weight: 600;
    opacity: .85; margin-top: 4px; letter-spacing: 0;
}
.ref-math .footnote {
    text-align: center;
    font-family: var(--font-display); font-style: italic;
    font-size: 17px; color: #8A6A1F;
    margin-top: 32px;
}

/* ===== FAQ ===== */
.ref-faq { padding: 100px var(--page-gutter); background: #fff; }
.ref-faq .sec-h h2 { font-size: 48px; }
.ref-faq .sec-h h2 em { font-style: italic; color: #66A367; }
.ref-faq .grid {
    max-width: 1100px; margin: 48px auto 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.ref-faq .q {
    background: #FBF5EA; border: 1px solid #f0e7d5; border-radius: 18px;
    padding: 24px 26px;
}
.ref-faq .q h4 {
    font-family: var(--font-display); font-size: 18px; font-weight: 800;
    letter-spacing: -0.01em; margin: 0 0 8px; color: #1b2a3a;
}
.ref-faq .q p { font-size: 15px; line-height: 1.55; color: #4a5568; margin: 0; }
.ref-faq .q p strong { color: #1b2a3a; font-weight: 700; }

/* ===== FINAL CTA ===== */
.ref-cta {
    padding: 100px var(--page-gutter); background: #095FA1; color: #fff;
    text-align: center; position: relative; overflow: hidden;
}
.ref-cta::before {
    content: ""; position: absolute;
    width: 300px; height: 300px;
    background: rgba(201,162,39,.2);
    top: -150px; left: -100px; border-radius: 50%;
}
.ref-cta::after {
    content: ""; position: absolute;
    width: 220px; height: 220px;
    background: rgba(102,163,103,.2);
    bottom: -100px; right: -80px; border-radius: 50%;
}
.ref-cta h2 {
    font-family: var(--font-display); font-size: 56px; font-weight: 800;
    letter-spacing: -0.025em; margin: 0 0 16px; position: relative;
}
.ref-cta h2 em { font-style: italic; color: #E9B949; }
.ref-cta p {
    font-size: 19px; color: rgba(255,255,255,.85);
    max-width: 560px; margin: 0 auto 32px;
    line-height: 1.55; position: relative;
}
.ref-cta .cta-row { position: relative; display: inline-flex; gap: 16px; align-items: center; }
.ref-cta .sec-link {
    color: #fff; font-weight: 600; font-size: 15px;
    text-decoration: none; opacity: .85;
}
.ref-cta .sec-link:hover { opacity: 1; color: #fff; }

/* Section header (shared across .ref-how, .ref-math, .ref-faq) */
.ref-how .sec-h, .ref-math .sec-h, .ref-faq .sec-h {
    text-align: center; max-width: 680px; margin: 0 auto;
}
.ref-how .sec-h .eyebrow,
.ref-math .sec-h .eyebrow,
.ref-faq .sec-h .eyebrow {
    font-family: var(--font-display); font-style: italic;
    font-size: 13px; color: #095FA1;
    letter-spacing: .04em; text-transform: uppercase;
    font-weight: 700;
}
.ref-how .sec-h h2,
.ref-math .sec-h h2,
.ref-faq .sec-h h2 {
    font-family: var(--font-display); font-weight: 800;
    letter-spacing: -0.025em; line-height: 1.05;
    color: #1b2a3a; margin: 12px 0 12px;
}
.ref-how .sec-h p,
.ref-math .sec-h p,
.ref-faq .sec-h p {
    font-size: 17px; color: #4a5568; line-height: 1.55;
}

/* Footer override — warm cream */
.ref-footer { background: #FBF5EA; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .ref-hero {
        grid-template-columns: 1fr;
        padding: 24px 32px 80px;
    }
    .ref-hero h1 { font-size: 56px; }
    .ref-stack { min-height: 520px; max-width: 460px; margin: 24px auto 0; }
    .coupon { width: 100%; max-width: 400px; }
    .coupon.c1 { left: 0; }
    .coupon.c2 { left: 30px; }
    .coupon.c3 { left: 0; }

    .ref-how, .ref-math, .ref-faq, .ref-cta { padding: 80px 32px; }
    .ref-how .steps { grid-template-columns: 1fr; }
    .ref-how .step:nth-child(2) { transform: none; }

    .ref-math .row { grid-template-columns: 1fr; gap: 16px; }
    .ref-math .arrow { transform: rotate(90deg); justify-self: center; }

    .ref-faq .grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .ref-hero { padding: 16px 20px 64px; }
    .ref-hero h1 { font-size: 42px; }
    .ref-hero p.sub { font-size: 16px; }
    .ref-hero .cta-row { flex-direction: column; align-items: stretch; }

    .ref-how, .ref-math, .ref-faq, .ref-cta { padding: 64px 20px; }
    .ref-how .sec-h h2,
    .ref-math .sec-h h2,
    .ref-faq .sec-h h2 { font-size: 32px; }

    .ref-stack { min-height: 460px; }
    .coupon { padding: 18px 22px; gap: 14px; }
    .coupon .stamp { width: 50px; height: 50px; }
    .coupon .stamp .big { font-size: 18px; }
    .coupon .body .h { font-size: 15px; }
    .coupon.c1 { top: 16px; }
    .coupon.c2 { top: 150px; left: 20px; }
    .coupon.c3 { top: 284px; }

    .ref-math .panel { padding: 24px; }

    .ref-cta h2 { font-size: 32px; }
    .ref-cta p { font-size: 16px; }
    .ref-cta .cta-row { flex-direction: column; }
}
