/* =========================================================
   SOLO + CONDUCTOR scroll illustration — component styles
   ---------------------------------------------------------
   Structure:
     1. Section shell + accessible intro
     2. Static fallback (default state, and reduced-motion state)
     3. Scroll track + sticky stage
     4. Caption / step-nav overlay
     5. SVG layer animations (chip pulse, hub ring, data dots, sun)
     6. Responsive tweaks
   ========================================================= */

/* ---------------------------------------------------------
   1. Section shell
   --------------------------------------------------------- */
.scs {
    position: relative;
    background: var(--surface-alt);
}

.scs__intro {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}
.scs__intro p {
    max-width: 58rem;
    margin: 0 auto;
    color: var(--ink-muted);
    font-size: 1rem;
}
.scs__intro-card {
    max-width: 72rem;
    margin-inline: auto;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.scs__intro-title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
    letter-spacing: -0.02em;
}

.scs__intro-arrow {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-top: 1.25rem;
    color: var(--pendax-accent-strong);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.scs__intro-arrow:hover { color: var(--pendax-ink); }

.scs__intro-arrow i {
    font-size: 1.85rem;
    line-height: 1;
    animation: scs-intro-bounce 1.8s ease-in-out infinite;
}

@keyframes scs-intro-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ---------------------------------------------------------
   2. Static fallback — shown by default; interactive scene
      (section 3+) only appears once JS confirms it should run.
   --------------------------------------------------------- */
.scs__static {
    padding: 1.5rem 1.5rem 3.5rem;
    max-width: 74rem;
    margin-inline: auto;
}
.scs__static-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}
.scs__static-card {
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.scs__static-card svg { width: 2.75rem; height: 2.75rem; margin-bottom: 1rem; }
.scs__static-card h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.scs__static-card p { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }
.scs__static-note {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.scs__track { display: none; }

.scs.is-interactive .scs__static { display: none; }
.scs.is-interactive .scs__track { display: block; }

/* Belt-and-braces: if the OS motion preference changes mid-session,
   collapse back to the static view even if JS already marked the
   section interactive. */
@media (prefers-reduced-motion: reduce) {
    .scs.is-interactive .scs__static { display: block; }
    .scs.is-interactive .scs__track { display: none; }
}

/* ---------------------------------------------------------
   3. Scroll track + sticky stage
   --------------------------------------------------------- */
.scs__track {
    position: relative;
    /* Height set by JS (js/config.js: STEP_WEIGHTS * VH_PER_UNIT).
       This value is only a no-JS-yet placeholder. */
    height: 500vh;
}

/* The document has scroll-padding for the fixed navbar. Offset the stage
   anchor by the same amount so an anchor jump leaves the full 100vh stage,
   including its bottom navigation, inside the viewport. */
.scs__stage-anchor {
    position: absolute;
    top: var(--navbar-height);
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.scs__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.scs__svg-wrap {
    position: absolute;
    inset: 0;
}
.scs__svg-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------------------------------------------------------
   4. Caption / step-nav overlay
   --------------------------------------------------------- */
.scs__overlay {
    position: absolute;
    /* Match the visible 16:10 SVG canvas on ultrawide screens. The overlay
       stays viewport-fixed, so the animated viewBox cannot move the nav. */
    left: 50%;
    width: min(100%, 160vh);
    bottom: 0;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(247, 245, 241, 0) 0%, rgba(247, 245, 241, 0.85) 55%, rgba(247, 245, 241, 0.96) 100%);
    pointer-events: none; /* re-enabled selectively on .scs__nav */
}

.scs__captions {
    position: relative;
    height: 2.6rem;
    max-width: 40rem;
}
.scs__caption {
    position: absolute;
    inset: 0;
    margin: 0;
    font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.4rem);
    line-height: 1.2; /* short bold phrase, not body text -- the site's 1.7 default is far too loose here */
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--pendax-ink);
    opacity: 0;
    text-shadow: 0 1px 18px rgba(255, 255, 255, 0.6);
}

.scs__nav {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    pointer-events: auto;
}
.scs__nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--pendax-accent-strong);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.12s ease;
}
.scs__nav-btn svg { width: 0.9rem; height: 0.9rem; }
.scs__nav-btn:hover:not(:disabled) { background: rgba(var(--pendax-accent-rgb), 0.15); }
.scs__nav-btn:active:not(:disabled) { transform: scale(0.94); }
.scs__nav-btn:disabled { opacity: 0.35; cursor: default; }
.scs__nav-btn:focus-visible,
.scs__dot:focus-visible {
    outline: 2px solid var(--pendax-accent-strong);
    outline-offset: 2px;
}

