/* oning.stream v2 — Reasoning stream
   Pixel-art aesthetic, minimal-navigation, baskerville-refined,
   burgundy-cream palette, counter-animate, lens-flare, futuristic, bold-confident.
   Palette:
     #4A1828 burgundy   #F0E8D0 cream    #D8A830 flare gold
     #38A8A0 pixel teal #C87068 warm rose #2A0818 deep wine
     #F8F0E0 soft ivory
*/

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

html,
body {
    background: #F0E8D0;
    color: #2A0818;
    font-family: "Libre Baskerville", Georgia, serif;
    font-weight: 400;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 50%, #F0E8D0 0%, #F0E8D0 55%, #E0CFB6 100%);
    position: relative;
}

/* Pixel-grid atmospheric overlay (8px lattice) */
.pixel-grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 600ms ease-out;
    background-image:
        repeating-linear-gradient(0deg, rgba(42, 8, 24, 0.06) 0px, rgba(42, 8, 24, 0.06) 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(90deg, rgba(42, 8, 24, 0.06) 0px, rgba(42, 8, 24, 0.06) 1px, transparent 1px, transparent 8px);
    mix-blend-mode: multiply;
}

.pixel-grid-overlay.is-on {
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Ignition screen                                                     */
/* ------------------------------------------------------------------ */
.ignition {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background:
        radial-gradient(ellipse at 50% 30%, #F0E8D0 0%, #E8D4B4 40%, #C87068 78%, #4A1828 100%);
    color: #F8F0E0;
    overflow: hidden;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ignition-edge {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: none;
    background-image:
        linear-gradient(#38A8A0, #38A8A0),
        linear-gradient(#38A8A0, #38A8A0);
    background-repeat: no-repeat;
}

.ignition-edge-tl {
    top: 24px;
    left: 24px;
    background-size: 80px 1px, 1px 80px;
    background-position: 0 0, 0 0;
}

.ignition-edge-tr {
    top: 24px;
    right: 24px;
    background-size: 80px 1px, 1px 80px;
    background-position: 100% 0, 100% 0;
}

.ignition-edge-bl {
    bottom: 24px;
    left: 24px;
    background-size: 80px 1px, 1px 80px;
    background-position: 0 100%, 0 100%;
}

.ignition-edge-br {
    bottom: 24px;
    right: 24px;
    background-size: 80px 1px, 1px 80px;
    background-position: 100% 100%, 100% 100%;
}

.ignition-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(420px, 70vmin, 900px);
    height: clamp(420px, 70vmin, 900px);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    filter: blur(0.4px);
}

.ignition-flare svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ignition-flare.is-on {
    animation: flare-ignite 1200ms cubic-bezier(0.2, 0.7, 0.25, 1.0) forwards,
               flare-pulse 5200ms ease-in-out 1200ms infinite;
}

@keyframes flare-ignite {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes flare-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.06); }
}

.ignition-content {
    position: relative;
    z-index: 3;
    width: min(680px, calc(100vw - 96px));
    text-align: center;
    color: #2A0818;
    mix-blend-mode: normal;
}

.ignition-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-style: italic;
    color: #4A1828;
    letter-spacing: 0.08em;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(74, 24, 40, 0.4);
}

.ignition-tag {
    text-transform: uppercase;
}

.ignition-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    color: #2A0818;
    font-weight: 700;
    font-style: normal;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #C87068;
    box-shadow: 2px 2px 0 #2A0818;
    animation: status-blink 1400ms steps(2, end) infinite;
}

@keyframes status-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0.25; }
}

.ignition-title {
    font-family: "Libre Baskerville", Georgia, serif;
    font-weight: 700;
    font-size: clamp(40px, 7vw, 96px);
    letter-spacing: 0.01em;
    line-height: 1.05;
    color: #2A0818;
    text-shadow: 3px 3px 0 #D8A830;
    margin: 0 0 24px;
    min-height: 1.05em;
}

