/* ============================================================
   CoreLoop Fitness — Apple-inspired marketing theme
   ============================================================ */

:root {
    --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --color-bg: #fbfbfd;
    --color-bg-alt: #f5f5f7;
    --color-dark: #000000;
    --color-dark-elevated: #1d1d1f;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #86868b;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-yellow: #ffd93d;
    --color-orange: #ff9500;
    --color-red: #ff3b30;
    --color-blue: #0071e3;
    --color-green: #34c759;
    --nav-height: 52px;
    --section-pad: clamp(80px, 12vw, 140px);
    --content-max: 1200px;
    --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-system);
    font-size: 17px;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-blue);
    text-decoration: none;
    transition: opacity 0.2s var(--ease-out);
}

a:hover {
    opacity: 0.8;
}

/* ---- Navigation ---- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: rgba(251, 251, 253, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.site-header.scrolled {
    background: rgba(251, 251, 253, 0.92);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-logo img {
    border-radius: 7px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 32px);
}

.nav-menu a {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--color-text);
    opacity: 1;
}

.nav-cta {
    background: var(--color-blue) !important;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 980px;
    font-weight: 500 !important;
}

.nav-cta:hover {
    background: #0077ed !important;
    opacity: 1 !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--color-text);
    transition: transform 0.3s, opacity 0.3s;
}

/* ---- Typography ---- */

.eyebrow {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-orange);
    margin-bottom: 12px;
}

.eyebrow-light {
    color: var(--color-orange);
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

h1 {
    font-size: clamp(40px, 7vw, 80px);
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(36px, 5.5vw, 64px);
    margin-bottom: 16px;
}

h3 {
    font-size: clamp(28px, 3.5vw, 40px);
    margin-bottom: 16px;
}

.section-lead {
    font-size: clamp(19px, 2.2vw, 24px);
    line-height: 1.4;
    color: var(--color-text-secondary);
    letter-spacing: -0.02em;
    max-width: 580px;
}

.section-lead em {
    font-style: normal;
    color: var(--color-text);
}

.hero-sub {
    font-size: clamp(19px, 2.2vw, 24px);
    line-height: 1.4;
    color: var(--color-text-secondary);
    max-width: 520px;
    margin-bottom: 32px;
}

/* ---- Buttons ---- */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--color-blue);
    color: #fff;
    font-size: 17px;
    font-weight: 500;
    border-radius: 980px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s var(--ease-spring);
}

.btn-primary:hover {
    background: #0077ed;
    opacity: 1;
    transform: scale(1.02);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--color-blue);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

/* ---- Sections ---- */

.section {
    padding: var(--section-pad) clamp(20px, 4vw, 40px);
}

.section-dark {
    background: var(--color-dark);
    color: #f5f5f7;
}

.section-dark .section-lead {
    color: #a1a1a6;
}

.section-dark .section-lead em {
    color: #f5f5f7;
    font-weight: 600;
}

.section-dark h2,
.section-dark h3 {
    color: #f5f5f7;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto clamp(48px, 8vw, 80px);
}

/* ---- Hero ---- */

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--nav-height) + 60px) clamp(20px, 4vw, 40px) 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
}

.device-frame {
    border-radius: 40px;
    background: linear-gradient(145deg, #2c2c2e 0%, #1c1c1e 100%);
    padding: 12px;
    box-shadow:
        0 50px 100px -20px rgba(0, 0, 0, 0.25),
        0 30px 60px -30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.device-phone {
    width: min(280px, 42vw);
    border-radius: 44px;
    z-index: 2;
}

.device-watch {
    width: min(160px, 24vw);
    border-radius: 36px;
    position: absolute;
    right: 0;
    bottom: 20px;
    z-index: 3;
}

.device-watch--large {
    position: relative;
    width: min(200px, 30vw);
}

/* ---- Screenshot placeholders ---- */

.screenshot-slot {
    aspect-ratio: 9 / 19.5;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    gap: 8px;
    overflow: hidden;
    position: relative;
}

.screenshot-slot--tall {
    aspect-ratio: 9 / 19.5;
    min-height: 480px;
}

.screenshot-slot--watch {
    aspect-ratio: 1 / 1.1;
    border-radius: 32px;
    min-height: 140px;
}

.screenshot-slot.has-image {
    padding: 0;
    background: #000;
}

.screenshot-slot.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.screenshot-slot.has-image .slot-label,
.screenshot-slot.has-image .slot-hint {
    display: none;
}

.slot-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.slot-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-family: "SF Mono", ui-monospace, monospace;
}

/* ---- Core Effort meter (matches app IntensityHeaderView) ---- */

.intensity-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    max-width: var(--content-max);
    margin: 0 auto clamp(60px, 8vw, 100px);
}

