/* ──────────────────────────────────────────────────────────────
   UNBROKEN PROTOCOL — PREMIUM FRONT DOOR
   New homepage hero, R.A.C.E. Method section, and credibility strip.

   All classes prefixed `up-` to isolate from existing styles.
   Uses existing site tokens: --bg, --action, --border, --elevated,
   --text-bright, --text-secondary, --text-muted.
   ────────────────────────────────────────────────────────────── */

/* Local tokens scoped to the redesign sections only */
.up-hero, .up-method, .up-cred-strip {
    --up-ring-ns:    #FFE500;
    --up-ring-rec:   #00EAFF;
    --up-ring-sleep: #0080FF;
    --up-ring-bio:   #FFA500;
    --up-critical:   #FF0044;

    --up-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --up-ease-snap: cubic-bezier(0.22, 1.2, 0.36, 1);
}
.up-hero *, .up-method *, .up-cred-strip * {
    box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────
   ATMOSPHERIC BACKGROUND
   Scoped inside .up-hero so it only affects new sections.
   ────────────────────────────────────────────────────────────── */

.up-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.up-aurora-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0;
    animation: up-aurora-fade-in 2s var(--up-ease-out) 0.2s forwards,
               up-aurora-drift 60s linear infinite;
}
.up-aurora-1 {
    width: 700px; height: 700px;
    top: -200px; right: -200px;
    background: radial-gradient(circle, rgba(255,229,0,0.10) 0%, transparent 70%);
}
.up-aurora-2 {
    width: 600px; height: 600px;
    bottom: -200px; left: -200px;
    background: radial-gradient(circle, rgba(0,234,255,0.08) 0%, transparent 70%);
    animation-duration: 2s, 80s;
}
.up-aurora-3 {
    width: 500px; height: 500px;
    top: 40%; left: 30%;
    background: radial-gradient(circle, rgba(0,128,255,0.05) 0%, transparent 70%);
    animation-duration: 2s, 100s;
}
@keyframes up-aurora-fade-in { to { opacity: 1; } }
@keyframes up-aurora-drift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(80px, -60px) scale(1.05); }
    66%  { transform: translate(-60px, 40px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

/* ──────────────────────────────────────────────────────────────
   HERO V3 — premium replacement
   ────────────────────────────────────────────────────────────── */

.up-hero {
    position: relative;
    padding: 140px 32px 80px;
    background: var(--bg);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.014em;
}

.up-hero-inner {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.up-hero-content { position: relative; }

/* Eyebrow chip */
.up-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 12px;
    background: rgba(255,229,0,0.08);
    border: 1px solid rgba(255,229,0,0.22);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--action);
    text-transform: uppercase;
    margin-bottom: 36px;
}
.up-pulse {
    width: 8px; height: 8px;
    background: var(--action);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 12px rgba(255,229,0,0.7);
}
.up-pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--action);
    animation: up-pulse 2s var(--up-ease-out) infinite;
}
@keyframes up-pulse {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Headline */
.up-hero h1 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(64px, 8.4vw, 132px);
    font-weight: 900;
    line-height: 0.94;
    letter-spacing: -0.045em;
    color: var(--text-bright);
    margin: 0 0 32px 0;
}
.up-hero h1 span {
    display: block;
}
.up-hero h1 em {
    font-style: italic;
    color: var(--action);
    font-weight: 900;
}

.up-hero-body {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 0 44px 0;
    letter-spacing: -0.008em;
}

/* Hero actions — single CTA + soft secondary */
.up-hero-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 56px;
    flex-wrap: wrap;
}

.up-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--action);
    color: var(--bg);
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    padding: 20px 32px;
    font-size: 17px;
    letter-spacing: -0.005em;
    border-radius: 999px;
    transition: transform 0.25s var(--up-ease-snap),
                box-shadow 0.25s var(--up-ease-out),
                background 0.2s var(--up-ease-out);
    position: relative;
    overflow: hidden;
}
.up-btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.7s var(--up-ease-out);
}
.up-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 36px rgba(255,229,0,0.32), 0 0 0 1px rgba(255,229,0,0.4);
}
.up-btn-primary:hover::before { transform: translateX(100%); }
.up-btn-primary svg { transition: transform 0.3s var(--up-ease-snap); }
.up-btn-primary:hover svg { transform: translateX(4px); }

.up-link-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-bright);
    font-weight: 600;
    font-size: 16px;
    padding: 16px 8px;
    text-decoration: none;
    position: relative;
}
.up-link-secondary::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px; bottom: 12px;
    height: 2px;
    background: var(--action);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--up-ease-out);
}
.up-link-secondary:hover::after { transform: scaleX(1); }
.up-link-secondary svg { transition: transform 0.3s var(--up-ease-snap); }
.up-link-secondary:hover svg { transform: translateX(3px); }

