/* Shared strict-CSP, dual-theme stylesheet for XORA referral pages:
 * /refer and /ko/refer.
 * Loaded with id="xora-haptic-press-style" so haptics.js skips runtime <style> injection.
 */

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

:root {
    color-scheme: dark light;
    --bg: #050507;
    --ink: #f7f7f5;
    --white: #ffffff;
    --soft: #c4c8cf;
    --dim-light: #b8bac2;
    --muted: #989da8;
    --line: rgba(255, 255, 255, 0.14);
    --line-subtle: rgba(255, 255, 255, 0.1);
    --link-underline: rgba(255, 255, 255, 0.34);
    --cta-bg: #ffffff;
    --cta-fg: #050507;
    --cta-shadow: 0 18px 60px rgba(255, 255, 255, 0.14);
    --btn-sec-bg: #111216;
    --positive: #4ade80;
    --share-bg: #22c55e;
    --share-grad: linear-gradient(135deg, #4ade80, #22c55e);
    --share-fg: #04130a;
    --panel-border: rgba(74, 222, 128, 0.35);
    --panel-bg: #0b110d;
    --panel-grad: linear-gradient(145deg, rgba(74, 222, 128, 0.14), rgba(255, 255, 255, 0.03));
    --panel-shadow: 0 32px 100px rgba(0, 0, 0, 0.34);
    --row-bg: #0a0b0e;
    --faq-bg: #0d0e12;
    --ko-body-grad:
        linear-gradient(135deg, rgba(74, 222, 128, 0.14), transparent 28rem),
        radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.08), transparent 22rem);
    --en-body-grad:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    --focus-ring: #e4e4e7;
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #fafafa;
        --ink: #111217;
        --white: #111217;
        --soft: #353842;
        --dim-light: #434754;
        --muted: #525663;
        --line: rgba(17, 18, 23, 0.16);
        --line-subtle: rgba(17, 18, 23, 0.12);
        --link-underline: rgba(17, 18, 23, 0.38);
        --cta-bg: #111217;
        --cta-fg: #ffffff;
        --cta-shadow: 0 12px 32px rgba(17, 18, 23, 0.16);
        --btn-sec-bg: #f1f2f5;
        --positive: #166534;
        --share-bg: #166534;
        --share-grad: linear-gradient(135deg, #14532d, #166534);
        --share-fg: #ffffff;
        --panel-border: rgba(22, 101, 52, 0.28);
        --panel-bg: #ffffff;
        --panel-grad: linear-gradient(145deg, rgba(22, 101, 52, 0.05), rgba(255, 255, 255, 0.96));
        --panel-shadow: 0 20px 56px rgba(17, 18, 23, 0.08);
        --row-bg: #ffffff;
        --faq-bg: #ffffff;
        --ko-body-grad:
            linear-gradient(135deg, rgba(22, 101, 52, 0.06), transparent 26rem),
            radial-gradient(circle at 85% 18%, rgba(17, 18, 23, 0.03), transparent 22rem);
        --en-body-grad:
            radial-gradient(circle at 50% 0%, rgba(17, 18, 23, 0.025) 0%, transparent 50%),
            radial-gradient(circle, rgba(17, 18, 23, 0.04) 1px, transparent 1px);
        --focus-ring: #111217;
    }
}

html {
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100dvh;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.6;
    max-width: 100%;
    overflow-x: clip;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--cta-bg);
    color: var(--cta-fg);
}

/* Haptic & accessible interaction defaults (replaces haptics.js runtime <style> injection) */
:where(a[href], button, [role="button"], input[type="button"], input[type="submit"], summary, select, [data-haptic]) {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

:where(a[href], button, [role="button"], input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

.xora-haptic-press {
    filter: brightness(1.06);
    transform: translateY(1px) scale(0.992);
    transition: transform 90ms cubic-bezier(0.16, 1, 0.3, 1), filter 90ms linear;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .xora-haptic-press { transform: none; }
}

/* Skip link */
.skip-to-content {
    position: fixed;
    top: -120px;
    left: 16px;
    z-index: 10005;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 1.25rem;
    background-color: var(--cta-bg);
    color: var(--cta-fg);
    border: 1px solid var(--cta-bg);
    border-radius: 6px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
}

.skip-to-content:focus,
.skip-to-content:focus:hover,
.skip-to-content:hover {
    top: 12px;
    background-color: var(--cta-bg);
    color: var(--cta-fg);
}

/* ==========================================================================
 * English referral page (/refer)
 * ========================================================================== */
body.refer-en {
    background-image: var(--en-body-grad);
    background-size: 100% 100%, 24px 24px;
}

.refer-nav,
.refer-main {
    width: min(720px, calc(100% - 40px));
    margin: 0 auto;
}

.refer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 20px 0;
}

.refer-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 18px;
}

.refer-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    color: var(--ink);
    padding: 0 4px;
    text-decoration: none;
    font-weight: 500;
}

.refer-nav a:hover {
    opacity: 0.8;
}

.refer-main {
    padding: clamp(24px, 6vh, 64px) 0 48px;
}

.refer-main h1 {
    font-size: clamp(2.1rem, 7vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--ink);
    text-wrap: balance;
}

.refer-main p {
    color: var(--dim-light);
    line-height: 1.5;
    margin: 20px 0;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

#referralOffer {
    min-height: 3em;
}

@media (max-width: 520px) {
    #referralOffer {
        min-height: 4.5em;
    }
}

.refer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.refer-main .refer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    min-width: 196px;
    padding: 0 28px;
    background-color: var(--cta-bg);
    color: var(--cta-fg);
    border-radius: 99px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.refer-status-slot {
    min-height: 3em;
    margin: 16px 0 0;
}

.refer-status-slot p {
    margin: 0;
}

