/* ==============================================
   rational.quest -- Graffiti-Tech Hexagonal Network
   ============================================== */

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

:root {
    --white: #FFFFFF;
    --black: #000000;
    --red: #FF0000;
    --gray: #555555;
    --light-gray: #F0F0F0;
    --charcoal: #1A1A1A;
    --font-display: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
    color: var(--gray);
    background-color: var(--white);
    overflow-x: hidden;
}

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

.hero-circuit-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.circuit-svg {
    width: 100%;
    height: 100%;
}

.circuit-line {
    stroke: var(--light-gray);
    stroke-width: 1;
    fill: none;
}

.circuit-node {
    fill: var(--red);
    opacity: 0.6;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--gray);
    display: block;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--black);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.accent {
    color: var(--red);
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-data-readout {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.readout-item {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--gray);
    letter-spacing: 0.15em;
    opacity: 0.7;
}

.hero-graffiti-mark {
    position: absolute;
    bottom: 60px;
    right: 80px;
    width: 120px;
    height: 120px;
    border: 3px solid var(--red);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0.15;
    z-index: 1;
}

/* --- Honeycomb Grid Section --- */
#honeycomb-grid {
    padding: 6rem 2rem;
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--red);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--black);
}

/* Hexagonal Grid */
.hex-grid {
    max-width: 1100px;
    margin: 0 auto;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: -40px;
}

.hex-row-offset {
    transform: translateX(calc(130px / 2 + 6px));
}

.hex-cell {
    width: 240px;
    height: 270px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--light-gray);
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    position: relative;
}

.hex-cell:hover {
    transform: translateY(-8px);
}

.hex-cell[data-featured="true"] {
    background: var(--black);
}

.hex-cell[data-featured="true"] .hex-inner {
    color: var(--white);
}

.hex-cell[data-featured="true"] .hex-title {
    color: var(--white);
}

.hex-cell[data-featured="true"] .hex-body {
    color: rgba(255, 255, 255, 0.7);
}

.hex-cell[data-featured="true"] .hex-label {
    color: var(--red);
}

.hex-cell[data-featured="true"] .hex-tag {
    color: var(--red);
}

.hex-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 50px 24px 40px;
    position: relative;
    overflow: hidden;
}

.hex-lens-flare {
    position: absolute;
    top: -30%;
    right: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(ellipse at 70% 30%, rgba(255, 0, 0, 0.12) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.hex-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--gray);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.hex-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.hex-body {
    font-family: var(--font-body);
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--gray);
    position: relative;
    z-index: 1;
}

.hex-tag {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--red);
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Progressive disclosure */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.hex-row-offset .reveal.visible {
    transform: translateX(0) translateY(0);
}

/* --- Manifesto Section --- */
#manifesto {
    padding: 6rem 2rem;
    background: var(--light-gray);
    position: relative;
}

.manifesto-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.manifesto-circuit-border {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--black), transparent);
}

.manifesto-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--black);
    margin-bottom: 3rem;
    text-align: center;
}

.manifesto-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.manifesto-block {
    background: var(--white);
    padding: 2.5rem;
    border: 1px solid var(--black);
    position: relative;
}

.manifesto-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--red);
}

.block-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--light-gray);
    position: absolute;
    top: 10px;
    right: 20px;
    line-height: 1;
}

.manifesto-block h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.75rem;
}

.manifesto-block p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--gray);
}

/* --- Terminal Section --- */
#terminal {
    padding: 6rem 2rem;
    background: var(--white);
}

.terminal-window {
    max-width: 750px;
    margin: 0 auto;
    background: var(--charcoal);
    border: 1px solid var(--black);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--black);
    border-bottom: 1px solid #333;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: var(--red); }
.dot-yellow { background: #FFCC00; }
.dot-green { background: #00CC00; }

.terminal-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--gray);
    letter-spacing: 0.1em;
    margin-left: auto;
}

.terminal-body {
    padding: 1.5rem;
}

.terminal-line {
    font-family: var(--font-display);
    font-size: 0.8rem;
    line-height: 2;
    color: var(--light-gray);
}

.terminal-line.output {
    color: var(--gray);
    padding-left: 1.5rem;
}

.prompt {
    color: var(--red);
    margin-right: 0.5rem;
}

.cursor-blink .prompt {
    color: var(--red);
}

.cursor-blink::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: var(--red);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

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

/* --- Footer --- */
#footer {
    background: var(--charcoal);
    padding: 4rem 2rem 2rem;
    position: relative;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.footer-circuit-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
    opacity: 0.3;
}

.circuit-svg-footer {
    width: 100%;
    height: 100%;
}

.circuit-line-light {
    stroke: var(--gray);
    stroke-width: 1;
    fill: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.footer-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--red);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-domain,
.footer-status,
.footer-protocol {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    position: relative;
    z-index: 1;
}

.footer-graffiti-tag {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red);
    opacity: 0.4;
}

.footer-copyright {
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--gray);
    letter-spacing: 0.15em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .hex-row {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: -20px;
    }

    .hex-row-offset {
        transform: translateX(0);
    }

    .hex-cell {
        width: 180px;
        height: 200px;
    }

    .hex-inner {
        padding: 35px 16px 30px;
    }

    .hex-body {
        font-size: 0.65rem;
    }

    .manifesto-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-data-readout {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .hex-row {
        flex-direction: column;
        align-items: center;
        margin-bottom: 0;
    }

    .hex-row-offset {
        transform: none;
    }

    .hex-cell {
        width: 260px;
        height: 290px;
        margin-bottom: -30px;
    }

    .hex-inner {
        padding: 50px 24px 40px;
    }

    .hero-graffiti-mark {
        bottom: 30px;
        right: 30px;
        width: 80px;
        height: 80px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
