/* Dierend 3D scroll homepage — same palette and font as styles.css */
/* Dierend homepage 3D scroll story. Palette, font, nav and buttons come from styles.css. */
:root {
    --gutter: clamp(16px, 5vw, 72px);
}

/* styles.css sets overflow-x: hidden on html and body, which turns body into a
   scroll container and stops position: sticky from working. clip still hides
   sideways overflow without creating a scroll container. */
html, body { overflow-x: clip; }


/* --- PINNED STORY --- */
.s3-story {
    position: relative;
    z-index: 1;
    height: 800vh;
    padding: 0;
}

.s3-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.s3-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.s3-canvas.is-ready { opacity: 1; }

/* No WebGL (or the context was lost): show the feed screen as a flat picture instead */
.no-webgl .s3-canvas { display: none; }
.no-webgl .s3-stage {
    background: url(images/tour/feed.jpg) no-repeat right 14% center / auto 66%;
}

.s3-glow {
    position: absolute;
    width: 70vmin;
    height: 70vmin;
    right: 12%;
    top: 50%;
    transform: translate(0, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22), rgba(14, 165, 233, 0.08) 45%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}

.s3-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.7) 32%, rgba(15, 23, 42, 0) 55%);
}

.s3-copy {
    position: absolute;
    left: var(--gutter);
    top: 50%;
    transform: translateY(-50%);
    width: min(520px, 42vw);
    pointer-events: none;
}

.s3-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    opacity: 0;
}

/* faded-out steps stay in the accessibility tree; only the shown one takes clicks */
.s3-step.is-on { pointer-events: auto; }

.s3-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* Live Now badge sits at the right end of the nav */
#navbar .nav-links { margin-left: auto; }
#navbar .s3-live { margin-left: 24px; flex: none; }

@media (max-width: 1024px) {
    /* no menu button on phones and tablets: the Live Now badge and the step dots cover navigation */
    #navbar .s3-live { margin-left: auto; }
}

.s3-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.25s, transform 0.25s;
}

.s3-live:hover { background: rgba(16, 185, 129, 0.22); transform: translateY(-1px); }

.s3-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-secondary);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: s3-pulse 1.8s ease-out infinite;
}

@keyframes s3-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.s3-sky { color: var(--color-primary); }
.s3-emerald { color: var(--color-secondary); }
.s3-gold { color: var(--color-tertiary); }

.s3-step h1 {
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.s3-step h2 {
    font-size: clamp(2rem, 3.8vw, 3.4rem);
    font-weight: 800;
    margin-bottom: 0;
    line-height: 1.08;
    letter-spacing: -0.015em;
}

.s3-grad {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.s3-lede {
    margin-top: 18px;
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    color: var(--text-muted);
    max-width: 30em;
}

.s3-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 28px;
}

.s3-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.s3-badges img { display: block; height: 52px; width: auto; }

.s3-progress {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 28px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.s3-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--gradient-main);
    transform-origin: left;
    transform: scaleX(0);
}

.s3-hint {
    position: absolute;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: opacity 0.4s;
}

.s3-hint::after {
    content: '';
    display: block;
    width: 1px;
    height: 28px;
    margin: 8px auto 0;
    background: linear-gradient(to bottom, var(--color-secondary), transparent);
    animation: s3-drip 1.8s ease-in-out infinite;
}

@keyframes s3-drip {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --- TEAM STEP --- */
.s3-team {
    list-style: none;
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

.s3-member {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.s3-member img {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    padding: 2px;
    background: var(--gradient-main);
}

.s3-member h3 { font-size: 1.1rem; font-weight: 800; line-height: 1.2; }
.s3-role { font-size: 0.9rem; font-weight: 600; margin-top: 2px; }
.s3-bio { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }

/* --- CONTACT STEP (was the footer) --- */
.s3-note { margin-top: 10px; color: var(--text-muted); font-size: 0.95rem; max-width: 30em; }

.s3-email {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.25s;
}

.s3-email:hover { background: rgba(255, 255, 255, 0.1); }

.s3-contact .s3-badges { margin-top: 20px; }

.s3-socials {
    display: flex;
    gap: 14px;
    margin-top: 22px;
}

.s3-copyright { margin-top: 22px; color: #64748b; font-size: 0.85rem; }

/* --- STEP DOTS --- */
.s3-dots {
    position: absolute;
    right: clamp(12px, 2.4vw, 32px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.s3-dot {
    position: relative;
    width: 28px;
    height: 28px;
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
}

.s3-dot::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(248, 250, 252, 0.28);
    transform: translate(-50%, -50%);
    transition: background 0.3s, height 0.3s, border-radius 0.3s;
}

.s3-dot:hover::before { background: rgba(248, 250, 252, 0.6); }

.s3-dot.is-active::before {
    height: 22px;
    border-radius: 4px;
    background: var(--gradient-main);
}

.s3-dot:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; border-radius: 8px; }

.s3-dot-label {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translate(6px, -50%);
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.s3-dot:hover .s3-dot-label,
.s3-dot:focus-visible .s3-dot-label { opacity: 1; transform: translate(0, -50%); }

/* --- PHONE WIDTH: copy sits under the 3D scene --- */
@media (max-width: 820px) {
    .s3-copy {
        top: auto;
        bottom: 56px;
        transform: none;
        width: auto;
        right: var(--gutter);
    }

    .s3-step { top: auto; bottom: 0; transform: none; }
    .s3-scrim { background: linear-gradient(0deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.8) 34%, rgba(15, 23, 42, 0) 52%); }
    .s3-glow { right: 50%; top: 36%; transform: translate(50%, -50%); }
    .s3-hint { display: none; }
    /* dots become a row at the bottom, in place of the progress line */
    .s3-progress { display: none; }
    .s3-dots {
        top: auto;
        bottom: 14px;
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 2px;
    }
    .s3-dot.is-active::before { width: 22px; height: 8px; }
    .s3-dot-label { display: none; }
    .no-webgl .s3-stage { background-position: center 14%; background-size: auto 40%; }
    .s3-badges img { height: 44px; }
    .s3-actions { gap: 10px; margin-top: 20px; }
    /* styles.css stretches every section button to full width on phones; keep these side by side */
    .s3-story .s3-actions .btn { width: auto; flex: 1 1 0; justify-content: center; margin: 0; padding: 12px 14px; font-size: 0.95rem; white-space: nowrap; }
    .s3-step h1 { font-size: clamp(1.9rem, 8.4vw, 2.4rem); }
    .s3-step h2 { font-size: clamp(1.7rem, 7.4vw, 2.2rem); }
    .s3-lede { margin-top: 12px; font-size: 1rem; }
    .s3-team { gap: 14px; margin-top: 18px; }
    .s3-member img { width: 52px; height: 52px; }
    .s3-bio { font-size: 0.85rem; }
    .s3-email, .s3-contact .s3-badges, .s3-socials, .s3-copyright { margin-top: 16px; }
    .s3-socials .social-link { width: 42px; height: 42px; font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .s3-hint::after, .s3-live-dot { animation: none; }
}