@media (max-width: 520px) {
    .refer-status-slot {
        min-height: 4.5em;
    }
}

.refer-main .refer-cta:hover {
    opacity: 0.9;
}

.refer-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--dim-light);
    font: inherit;
    cursor: pointer;
}

.refer-share-btn:hover {
    color: var(--ink);
}

.refer-terms {
    margin-top: 28px;
    color: var(--dim-light);
    line-height: 1.5;
}

.refer-terms summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--ink);
    font-weight: 500;
}

.refer-terms dl {
    margin: 12px 0;
}

.refer-terms dl div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line-subtle);
}

.refer-terms dl div:last-child {
    border-bottom: 0;
}

.refer-terms dd {
    margin: 0;
    color: var(--ink);
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.refer-terms p {
    font-size: 0.9rem;
}

.refer-main .refer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 20px;
    margin-top: 20px;
}

.refer-main .refer-links a {
    color: var(--dim-light);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--link-underline);
}

.refer-main .refer-links a:hover {
    color: var(--ink);
    text-decoration-color: currentColor;
}

.refer-rail-note {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 6px;
    min-height: 44px;
    color: var(--dim-light);
}

@media (max-width: 480px) {
    .refer-nav,
    .refer-main {
        width: calc(100% - 32px);
    }
}

/* ==========================================================================
 * Korean referral page (/ko/refer)
 * ========================================================================== */
body.refer-ko {
    word-break: keep-all;
    overflow-wrap: anywhere;
    background-image: var(--ko-body-grad);
}

.refer-ko .nav {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.refer-ko .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    min-width: 44px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    color: var(--ink);
}

.refer-ko .brand img {
    width: 26px;
    height: 26px;
    display: block;
}

.refer-ko .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 4px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.refer-ko .nav-link:hover {
    color: var(--ink);
}

.refer-ko .wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: calc(100dvh - 70px);
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(340px, 0.78fr);
    gap: clamp(24px, 5vw, 72px);
    align-items: center;
    padding: 34px 0 58px;
}

.refer-ko .wrap > * {
    min-width: 0;
}

.refer-ko .eyebrow {
    color: var(--positive);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    margin-bottom: 18px;
    text-transform: uppercase;
}

.refer-ko h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(46px, 9vw, 118px);
    line-height: 0.92;
    letter-spacing: -0.045em;
    font-weight: 900;
    color: var(--ink);
}

.refer-ko .lead {
    max-width: 610px;
    margin: 24px 0 32px;
    color: var(--soft);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.38;
    font-weight: 600;
}

.refer-ko .lead b {
    color: var(--ink);
}

.refer-ko .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 12px;
    max-width: 460px;
}

.refer-ko .btn {
    min-height: 64px;
    min-width: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: center;
}

.refer-ko .btn-primary {
    background-color: var(--cta-bg);
    color: var(--cta-fg);
    box-shadow: var(--cta-shadow);
}

.refer-ko .btn-secondary {
    background-color: var(--btn-sec-bg);
    border-color: var(--line);
    color: var(--ink);
}

.refer-ko .btn-share {
    grid-column: 1 / -1;
    background-color: var(--share-bg);
    background-image: var(--share-grad);
    color: var(--share-fg);
    border: none;
    cursor: pointer;
    font-family: var(--font);
    gap: 8px;
}

.refer-ko .btn-share svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.refer-ko .panel {
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    background-color: var(--panel-bg);
    background-image: var(--panel-grad);
    padding: clamp(20px, 4vw, 36px);
    box-shadow: var(--panel-shadow);
}

.refer-ko .panel-kicker {
    color: var(--positive);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.refer-ko .reward {
    margin: 18px 0 22px;
    font-family: var(--mono);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.94;
    font-size: clamp(40px, 8vw, 86px);
    color: var(--ink);
}

.refer-ko .reward small {
    display: block;
    margin-top: 8px;
    color: var(--positive);
    font-size: 0.52em;
    letter-spacing: -0.045em;
}

.refer-ko .grid {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background-color: var(--line);
}

.refer-ko .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 58px;
    padding: 13px 16px;
    background-color: var(--row-bg);
}

.refer-ko .row span:first-child {
    color: var(--soft);
    font-size: 0.96rem;
    font-weight: 700;
}

.refer-ko .row strong {
    color: var(--positive);
    font-family: var(--mono);
    font-size: 0.9rem;
    text-align: right;
    white-space: nowrap;
}

.refer-ko .fine {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.48;
    overflow-wrap: anywhere;
}

.refer-ko .refer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 18px;
}

.refer-ko .refer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    color: var(--soft);
    font-size: 0.86rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--link-underline);
}

.refer-ko .refer-links a:hover {
    color: var(--ink);
    text-decoration-color: currentColor;
}

.refer-ko .refer-direct-rails {
    margin: 8px 0 0;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.5;
}

.refer-ko .refer-direct-rails a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    color: var(--soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.refer-ko .refer-direct-rails a:hover {
    color: var(--ink);
}

.refer-ko .faq {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto 46px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.refer-ko .faq details {
    border: 1px solid var(--line-subtle);
    border-radius: 12px;
    background-color: var(--faq-bg);
    padding: 14px 16px;
}

.refer-ko .faq summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
    list-style: none;
}

.refer-ko .faq summary::-webkit-details-marker {
    display: none;
}

.refer-ko .faq p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.refer-ko .faq a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    vertical-align: middle;
}

.refer-ko .faq a.faq-accent-link {
    color: var(--positive);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 880px) {
    .refer-ko .wrap {
        grid-template-columns: 1fr;
        align-items: start;
        padding-top: 22px;
    }

    .refer-ko .actions {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .refer-ko .btn {
        min-height: 60px;
    }

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