/* ============================================
   ppuzzle.net - Political Puzzle Network
   Cyberpunk aesthetic with classical serif
   ============================================ */

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

:root {
    --void-black: #0D0D0D;
    --burnt-orange: #CC6600;
    --amber-glow: #E8A030;
    --terminal-green: #3D6B4F;
    --steel-gray: #2A2A2F;
    --bone-white: #E8E2D8;
    --ember-red: #B33D26;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-black);
    color: var(--bone-white);
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
}

h2 {
    font-size: clamp(28px, 4vw, 56px);
}

h3 {
    font-size: clamp(22px, 3vw, 36px);
}

.channel-label, .node-label {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#hero-wireframes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wireframe-polygon {
    position: absolute;
    opacity: 0;
}

.wp-1 {
    width: 280px;
    height: 280px;
    top: 10%;
    left: 15%;
    animation: rotatePolygon1 25s linear infinite;
}

.wp-2 {
    width: 350px;
    height: 350px;
    top: 20%;
    right: 10%;
    animation: rotatePolygon2 32s linear infinite;
}

.wp-3 {
    width: 200px;
    height: 200px;
    top: 55%;
    left: 8%;
    animation: rotatePolygon3 28s linear infinite;
}

.wp-4 {
    width: 300px;
    height: 300px;
    bottom: 10%;
    right: 20%;
    animation: rotatePolygon4 35s linear infinite;
}

.wp-5 {
    width: 160px;
    height: 160px;
    top: 5%;
    left: 55%;
    animation: rotatePolygon5 22s linear infinite;
}

.wp-6 {
    width: 240px;
    height: 240px;
    bottom: 25%;
    left: 35%;
    animation: rotatePolygon6 30s linear infinite;
}

.wp-7 {
    width: 180px;
    height: 180px;
    top: 40%;
    right: 30%;
    animation: rotatePolygon7 40s linear infinite;
}

.wireframe-polygon.visible {
    opacity: 0.6;
    transition: opacity 0.6s ease;
}

@keyframes rotatePolygon1 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotatePolygon2 { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes rotatePolygon3 { from { transform: rotate(45deg); } to { transform: rotate(405deg); } }
@keyframes rotatePolygon4 { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes rotatePolygon5 { from { transform: rotate(20deg); } to { transform: rotate(380deg); } }
@keyframes rotatePolygon6 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotatePolygon7 { from { transform: rotate(-30deg); } to { transform: rotate(-390deg); } }

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}

#hero-wordmark {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    color: var(--bone-white);
    letter-spacing: 0.05em;
    text-shadow: 0 0 40px rgba(204, 102, 0, 0.3);
    opacity: 0;
    transform: translateY(60px);
}

#hero-wordmark.bounce-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#hero-subtitle {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(18px, 2.5vw, 28px);
    color: var(--amber-glow);
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#hero-subtitle.visible {
    opacity: 1;
}

/* --- Data Streams Section --- */
#data-streams {
    padding: 80px 0;
}

.data-channel {
    position: relative;
    padding: 40px 60px 40px 40px;
    margin: 0 auto;
    max-width: 900px;
    border-left: 3px solid transparent;
    margin-bottom: 40px;
}

.data-channel .channel-border-anim {
    position: absolute;
    top: 0;
    left: -3px;
    width: 3px;
    height: 100%;
    background-color: var(--burnt-orange);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.6s ease;
}

.data-channel.in-view .channel-border-anim {
    transform: scaleY(1);
}

.data-channel .channel-label {
    display: block;
    color: var(--burnt-orange);
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 0.5s ease 0.6s;
}

.data-channel.in-view .channel-label {
    opacity: 1;
}

.channel-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.8s, transform 0.5s ease 0.8s;
}

.data-channel.in-view .channel-content {
    opacity: 1;
    transform: translateY(0);
}

.channel-content h2 {
    font-size: clamp(24px, 3.5vw, 42px);
    color: var(--bone-white);
    margin-bottom: 16px;
}

.channel-content p {
    color: rgba(232, 226, 216, 0.8);
    max-width: 720px;
}

/* --- Analysis Grid Section --- */
#analysis-grid {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-heading {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: var(--burnt-orange);
    margin-bottom: 48px;
    text-transform: uppercase;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.analysis-card {
    position: relative;
    background-color: var(--steel-gray);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
}

.analysis-card.bounce-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 0 rgba(204, 102, 0, 0);
    animation: glowPulse 0.6s ease forwards;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 0 rgba(204, 102, 0, 0); }
    50% { box-shadow: 0 0 20px rgba(204, 102, 0, 0.3); }
    100% { box-shadow: 0 0 0 rgba(204, 102, 0, 0); }
}

.card-header-illustration {
    width: 100%;
    padding: 20px;
    background-color: rgba(13, 13, 13, 0.5);
}

.card-header-illustration svg {
    width: 100%;
    height: 80px;
}

.card-body {
    padding: 24px 28px 32px;
}

.card-body h3 {
    font-size: clamp(20px, 2.5vw, 30px);
    color: var(--bone-white);
    margin-bottom: 12px;
}

.card-body p {
    color: rgba(232, 226, 216, 0.75);
    font-size: clamp(14px, 1.3vw, 16px);
    line-height: 1.7;
}

/* Vine decoration */
.vine-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
}

.vine-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.analysis-card.bounce-in .vine-path {
    animation: vineGrow 2s ease forwards 0.3s;
}

@keyframes vineGrow {
    to { stroke-dashoffset: 0; }
}

.vine-leaf {
    transform: scale(0);
    transform-origin: center;
}

.analysis-card.bounce-in .vine-leaf:nth-child(2) {
    animation: leafGrow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.2s;
}

.analysis-card.bounce-in .vine-leaf:nth-child(3) {
    animation: leafGrow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.6s;
}

.analysis-card.bounce-in .vine-leaf:nth-child(4) {
    animation: leafGrow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 2.0s;
}

@keyframes leafGrow {
    to { transform: scale(1); }
}

/* --- Network Footer --- */
#network-footer {
    padding: 80px 40px 40px;
    text-align: center;
    background-color: var(--void-black);
}

#network-map {
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 0 auto 40px;
    display: block;
}

.network-node circle {
    cursor: pointer;
    transition: fill 0.3s ease, filter 0.3s ease;
}

.network-node text.node-label {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.network-node.highlighted circle {
    fill: var(--amber-glow);
    filter: drop-shadow(0 0 8px rgba(204, 102, 0, 0.6));
}

.network-node.dimmed circle {
    fill: var(--steel-gray);
}

.network-node.dimmed text {
    opacity: 0.2;
}

#network-lines line {
    transition: opacity 0.3s ease, stroke 0.3s ease;
}

#network-lines line.highlighted {
    opacity: 1;
    stroke: var(--amber-glow);
    stroke-width: 2;
}

#network-lines line.dimmed {
    opacity: 0.1;
}

#footer-info {
    padding-top: 40px;
    border-top: 1px solid rgba(204, 102, 0, 0.2);
}

#footer-info .channel-label {
    color: rgba(204, 102, 0, 0.5);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .data-channel {
        padding: 30px 20px 30px 24px;
    }

    #analysis-grid {
        padding: 60px 20px;
    }

    .wp-1, .wp-2, .wp-3, .wp-4, .wp-5, .wp-6, .wp-7 {
        width: 120px;
        height: 120px;
    }

    #network-footer {
        padding: 60px 20px 30px;
    }
}