.core-effort-demo {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.core-effort-meter {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.cem-rail {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    gap: 18px;
}

.cem-rail-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
    transition: transform 0.45s var(--ease-spring), box-shadow 0.45s ease, opacity 0.35s ease;
    opacity: 0.55;
}

.cem-rail-dot--red { background: var(--color-red); }
.cem-rail-dot--orange { background: var(--color-orange); }
.cem-rail-dot--yellow { background: var(--color-yellow); }

.cem-rail-dot--active {
    opacity: 1;
    transform: scale(1.35);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 0 20px rgba(255, 255, 255, 0.15);
    animation: cem-rail-pulse 2.4s ease-in-out infinite;
}

@keyframes cem-rail-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 0 16px rgba(255, 255, 255, 0.12); }
    50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.1), 0 0 28px rgba(255, 255, 255, 0.22); }
}

.cem-panel {
    flex: 1;
    min-height: 108px;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    color: #fff;
    transition: background-color 0.65s var(--ease-out), box-shadow 0.65s ease;
    animation: cem-panel-breathe 2.4s ease-in-out infinite;
}

.cem-panel--yellow {
    background: var(--color-yellow);
    box-shadow: 0 8px 32px rgba(255, 217, 61, 0.35);
}

.cem-panel--orange {
    background: var(--color-orange);
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.4);
}

.cem-panel--red {
    background: var(--color-red);
    box-shadow: 0 8px 32px rgba(255, 59, 48, 0.4);
}

@keyframes cem-panel-breathe {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.06); }
}

.cem-label {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: opacity 0.35s ease;
}

.cem-hr {
    font-size: 17px;
    font-weight: 500;
    opacity: 0.92;
    letter-spacing: -0.01em;
}

.cem-hr span {
    font-weight: 400;
    opacity: 0.85;
}

.cem-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.cem-metric {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
    opacity: 0.95;
    transition: opacity 0.35s ease;
}

.cem-metric strong {
    font-weight: 600;
    margin-right: 4px;
}

.cem-caption {
    font-size: 13px;
    color: #86868b;
    line-height: 1.45;
    text-align: center;
    padding: 0 8px;
}

.intensity-copy h3 {
    color: #f5f5f7;
}

.intensity-copy p {
    color: #a1a1a6;
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ---- Feature list ---- */

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-list li {
    position: relative;
    padding-left: 24px;
    font-size: 17px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-blue);
}

.feature-list--light li {
    color: #a1a1a6;
}

.feature-list--light li::before {
    background: var(--color-orange);
}

/* ---- Split sections ---- */

.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    max-width: var(--content-max);
    margin: 0 auto clamp(60px, 8vw, 80px);
}

.split-section--reverse .split-copy {
    order: 2;
}

.split-section--reverse .split-visual {
    order: 1;
}

.stat-row {
    display: flex;
    gap: clamp(24px, 4vw, 48px);
    margin: 32px 0;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.stat-label {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ---- Screenshot grids ---- */

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 32px);
    max-width: var(--content-max);
    margin: 0 auto;
}

.screenshot-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.screenshot-card p {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 12px;
}

.screenshot-card--compact .screenshot-slot {
    aspect-ratio: 9 / 16;
}

/* ---- Watch section ---- */

.watch-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    max-width: var(--content-max);
    margin: 0 auto;
}