/* Trust strip */
.up-hero-trust {
    display: flex;
    align-items: center;
    gap: 32px;
}
.up-trust-item { display: flex; flex-direction: column; gap: 4px; }
.up-trust-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.03em;
    line-height: 1;
}
.up-trust-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.up-trust-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* ──────────────────────────────────────────────────────────────
   4-RING PROTOCOL SCORE GRAPHIC
   ────────────────────────────────────────────────────────────── */

.up-hero-visual {
    position: relative;
    aspect-ratio: 1;
    max-width: 560px;
    width: 100%;
    margin-left: auto;
    transition: transform 0.4s var(--up-ease-out);
    will-change: transform;
}

.up-ring-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 40px 100px rgba(255,229,0,0.16));
    animation: up-ring-breathe 6s ease-in-out infinite;
}
@keyframes up-ring-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.012); }
}

.up-ring-svg { width: 100%; height: 100%; display: block; }

.up-ring {
    transition: stroke-dashoffset 1.6s var(--up-ease-out);
}

.up-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    animation: up-ring-center-enter 0.8s var(--up-ease-out) 1.4s forwards;
}
@keyframes up-ring-center-enter {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.up-ring-label-top {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--action);
    margin-bottom: 8px;
}
.up-ring-score {
    font-family: 'Inter', sans-serif;
    font-size: 96px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 60px rgba(255,229,0,0.18);
}
.up-ring-label-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.up-status-dot {
    width: 6px; height: 6px;
    background: #10E27A;
    border-radius: 50%;
    box-shadow: 0 0 8px #10E27A;
    animation: up-dot-blink 2.4s ease-in-out infinite;
}
@keyframes up-dot-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Floating legend chips */
.up-ring-legend { position: absolute; inset: 0; pointer-events: none; }
.up-legend-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15,25,35,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text-bright);
    opacity: 0;
    transform: translateY(8px);
    animation: up-chip-enter 0.6s var(--up-ease-out) forwards;
    white-space: nowrap;
}
.up-legend-chip:nth-child(1) { top: 6%;   left: -10%;  animation-delay: 1.9s; }
.up-legend-chip:nth-child(2) { top: 28%;  right: -8%;  animation-delay: 2.0s; }
.up-legend-chip:nth-child(3) { bottom: 24%; left: -12%; animation-delay: 2.1s; }
.up-legend-chip:nth-child(4) { bottom: 4%;  right: -6%; animation-delay: 2.2s; }
@keyframes up-chip-enter { to { opacity: 1; transform: translateY(0); } }

.up-swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.up-sw-ns    { background: var(--up-ring-ns);    box-shadow: 0 0 10px var(--up-ring-ns); }
.up-sw-rec   { background: var(--up-ring-rec);   box-shadow: 0 0 10px var(--up-ring-rec); }
.up-sw-sleep { background: var(--up-ring-sleep); box-shadow: 0 0 10px var(--up-ring-sleep); }
.up-sw-bio   { background: var(--up-ring-bio);   box-shadow: 0 0 10px var(--up-ring-bio); }

.up-legend-val {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Reveal animations */
.up-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--up-ease-out), transform 0.8s var(--up-ease-out);
}
.up-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ──────────────────────────────────────────────────────────────
   METHOD SECTION — R.A.C.E. 4 stages
   ────────────────────────────────────────────────────────────── */

.up-method {
    position: relative;
    border-top: 1px solid rgba(28,42,53,0.5);
    background:
        radial-gradient(ellipse at top, rgba(0,234,255,0.025) 0%, transparent 60%),
        var(--bg);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.up-section-inner {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 140px 32px;
    position: relative;
    z-index: 2;
}

.up-section-header {
    max-width: 720px;
    margin-bottom: 80px;
}

.up-eyebrow-static {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 12px;
    background: rgba(255,229,0,0.08);
    border: 1px solid rgba(255,229,0,0.22);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--action);
    margin-bottom: 32px;
}

.up-section-h {
    font-size: clamp(48px, 5.5vw, 84px);
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -0.04em;
    color: var(--text-bright);
    margin: 0 0 24px 0;
}

.up-section-lede {
    font-size: 21px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text-secondary);
    letter-spacing: -0.008em;
    max-width: 580px;
    margin: 0;
}

.up-phase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 64px;
}

.up-phase {
    position: relative;
    background: rgba(15,25,35,0.6);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px 28px;
    overflow: hidden;
    transition: transform 0.35s var(--up-ease-out),
                border-color 0.3s var(--up-ease-out),
                background 0.3s var(--up-ease-out),
                box-shadow 0.3s var(--up-ease-out);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.up-phase-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--up-phase-color) 0%, transparent 100%);
    transition: height 0.3s var(--up-ease-out);
}
.up-phase:hover {
    transform: translateY(-6px);
    background: rgba(15,25,35,0.9);
    border-color: var(--up-phase-color);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px var(--up-phase-color);
}
.up-phase:hover .up-phase-bar { height: 5px; }

