/* ============================================================
   monopole.ai — Coastal Mid-Century Authority
   Timeline-Vertical Layout with Leather Texture
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --atlantic-slate: #3a4a5e;
    --storm-petrel: #5a7a8e;
    --tidal-brass: #b8946a;
    --kelp-bronze: #8a6a42;
    --driftwood-sand: #e8dcc4;
    --parchment: #f5f0e6;
    --salt-foam: #f0ede5;
    --horizon-blue: #6a8ea4;
    --deep-current: #1e2a38;
    --fog-grey: #c4c8cc;

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --timeline-width: 2px;
    --container-max: 1200px;
    --card-width: 45%;
    --card-offset: 60px;
    --gutter: 24px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--atlantic-slate);
    background-color: var(--driftwood-sand);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Grid-Line Underlay (Drafting Paper) --- */
.grid-underlay {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    z-index: 0;
    pointer-events: none;
    transform: rotate(0.5deg);
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(90, 122, 142, 0.08) 0px,
            rgba(90, 122, 142, 0.08) 0.5px,
            transparent 0.5px,
            transparent 48px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(90, 122, 142, 0.08) 0px,
            rgba(90, 122, 142, 0.08) 0.5px,
            transparent 0.5px,
            transparent 48px
        );
    animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
    0% { transform: rotate(0.5deg) translate(0, 0); }
    50% { transform: rotate(0.5deg) translate(0.5px, 0.5px); }
    100% { transform: rotate(0.5deg) translate(0, 0); }
}

/* --- Monogram Watermark --- */
.monogram-watermark {
    position: fixed;
    top: 100vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20vw;
    color: var(--storm-petrel);
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
    will-change: transform;
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 16px;
    width: 2px;
    height: 100vh;
    background-color: rgba(184, 148, 106, 0.15);
    z-index: 100;
}

.scroll-progress-fill {
    width: 100%;
    height: 0%;
    background-color: var(--tidal-brass);
    transition: height 0.1s linear;
}

/* ============================================================
   LIGHTHOUSE HEADER — Full Viewport Coastal Entry
   ============================================================ */
.lighthouse-header {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.coastal-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        #e8dcc4 0%,
        #c4c8cc 38%,
        #5a7a8e 62%,
        #3a4a5e 100%
    );
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 var(--gutter);
}

/* Horizon Line - Golden Ratio at 62% from top */
.horizon-line {
    position: absolute;
    top: 62vh;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--tidal-brass);
    z-index: 1;
    transform: scaleX(0);
    transform-origin: center;
    animation: horizon-draw 1000ms cubic-bezier(0.25, 0, 0.15, 1) 500ms forwards;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--atlantic-slate);
    letter-spacing: -0.02em;
    line-height: 1.05;
    opacity: 0;
    transform: translateY(30px);
    animation: title-rise 800ms cubic-bezier(0.25, 0, 0.15, 1) 1500ms forwards;
}

.site-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--driftwood-sand);
    letter-spacing: 0.08em;
    margin-top: 0.5em;
    opacity: 0;
    transform: translateY(15px);
    animation: subtitle-rise 800ms cubic-bezier(0.25, 0, 0.15, 1) 1900ms forwards;
}

/* Timeline spine starting segment from header */
.timeline-spine-start {
    width: var(--timeline-width);
    height: 0;
    background-color: var(--tidal-brass);
    margin: 2rem auto 0;
    animation: spine-grow 1200ms cubic-bezier(0.25, 0, 0.15, 1) 2300ms forwards;
}

/* --- Entry Animations --- */
@keyframes horizon-draw {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@keyframes title-rise {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtitle-rise {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spine-grow {
    from { height: 0; }
    to   { height: 120px; }
}

/* ============================================================
   TIMELINE MAIN — Vertical Spine with Alternating Cards
   ============================================================ */
.timeline-main {
    position: relative;
    z-index: 1;
    padding: 0 var(--gutter);
}

.timeline-container {
    position: relative;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 0 4rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 var(--gutter);
}

/* Vertical timeline spine */
.timeline-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--timeline-width);
    background-color: var(--tidal-brass);
    z-index: 1;
}

/* --- Timeline Nodes --- */
.timeline-node {
    grid-column: 1 / -1;
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 var(--gutter);
    padding: 3rem 0;
    opacity: 0;
    transition: opacity 0.01s;
}

.timeline-node.is-visible {
    opacity: 1;
}

/* Node connector (brass circle on spine) */
.node-connector {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.node-circle {
    width: 12px;
    height: 12px;
    border: 2px solid var(--tidal-brass);
    border-radius: 50%;
    background: var(--driftwood-sand);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-node.is-visible .node-circle {
    transform: scale(1);
}

.node-circle-inner {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--kelp-bronze);
    opacity: 0;
    transition: opacity 200ms ease;
}

.node-circle:hover .node-circle-inner,
.timeline-node:hover .node-circle-inner {
    opacity: 1;
}

/* --- Timeline Cards --- */
.timeline-card {
    position: relative;
    background-color: var(--parchment);
    padding: 2.5rem;
    cursor: crosshair;
    transition:
        box-shadow 300ms ease,
        border-width 300ms ease;
    /* Leather texture subtle overlay */
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(184,148,106,0.06) 0%, transparent 70%);
}

.timeline-card::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#leather-noise);
    opacity: 1;
    transition: opacity 300ms ease;
    pointer-events: none;
    z-index: 0;
}