.watch-devices {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.watch-app-icon {
    border-radius: 18px;
    margin-top: 24px;
}

/* ---- Privacy ---- */

.section-privacy {
    text-align: center;
    background: var(--color-bg-alt);
    padding: clamp(60px, 10vw, 100px) clamp(20px, 4vw, 40px);
}

.privacy-inner {
    max-width: 640px;
    margin: 0 auto;
}

.privacy-inner h2 {
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: 16px;
}

.privacy-inner p {
    font-size: 19px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ---- Download / App Store ---- */

.section-download {
    text-align: center;
    padding-bottom: clamp(100px, 14vw, 160px);
}

.download-inner {
    max-width: 560px;
    margin: 0 auto;
}

.download-icon {
    border-radius: 22px;
    margin: 0 auto 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.download-inner h2 {
    margin-bottom: 12px;
}

.download-inner .section-lead {
    margin: 0 auto 36px;
}

.app-store-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s var(--ease-spring);
}

.app-store-link:hover {
    transform: scale(1.04);
    opacity: 1;
}

.app-store-badge {
    position: relative;
    display: inline-block;
}

.badge-svg {
    width: min(200px, 50vw);
    height: auto;
    border-radius: 8px;
}

.badge-placeholder-note {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-style: italic;
}

.download-note {
    margin-top: 24px;
    font-size: 14px;
    color: var(--color-text-tertiary);
}

/* ---- Footer ---- */

.site-footer {
    background: var(--color-dark-elevated);
    color: #a1a1a6;
    padding: 48px clamp(20px, 4vw, 40px);
}

.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}

.footer-brand img {
    border-radius: 9px;
}

.footer-brand strong {
    display: block;
    color: #f5f5f7;
    font-size: 17px;
}

.footer-brand p {
    font-size: 14px;
    margin-top: 2px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.footer-links a {
    color: #a1a1a6;
    font-size: 14px;
    text-decoration: none;
}

.footer-links a:hover {
    color: #f5f5f7;
    opacity: 1;
}

.footer-legal {
    font-size: 12px;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
}

.footer-legal span {
    display: block;
    margin-top: 4px;
}

/* ---- Scroll reveal ---- */

.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Legal / compliance pages ---- */

.legal-page {
    padding: calc(var(--nav-height) + 48px) clamp(20px, 4vw, 40px) var(--section-pad);
    max-width: 780px;
    margin: 0 auto;
}

.legal-hero {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--color-border);
}

.legal-hero h1 {
    margin-bottom: 8px;
}

.legal-meta {
    font-size: 17px;
    color: var(--color-text-secondary);
    margin-bottom: 28px;
}

.legal-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legal-subnav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-alt);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.legal-subnav a:hover {
    color: var(--color-text);
    opacity: 1;
}

.legal-subnav a.is-active {
    background: var(--color-text);
    color: #fff;
}

.legal-content section {
    margin-bottom: 40px;
}

.legal-content h2 {
    font-size: clamp(24px, 3vw, 32px);
    margin-bottom: 14px;
    letter-spacing: -0.025em;
}

.legal-content p,
.legal-content li {
    font-size: 17px;
    line-height: 1.55;
    color: var(--color-text-secondary);
}

.legal-content p {
    margin-bottom: 14px;
}

.legal-content ul {
    margin: 0 0 14px 1.2em;
    padding: 0;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: var(--color-blue);
}

.legal-content strong {
    color: var(--color-text);
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.contact-card {
    background: var(--color-bg-alt);
    border-radius: 18px;
    padding: 28px 24px;
    border: 1px solid var(--color-border);
}

.contact-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.contact-card p {
    margin-bottom: 12px;
}

.contact-link {
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-blue);
    text-decoration: none;
    margin-bottom: 8px;
    word-break: break-word;
}

.contact-note {
    font-size: 14px !important;
    color: var(--color-text-tertiary) !important;
    margin-bottom: 0 !important;
}

.footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    padding-top: 8px;
}

.footer-legal-links a {
    color: #86868b;
    font-size: 13px;
    text-decoration: none;
}

.footer-legal-links a:hover {
    color: #f5f5f7;
    opacity: 1;
}

@media (max-width: 734px) {
    .contact-cards {
        grid-template-columns: 1fr;
    }
}

/* ---- Responsive ---- */

@media (max-width: 1068px) {
    .hero,
    .intensity-showcase,
    .split-section,
    .watch-showcase {
        grid-template-columns: 1fr;
    }

    .split-section--reverse .split-copy,
    .split-section--reverse .split-visual {
        order: unset;
    }

    .hero-visual {
        min-height: 360px;
    }

    .device-watch {
        right: 10%;
    }

    .screenshot-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 734px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(251, 251, 253, 0.96);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-110%);
        opacity: 0;
        transition: transform 0.35s var(--ease-out), opacity 0.35s;
        pointer-events: none;
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .screenshot-grid,
    .screenshot-grid--4 {
        grid-template-columns: 1fr;
    }

    .device-watch {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: -60px;
        margin-left: auto;
        margin-right: -20px;
    }

    .hero-visual {
        flex-direction: column;
        gap: 20px;
    }

    .intensity-meter {
        padding: 24px;
    }

    .core-effort-meter {
        padding: 16px;
    }

    .cem-label {
        font-size: 18px;
    }

    .watch-devices {
        flex-direction: column;
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .meter-fill,
    .meter-indicator,
    .meter-zone {
        transition: none;
    }

    .cem-panel,
    .cem-rail-dot--active {
        animation: none;
    }
}
