/* ============================================
   PPADDL.com — Minimalist Luxury-Tech
   Gold-on-black circuit-trace aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0c0c0f;
    --bg-secondary: #1a1a22;
    --gold-primary: #c9a84c;
    --gold-bright: #e8c65a;
    --text-primary: #e8e4dc;
    --text-secondary: #8a8680;
    --accent-copper: #b87333;
    --accent-amber: #d4a03c;
    --base-unit: 8px;
    --section-pad: 120px;
    --para-spacing: 24px;
    --heading-body-gap: 32px;
}

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

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Noise Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--gold-primary);
}

h1 {
    font-weight: 500;
    font-size: clamp(64px, 10vw, 120px);
    letter-spacing: -0.03em;
    line-height: 1.0;
}

h2 {
    font-weight: 600;
    font-size: clamp(32px, 5vw, 56px);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
}

.data-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: block;
    margin-bottom: var(--base-unit);
}

/* --- Stroke Sections --- */
.stroke {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--section-pad) 0;
    overflow: hidden;
}

.stroke-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
    position: relative;
    z-index: 2;
}

/* --- Slide-Reveal Animation --- */
.slide-reveal-el {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.slide-reveal-el.revealed {
    clip-path: inset(0 0 0 0);
}

/* Even strokes reveal from left */
.stroke-2 .slide-reveal-el,
.stroke-4 .slide-reveal-el {
    clip-path: inset(0 0 0 100%);
}

.stroke-2 .slide-reveal-el.revealed,
.stroke-4 .slide-reveal-el.revealed {
    clip-path: inset(0 0 0 0);
}

/* --- Hero (Stroke 1) --- */
.stroke-1 {
    justify-content: center;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 3;
    /* Golden ratio positioning: ~61.8% from left, ~38.2% from top */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: calc(61.8% - 300px);
    padding-top: 0;
    margin-top: -10vh;
}

.hero-title {
    display: flex;
    gap: 4px;
}

.char-wrap {
    display: inline-block;
    overflow: hidden;
}

.char {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.char.visible {
    transform: translateY(0);
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 24px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease 800ms, transform 600ms ease 800ms;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero circuit trace */
.hero-trace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-ring {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 250px;
    height: 250px;
    z-index: 1;
}

/* --- Circuit Traces --- */
.circuit-trace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.trace-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1200ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.trace-line.animated {
    stroke-dashoffset: 0;
}

.trace-node {
    transform-origin: center;
    transform: scale(0);
    transition: transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

/* Node pulse animation */
@keyframes nodePulse {
    0%, 100% {
        transform: scale(1);
        stroke: #c9a84c;
    }
    50% {
        transform: scale(1.15);
        stroke: #e8c65a;
    }
}

.trace-node.pulsing {
    animation: nodePulse 3s ease-in-out infinite;
}

/* --- Circuit Dividers --- */
.circuit-divider {
    width: 100%;
    height: 20px;
    position: relative;
    z-index: 5;
}

.divider-svg {
    width: 100%;
    height: 20px;
}

.divider-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.divider-line.animated {
    stroke-dashoffset: 0;
}

.divider-branch {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 300ms ease;
}

.divider-branch.animated {
    stroke-dashoffset: 0;
}

.divider-node {
    transform-origin: center;
    transform: scale(0);
    transition: transform 200ms ease;
}

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

@keyframes dividerGlow {
    0%, 100% {
        filter: drop-shadow(0 0 0px #c9a84c);
    }
    50% {
        filter: drop-shadow(0 0 4px #e8c65a);
    }
}

.divider-node.glowing {
    animation: dividerGlow 3s ease-in-out infinite;
}

/* --- Asymmetric Splits --- */
.asymmetric-split {
    display: grid;
    gap: 48px;
    align-items: center;
}

.asymmetric-split.left-heavy {
    grid-template-columns: 65% 35%;
}

.asymmetric-split.right-heavy {
    grid-template-columns: 35% 65%;
}

.split-wide .data-label {
    margin-bottom: 16px;
}

.split-wide .section-heading {
    margin-bottom: var(--heading-body-gap);
}

.split-wide .section-body {
    font-size: 17px;
    max-width: 580px;
}

.split-wide .section-body + .section-body {
    margin-top: var(--para-spacing);
}

.split-narrow {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    justify-content: center;
}

/* --- Sparklines --- */
.sparkline {
    width: 100%;
    max-width: 200px;
    height: 60px;
}

.sparkline-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1500ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.sparkline-path.animated {
    stroke-dashoffset: 0;
}

/* --- Dot Matrix --- */
.dot-matrix {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    width: fit-content;
}

.dot-matrix .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--gold-primary);
    opacity: 0;
    transition: opacity 400ms ease;
}

.dot-matrix .dot.visible {
    opacity: 1;
}

.dot-matrix .dot.copper {
    background-color: var(--accent-copper);
}

/* --- Node Graphs --- */
.node-graph {
    width: 200px;
    height: 200px;
}

.graph-node {
    transform-origin: center;
}

@keyframes graphNodePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.graph-node.pulsing {
    animation: graphNodePulse 3s ease-in-out infinite;
}

@keyframes edgeFlicker {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.15;
    }
}

.graph-edge.flickering {
    animation: edgeFlicker 4s ease-in-out infinite;
}

/* --- Radial Rings --- */
.radial-ring {
    pointer-events: none;
}

.section-ring {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 350px;
    height: 350px;
    z-index: 1;
}

.offset-ring {
    top: auto;
    bottom: -5%;
    right: auto;
    left: -5%;
}

/* --- Background Circuits --- */
.bg-circuit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Closing Section (Stroke 5) --- */
.stroke-5 {
    justify-content: center;
}

.closing-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.closing-text {
    position: relative;
    z-index: 3;
    padding-left: 15%;
}

.closing-text .section-heading {
    margin-bottom: var(--heading-body-gap);
}

.closing-text .section-body {
    font-size: 17px;
    max-width: 520px;
}

.closing-trace {
    z-index: 1;
}

.closing-cta {
    margin-top: 48px;
}

.closing-node-graph {
    position: absolute;
    right: 10%;
    bottom: 10%;
    width: 200px;
    height: 200px;
    z-index: 2;
}

/* --- Gold Links --- */
.gold-link {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--gold-primary);
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
}

.gold-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--gold-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 250ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.gold-link:hover::after {
    transform: scaleX(1);
}

.gold-link:hover {
    color: var(--gold-bright);
}

/* --- Interactive Nodes --- */
.graph-node:hover,
.trace-node:hover {
    filter: drop-shadow(0 0 12px #e8c65a);
    cursor: pointer;
}

/* --- Prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    .slide-reveal-el {
        clip-path: none !important;
        transition: none !important;
    }

    .char {
        transform: none !important;
        transition: none !important;
    }

    .hero-tagline {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .trace-line {
        stroke-dashoffset: 0 !important;
        transition: none !important;
    }

    .trace-node {
        transform: scale(1) !important;
        transition: none !important;
    }

    .sparkline-path {
        stroke-dashoffset: 0 !important;
        transition: none !important;
    }

    .divider-line,
    .divider-branch {
        stroke-dashoffset: 0 !important;
        transition: none !important;
    }

    .divider-node {
        transform: scale(1) !important;
        transition: none !important;
    }

    .dot-matrix .dot {
        opacity: 1 !important;
        transition: none !important;
    }

    .trace-node.pulsing,
    .divider-node.glowing,
    .graph-node.pulsing,
    .graph-edge.flickering {
        animation: none !important;
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero-content {
        padding-left: 48px;
    }

    .asymmetric-split.left-heavy,
    .asymmetric-split.right-heavy {
        grid-template-columns: 1fr;
    }

    .stroke-content {
        padding: 0 24px;
    }

    .split-narrow {
        order: -1;
    }

    .closing-text {
        padding-left: 0;
    }

    .closing-node-graph {
        display: none;
    }

    h1 {
        font-size: clamp(48px, 12vw, 80px);
    }

    h2 {
        font-size: clamp(28px, 6vw, 44px);
    }

    .section-ring,
    .offset-ring {
        display: none;
    }
}

@media (max-width: 600px) {
    :root {
        --section-pad: 80px;
    }

    .hero-content {
        padding-left: 24px;
    }

    .stroke-content {
        padding: 0 16px;
    }

    .hero-ring {
        display: none;
    }
}