.timeline-card:hover::before {
    filter: url(#leather-noise-hover);
}

.timeline-card:hover {
    box-shadow: 0 4px 20px rgba(184, 148, 106, 0.15);
}

/* Left-branching cards: columns 1-5 */
.timeline-card--left {
    grid-column: 1 / 6;
    border-right: 3px solid var(--tidal-brass);
    transform: translateX(-40px);
    opacity: 0;
    transition:
        transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
        opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 300ms ease;
}

.timeline-node.is-visible .timeline-card--left {
    transform: translateX(0);
    opacity: 1;
}

.timeline-card--left:hover {
    border-right-width: 5px;
}

/* Right-branching cards: columns 8-12 */
.timeline-card--right {
    grid-column: 8 / 13;
    border-left: 3px solid var(--tidal-brass);
    transform: translateX(40px);
    opacity: 0;
    transition:
        transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
        opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 300ms ease;
}

.timeline-node.is-visible .timeline-card--right {
    transform: translateX(0);
    opacity: 1;
}

.timeline-card--right:hover {
    border-left-width: 5px;
}

/* Card content */
.card-sequence {
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    letter-spacing: 0.04em;
    color: var(--tidal-brass);
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.card-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--atlantic-slate);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.card-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    color: var(--atlantic-slate);
    position: relative;
    z-index: 1;
}

/* --- Coastal Horizon Band Dividers --- */
.horizon-band {
    grid-column: 1 / -1;
    height: 4px;
    margin: 1rem 0;
    background: linear-gradient(
        to top,
        #e8dcc4 0%,
        #c4c8cc 38%,
        #5a7a8e 62%,
        #3a4a5e 100%
    );
    animation: horizon-pulse 4s ease-in-out infinite;
}

@keyframes horizon-pulse {
    0%, 100% { opacity: 0.8; }
    50%      { opacity: 1; }
}

/* --- Timeline Terminus --- */
.timeline-terminus {
    grid-column: 1 / -1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--tidal-brass);
    margin: 2rem auto 0;
    position: relative;
    z-index: 2;
}

/* ============================================================
   TERMINUS FOOTER
   ============================================================ */
.terminus-footer {
    position: relative;
    z-index: 1;
    background-color: var(--driftwood-sand);
    padding: 4rem var(--gutter) 3rem;
    text-align: center;
}

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

.footer-contact {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--atlantic-slate);
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-nav-item {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    line-height: 1.3;
    color: var(--atlantic-slate);
    cursor: pointer;
    transition: color 200ms ease;
}

.footer-nav-item:hover {
    color: var(--horizon-blue);
}

.footer-nav-separator {
    color: var(--tidal-brass);
    font-size: 0.85rem;
}

.footer-copyright {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: var(--storm-petrel);
    letter-spacing: 0.08em;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .horizon-line,
    .site-title,
    .site-subtitle,
    .timeline-spine-start {
        animation: none;
        opacity: 1;
        transform: none;
        height: 120px;
    }

    .horizon-line {
        transform: scaleX(1);
    }

    .site-title {
        opacity: 1;
        transform: translateY(0);
    }

    .site-subtitle {
        opacity: 1;
        transform: translateY(0);
    }

    .timeline-spine-start {
        height: 120px;
    }

    .timeline-node {
        opacity: 1;
    }

    .node-circle {
        transform: scale(1);
    }

    .timeline-card--left,
    .timeline-card--right {
        opacity: 1;
        transform: translateX(0);
    }

    .grid-underlay {
        animation: none;
    }

    .horizon-band {
        animation: none;
        opacity: 1;
    }
}

/* ============================================================
   RESPONSIVE — Mobile Adjustments
   ============================================================ */
@media (max-width: 768px) {
    .timeline-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .timeline-spine {
        left: 24px;
        transform: none;
    }

    .timeline-node {
        display: block;
        padding: 2rem 0 2rem 48px;
    }

    .node-connector {
        left: 24px;
        top: 3.5rem;
        transform: translate(-50%, 0);
    }

    .timeline-card--left,
    .timeline-card--right {
        grid-column: unset;
        border-left: 3px solid var(--tidal-brass);
        border-right: none;
        padding: 1.5rem;
    }

    .timeline-card--left:hover,
    .timeline-card--right:hover {
        border-left-width: 5px;
        border-right-width: 0;
    }

    .timeline-card--left {
        transform: translateX(-20px);
    }

    .timeline-card--right {
        transform: translateX(-20px);
    }

    .timeline-node.is-visible .timeline-card--left,
    .timeline-node.is-visible .timeline-card--right {
        transform: translateX(0);
    }

    .timeline-terminus {
        margin-left: 12px;
    }

    .horizon-band {
        margin-left: -48px;
    }

    .monogram-watermark {
        font-size: 40vw;
    }

    .scroll-progress {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .site-subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1.1rem);
    }

    .timeline-node {
        padding-left: 40px;
    }

    .timeline-spine {
        left: 16px;
    }

    .node-connector {
        left: 16px;
    }

    .timeline-card--left,
    .timeline-card--right {
        padding: 1.25rem;
    }
}