.title-cursor {
    display: inline-block;
    color: #C87068;
    margin-left: 6px;
    animation: cursor-blink 700ms steps(2, end) infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.ignition-subtitle {
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.7;
    color: #4A1828;
    font-style: italic;
    max-width: 540px;
    margin: 0 auto 48px;
}

.ignition-circuit {
    display: block;
    width: 100%;
    height: 80px;
    margin: 0 auto 56px;
    overflow: visible;
}

.ignition-circuit path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
}

.ignition-circuit.is-on path {
    animation: trace-draw 1800ms ease-out forwards;
}

.ignition-circuit.is-on path:nth-child(2) {
    animation-delay: 220ms;
}

@keyframes trace-draw {
    to { stroke-dashoffset: 0; }
}

.ignition-circuit circle {
    opacity: 0;
}

.ignition-circuit.is-on circle {
    animation: node-pop 360ms steps(3, end) forwards;
}

.ignition-circuit.is-on circle:nth-child(3) { animation-delay: 1100ms; }
.ignition-circuit.is-on circle:nth-child(4) { animation-delay: 1300ms; }
.ignition-circuit.is-on circle:nth-child(5) { animation-delay: 1500ms; }
.ignition-circuit.is-on circle:nth-child(6) { animation-delay: 1700ms; }

@keyframes node-pop {
    0% { opacity: 0; r: 0; }
    100% { opacity: 1; r: 2; }
}

.ignition-scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #4A1828;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: color 200ms ease-out, transform 200ms ease-out;
}

.ignition-scroll-cue:hover {
    color: #2A0818;
    transform: translateY(2px);
}

.cue-arrow {
    font-size: 18px;
    line-height: 1;
    color: #D8A830;
    text-shadow: 2px 2px 0 #4A1828;
    animation: cue-bounce 1600ms ease-in-out infinite;
}

@keyframes cue-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ------------------------------------------------------------------ */
/* Reasoning timeline                                                  */
/* ------------------------------------------------------------------ */
.timeline {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 96px 24px 128px;
}

.timeline-rail {
    position: absolute;
    left: -40px;
    top: 96px;
    bottom: 128px;
    width: 60px;
    pointer-events: none;
}

.rail-circuit {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.rail-circuit path {
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
    transition: stroke-dashoffset 1.6s ease-out;
}

.rail-circuit.is-on path {
    stroke-dashoffset: 0;
}

.rail-circuit circle {
    transition: opacity 240ms ease-out;
    opacity: 0;
}

.rail-circuit.is-on circle {
    opacity: 1;
}

/* Reasoning blocks */
.reasoning-block {
    position: relative;
    margin-bottom: 64px;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 260ms steps(4, end), transform 260ms steps(4, end);
}

.reasoning-block.is-on {
    opacity: 1;
    transform: translateY(0);
}

.block-window {
    position: relative;
    background: #F8F0E0;
    border: 2px solid #2A0818;
    box-shadow: 4px 4px 0 #4A1828;
    image-rendering: pixelated;
    transition: box-shadow 200ms ease-out, transform 200ms ease-out, border-color 200ms ease-out;
}

.block-window::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, rgba(74, 24, 40, 0.05) 0px, rgba(74, 24, 40, 0.05) 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(90deg, rgba(74, 24, 40, 0.05) 0px, rgba(74, 24, 40, 0.05) 1px, transparent 1px, transparent 8px);
}

.block-window:hover {
    box-shadow: 4px 4px 0 #4A1828, 0 0 0 2px #D8A830;
    transform: translate(-1px, -1px);
}

.block-window-conclusion {
    border-color: #4A1828;
    box-shadow: 6px 6px 0 #2A0818;
    background: #F8F0E0;
}

.block-window-conclusion:hover {
    box-shadow: 6px 6px 0 #2A0818, 0 0 0 2px #D8A830;
}

.window-titlebar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #4A1828;
    color: #F0E8D0;
    border-bottom: 2px solid #2A0818;
    padding: 10px 14px;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.06em;
}

.block-window-conclusion .window-titlebar {
    background: #2A0818;
}