.up-phase-recover    { --up-phase-color: var(--up-ring-rec); }
.up-phase-align      { --up-phase-color: var(--up-ring-sleep); }
.up-phase-condition  { --up-phase-color: var(--up-ring-bio); }
.up-phase-execute    { --up-phase-color: var(--up-critical); }

.up-phase-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}
.up-phase-letter {
    font-size: 80px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;
    color: var(--up-phase-color);
    text-shadow: 0 0 40px var(--up-phase-color);
    transition: text-shadow 0.4s var(--up-ease-out);
}
.up-phase:hover .up-phase-letter {
    text-shadow: 0 0 60px var(--up-phase-color);
}
.up-phase-range {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.up-phase-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-bright);
    margin: 0 0 12px 0;
    line-height: 1.1;
}
.up-phase-desc {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    margin: 0;
}

/* ──────────────────────────────────────────────────────────────
   CREDIBILITY STRIP
   Quiet credibility — athlete-first philosophy
   ────────────────────────────────────────────────────────────── */

.up-cred-strip {
    position: relative;
    border-top: 1px solid rgba(28,42,53,0.5);
    border-bottom: 1px solid rgba(28,42,53,0.5);
    background:
        linear-gradient(180deg, rgba(15,25,35,0.4) 0%, rgba(8,12,15,0.4) 100%),
        var(--bg);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.up-cred-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 56px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}
.up-cred-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    line-height: 1.5;
}
.up-cred-pre {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.up-cred-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.012em;
}
.up-cred-sep {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}
.up-cred-meta {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.up-cred-logos {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.up-cred-logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.25s var(--up-ease-out);
}
.up-cred-logo:hover { color: var(--text-bright); }
.up-cred-dot {
    width: 3px; height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    opacity: 0.6;
}
.up-cred-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 4px 0;
    text-decoration: none;
    position: relative;
    transition: color 0.25s var(--up-ease-out);
}
.up-cred-link::after {
    content: "";
    position: absolute;
    left: 0; right: 16px; bottom: -2px;
    height: 1px;
    background: var(--text-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--up-ease-out), background 0.25s var(--up-ease-out);
}
.up-cred-link:hover { color: var(--action); }
.up-cred-link:hover::after { transform: scaleX(1); background: var(--action); }
.up-cred-link svg { transition: transform 0.25s var(--up-ease-snap); }
.up-cred-link:hover svg { transform: translateX(3px); }

/* Scroll-triggered reveal */
.up-scroll-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--up-ease-out), transform 0.9s var(--up-ease-out);
}
.up-scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .up-hero-inner { grid-template-columns: 1fr; gap: 60px; }
    .up-hero-visual { max-width: 420px; margin: 0 auto; }
    .up-legend-chip:nth-child(1) { left: -4%; }
    .up-legend-chip:nth-child(2) { right: -2%; }
    .up-legend-chip:nth-child(3) { left: -2%; }
    .up-legend-chip:nth-child(4) { right: 0%; }
    .up-phase-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .up-hero { padding: 100px 20px 60px; }
    .up-hero h1 { font-size: clamp(40px, 10vw, 56px); letter-spacing: -0.035em; line-height: 0.96; }
    .up-hero-body { font-size: 17px; }
    .up-eyebrow { font-size: 11px; padding: 7px 12px 7px 10px; margin-bottom: 24px; }
    .up-hero-actions { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
    .up-btn-primary { width: 100%; justify-content: center; }
    .up-link-secondary { justify-content: center; }
    .up-hero-trust { gap: 16px; flex-wrap: wrap; }
    .up-trust-num { font-size: 20px; }
    .up-trust-label { font-size: 10px; }
    .up-trust-divider { height: 24px; }

    .up-section-inner { padding: 96px 20px; }
    .up-section-h { font-size: clamp(36px, 9vw, 56px); }
    .up-section-lede { font-size: 17px; }
    .up-phase-grid { grid-template-columns: 1fr; gap: 16px; }
    .up-phase-letter { font-size: 64px; }
    .up-phase-name { font-size: 24px; }

    .up-cred-inner { padding: 40px 20px; gap: 20px; }
    .up-cred-row { font-size: 13px; gap: 10px; }
    .up-cred-name { font-size: 15px; }
    .up-cred-meta { font-size: 12px; }
    .up-cred-logo { font-size: 13px; }
    .up-cred-logos { gap: 14px; }
    .up-cred-sep { display: none; }

    .up-ring-score { font-size: 64px; }
    .up-legend-chip { font-size: 10px; padding: 6px 10px; }
    .up-hero-visual { max-width: 320px; }
}

/* Accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .up-hero *, .up-method *, .up-cred-strip *,
    .up-hero *::before, .up-method *::before, .up-cred-strip *::before,
    .up-hero *::after, .up-method *::after, .up-cred-strip *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .up-reveal, .up-scroll-reveal { opacity: 1; transform: none; }
}