.scs__stepnum {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    min-width: 4.4rem;
}

.scs__dots {
    display: flex;
    gap: 0.5rem;
    flex: 1 1 auto;
}
.scs__dot {
    width: 0.6rem;
    height: 0.6rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(29, 29, 29, 0.18);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.scs__dot:hover { background: rgba(140, 106, 68, 0.5); }
.scs__dot.is-active {
    background: var(--pendax-accent-strong);
    transform: scale(1.25);
}

/* ---------------------------------------------------------
   5. SVG layer animations
   --------------------------------------------------------- */

/* Blinds animate scaleY from the top of each window. */
.scs-window__blind {
    transform-box: fill-box;
    transform-origin: top;
    transform: scaleY(0);
}
.scs-window__glass,
.scs-window__glow {
    transform-box: fill-box;
}

/* SOLO chip: fixed position (set inline by JS), gentle perpetual
   "alive" pulse once active — decoupled from the per-frame opacity
   JS sets, so the two never fight over the same CSS property. */
.scs-chip__ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: scs-chip-pulse 3.2s ease-in-out infinite;
    animation-play-state: paused;
}
.scs-chip.is-active .scs-chip__ring { animation-play-state: running; }
@keyframes scs-chip-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.18); }
}

/* Data-flow dot travelling along the wire path. */
.scs-wire {
    transition: opacity 0.4s ease;
}
.scs-wire__dot {
    opacity: 0;
    offset-distance: 0%;
    animation: scs-travel 2.6s linear infinite;
    animation-play-state: paused;
}
.scs-wire__dot.is-flowing { animation-play-state: running; }
@keyframes scs-travel {
    0%   { offset-distance: 0%; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* CONDUCTOR hub: slow orbiting ring + soft ripple, both perpetual
   once the hub is active, paused otherwise (and when off-screen). */
.scs-hub {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
}
.scs-hub__ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: scs-spin 16s linear infinite;
    animation-play-state: paused;
}
.scs-hub__ripple {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: scs-ripple 3.4s ease-out infinite;
    animation-play-state: paused;
}
.scs-hub.is-active .scs-hub__ring,
.scs-hub.is-active .scs-hub__ripple { animation-play-state: running; }
@keyframes scs-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes scs-ripple {
    0%   { opacity: 0.55; transform: scale(1); }
    100% { opacity: 0; transform: scale(2.1); }
}

/* Sun: slowly rotating rays + a soft pulse on the core, independent of
   the JS-driven position transform on the parent group. */
.scs-sun__rays {
    transform-box: fill-box;
    transform-origin: center;
    animation: scs-spin 120s linear infinite;
}
.scs-sun__core {
    transform-box: fill-box;
    transform-origin: center;
    animation: scs-sun-pulse 7s ease-in-out infinite;
}
@keyframes scs-sun-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

.scs-secondary { transition: opacity 0.3s ease; }

.scs-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.scs-card__label {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    fill: var(--ink);
}

/* Kill every perpetual CSS animation the moment the illustration
   leaves the viewport (the rAF loop already stops separately). */
.scs--offscreen .scs-chip__ring,
.scs--offscreen .scs-wire__dot,
.scs--offscreen .scs-hub__ring,
.scs--offscreen .scs-hub__ripple,
.scs--offscreen .scs-sun__rays,
.scs--offscreen .scs-sun__core {
    animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
    .scs__intro-arrow i { animation: none; }
    .scs-chip__ring, .scs-wire__dot, .scs-hub__ring, .scs-hub__ripple,
    .scs-sun__rays, .scs-sun__core {
        animation: none !important;
    }
}

/* ---------------------------------------------------------
   6. Responsive tweaks
   --------------------------------------------------------- */
@media (max-width: 899.98px) {
    .scs__static-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 559.98px) {
    .scs__static-grid { grid-template-columns: 1fr; }
    .scs__overlay { padding: 1.1rem 1.1rem 1.4rem; }
    .scs__caption { font-size: 1.05rem; }
    /* The longer "Pendax SOLO – ..." / "CONDUCTOR – ..." captions wrap to
       two lines at narrow widths; give the box room so the second line
       doesn't overlap the nav row below it. */
    .scs__captions { height: 2.9rem; }
    .scs__stepnum { display: none; }
}