.window-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    background: #2A0818;
    border: 1px solid #D8A830;
    flex: 0 0 auto;
}

.window-icon svg {
    display: block;
    width: 8px;
    height: 8px;
}

.window-label {
    flex: 1;
    color: #F0E8D0;
    font-style: italic;
}

.window-tag {
    color: #D8A830;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.window-body {
    padding: 32px clamp(24px, 4vw, 40px) 36px;
    position: relative;
    color: #2A0818;
}

.block-step {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 16px;
    color: #4A1828;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.step-counter {
    font-style: normal;
    font-weight: 700;
    font-size: clamp(32px, 3vw, 56px);
    line-height: 1;
    color: #2A0818;
    text-shadow: 2px 2px 0 #D8A830;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    transition: transform 200ms ease-out;
}

.reasoning-block .block-window:hover .step-counter {
    transform: scale(1.1);
}

.step-divider {
    color: #C87068;
    font-size: 16px;
}

.step-label {
    color: #4A1828;
    font-style: italic;
    letter-spacing: 0.12em;
}

.block-heading {
    font-family: "Libre Baskerville", Georgia, serif;
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: #2A0818;
    margin: 0 0 18px;
}

.block-text {
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.85;
    color: #4A1828;
    margin: 0 0 14px;
}

.block-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.block-list li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: clamp(14px, 0.95vw, 16px);
    color: #2A0818;
    line-height: 1.6;
    padding-left: 0;
}

.list-mark {
    color: #38A8A0;
    font-weight: 700;
    flex: 0 0 auto;
}

.block-signoff {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed rgba(74, 24, 40, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-style: italic;
    color: #4A1828;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.signoff-mark {
    color: #D8A830;
    font-size: 14px;
}

/* Lens-flare dividers */
.flare-divider {
    margin: 16px auto 16px;
    width: 100%;
    max-width: 680px;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.flare-divider.is-on {
    opacity: 1;
    transform: scale(1);
    animation: divider-pulse 800ms ease-out;
}

.flare-divider-large {
    margin: 24px auto 24px;
}

.flare-divider svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

@keyframes divider-pulse {
    0% { transform: scale(1.0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.0); }
}

/* ------------------------------------------------------------------ */
/* Futuristic horizon footer                                           */
/* ------------------------------------------------------------------ */
.horizon {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #4A1828 0%, #2A0818 100%);
    color: #F0E8D0;
    padding-top: 80px;
    margin-top: 0;
    z-index: 2;
}

.horizon-svg {
    display: block;
    width: 100%;
    height: 220px;
}

.horizon-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 24px clamp(24px, 5vw, 64px) 32px;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #F0E8D0;
    border-top: 1px solid rgba(216, 168, 48, 0.4);
}

.horizon-tag {
    color: #C87068;
}

.horizon-domain {
    font-style: normal;
    font-weight: 700;
    color: #D8A830;
    letter-spacing: 0.06em;
    font-size: 14px;
    text-shadow: 2px 2px 0 #2A0818;
}

.horizon-frame {
    color: #38A8A0;
    font-variant-numeric: tabular-nums;
}

#frameCounter {
    color: #F8F0E0;
    margin-left: 4px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 720px) {
    .timeline {
        padding: 64px 16px 96px;
    }

    .timeline-rail {
        left: -8px;
        width: 28px;
    }

    .ignition-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ignition-edge {
        width: 80px;
        height: 80px;
    }

    .ignition-edge-tl,
    .ignition-edge-bl {
        left: 12px;
    }

    .ignition-edge-tr,
    .ignition-edge-br {
        right: 12px;
    }

    .ignition-edge-tl,
    .ignition-edge-tr {
        top: 12px;
    }

    .ignition-edge-bl,
    .ignition-edge-br {
        bottom: 12px;
    }

    .horizon-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .window-titlebar {
        gap: 8px;
        padding: 8px 10px;
    }

    .window-tag {
        font-size: 10px;
    }

    .timeline-rail {
        display: none;
    }
}
