/* Rationale One — RE-Meta Style (teal/amber) */

:root {
    --graphite: #0F1418;
    --teal-deep: #0C2D35;
    --teal-wire: #29B6C8;
    --mint: #6DE2CE;
    --gold: #F7C14B;
    --amber: #FF9F45;
    --fog: #B9C4C7;
    --sepia: #B08A5A;

    --bg-dark: var(--graphite);
    --bg-card: var(--teal-deep);
    --text-primary: var(--fog);
    --text-secondary: rgba(185, 196, 199, 0.7);
    --accent: var(--teal-wire);
    --highlight: var(--gold);
    --glow-teal: rgba(41, 182, 200, 0.3);
    --glow-amber: rgba(247, 193, 75, 0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.7;
    font-size: 14px;
    letter-spacing: 0.01em;
}

/* Canvas Background */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at center, var(--teal-deep) 0%, var(--graphite) 100%);
}

/* XOR Pattern Overlay */
#xorPattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#xorPattern.active {
    opacity: 0.08;
    animation: patternPulse 6s ease-in-out infinite;
}

@keyframes patternPulse {
    0%, 100% { opacity: 0.06; }
    50% { opacity: 0.1; }
}

/* Container */
.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(41, 182, 200, 0.15);
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 8px var(--glow-amber));
}

.logo-symbol {
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 12px var(--glow-amber);
    animation: rotateLogo 12s linear infinite;
}

@keyframes rotateLogo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo h1 {
    font-size: 20px;
    font-weight: 400;
    color: var(--fog);
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

nav {
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

nav a:hover {
    color: var(--accent);
    text-shadow: 0 0 8px var(--glow-teal);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 50px;
    margin-bottom: 60px;
}

.glitch {
    font-size: 36px;
    font-weight: 300;
    text-transform: lowercase;
    position: relative;
    display: inline-block;
    color: var(--fog);
    text-shadow: 0 0 20px var(--glow-teal);
    letter-spacing: 0.08em;
}

@keyframes glitchAnimation {
    0%, 97%, 100% {
        transform: translate(0);
    }
    98% {
        transform: translate(-1px, 1px);
    }
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 16px 0 12px;
    letter-spacing: 0.04em;
    font-weight: 300;
}

.philosophy {
    font-size: 12px;
    color: var(--gold);
    margin: 0 0 32px;
    letter-spacing: 0.06em;
    font-weight: 300;
    font-style: italic;
    opacity: 0.8;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.btn-primary, .btn-secondary {
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 400;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    background: transparent;
}

.btn-primary {
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-primary:hover {
    background: rgba(247, 193, 75, 0.1);
    box-shadow: 0 0 16px var(--glow-amber);
}

.btn-secondary {
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: rgba(41, 182, 200, 0.1);
    box-shadow: 0 0 16px var(--glow-teal);
}

/* Sections */
.section {
    margin-bottom: 70px;
    padding: 32px;
    background: rgba(12, 45, 53, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(41, 182, 200, 0.12);
    backdrop-filter: blur(8px);
}

.section h3 {
    font-size: 16px;
    font-weight: 300;
    margin-bottom: 32px;
    text-align: left;
    color: var(--fog);
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.card {
    background: rgba(12, 45, 53, 0.5);
    padding: 24px;
    border-radius: 3px;
    border: 1px solid rgba(41, 182, 200, 0.2);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(41, 182, 200, 0.4);
    box-shadow: 0 8px 24px var(--glow-teal);
}

.card-icon {
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 16px;
    text-shadow: 0 0 12px var(--glow-amber);
    opacity: 0.9;
}

.card h4 {
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--fog);
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 13px;
}

/* Topology Section */
.topology-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Minimal stats in corner */
.stats-minimal {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    opacity: 0.5;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
    margin-top: 16px;
}

.stats-minimal span {
    color: var(--accent);
}

.topology-controls {
    background: rgba(12, 45, 53, 0.4);
    padding: 18px;
    border-radius: 3px;
    border: 1px solid rgba(41, 182, 200, 0.15);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.topology-controls label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.topology-controls input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(41, 182, 200, 0.15);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.topology-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--glow-teal);
}

.topology-controls input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--glow-teal);
}

/* XOR Demo Section */
.xor-demo {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.xor-input-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.xor-input-group input {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    background: rgba(12, 45, 53, 0.5);
    border: 1px solid rgba(41, 182, 200, 0.25);
    border-radius: 3px;
    color: var(--fog);
    font-size: 14px;
    transition: all 0.3s ease;
}

.xor-input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--glow-teal);
}

.xor-operator {
    font-size: 24px;
    color: var(--gold);
    font-weight: 400;
    text-shadow: 0 0 12px var(--glow-amber);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}

.xor-output {
    background: rgba(12, 45, 53, 0.5);
    padding: 20px;
    border-radius: 3px;
    border: 1px solid rgba(247, 193, 75, 0.2);
}

.xor-label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 12px;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.xor-result-display {
    font-size: 18px;
    color: var(--gold);
    font-family: 'Courier New', monospace;
    min-height: 32px;
    word-wrap: break-word;
    text-shadow: 0 0 10px var(--glow-amber);
}

.unicode-patterns {
    background: rgba(12, 45, 53, 0.4);
    padding: 20px;
    border-radius: 3px;
    border: 1px solid rgba(41, 182, 200, 0.15);
}

.unicode-patterns h4 {
    margin-bottom: 16px;
    color: var(--fog);
    font-size: 13px;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.pattern-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 16px;
    background: rgba(41, 182, 200, 0.08);
    border: 1px solid rgba(41, 182, 200, 0.25);
    border-radius: 2px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    text-transform: lowercase;
}

.chip:hover {
    background: rgba(41, 182, 200, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--glow-teal);
    transform: translateY(-1px);
}

/* Story Section - The Crossing */
.story-container {
    background: rgba(12, 45, 53, 0.3);
    padding: 32px;
    border-radius: 3px;
    border: 1px solid rgba(247, 193, 75, 0.15);
    margin-top: 24px;
}

.story-text {
    max-width: 720px;
    margin: 0 auto;
}

.story-text p {
    color: var(--fog);
    font-size: 13px;
    line-height: 1.9;
    margin-bottom: 20px;
    text-align: justify;
    font-weight: 300;
}

.story-text p:first-child::first-letter {
    font-size: 2.5em;
    float: left;
    line-height: 1;
    margin-right: 8px;
    color: var(--gold);
    font-weight: 400;
}

.story-ending {
    font-style: italic;
    color: var(--gold) !important;
    opacity: 0.9;
}

.story-caption {
    text-align: center;
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 24px;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

/* Coming Soon Section */
.coming-soon {
    text-align: center;
    padding: 48px 24px;
    background: rgba(12, 45, 53, 0.2);
    border-radius: 3px;
    border: 1px dashed rgba(41, 182, 200, 0.2);
    margin-top: 24px;
}

.artifact-description {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    margin-bottom: 20px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.artifact-symbols {
    color: var(--gold);
    font-size: 24px;
    letter-spacing: 12px;
    opacity: 0.6;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.contact-card {
    background: rgba(12, 45, 53, 0.4);
    padding: 24px;
    border-radius: 3px;
    border: 1px solid rgba(41, 182, 200, 0.15);
    text-align: center;
    transition: all 0.4s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    border-color: rgba(41, 182, 200, 0.3);
    box-shadow: 0 8px 24px var(--glow-teal);
}

.contact-icon {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--accent);
    text-shadow: 0 0 10px var(--glow-teal);
    opacity: 0.9;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 13px;
}

.contact-link {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.contact-link:hover {
    color: var(--fog);
    text-shadow: 0 0 8px var(--glow-teal);
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.contact-link:hover::after {
    width: 100%;
}

/* Footer */
footer {
    text-align: center;
    padding: 32px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(41, 182, 200, 0.1);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 11px;
    margin: 8px 0;
    letter-spacing: 0.05em;
}

.footer-philosophy {
    font-size: 10px;
    color: var(--gold);
    opacity: 0.5;
    letter-spacing: 0.08em;
    margin-top: 8px;
    font-weight: 300;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }

    .logo h1 {
        font-size: 18px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    nav a {
        font-size: 12px;
    }

    .glitch {
        font-size: 28px;
    }

    .subtitle {
        font-size: 13px;
    }

    .cta-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .xor-input-group {
        flex-direction: column;
    }

    .section {
        padding: 20px;
        margin-bottom: 50px;
    }

    .section h3 {
        font-size: 15px;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    animation: fadeIn 0.8s ease-out;
}
