/* ============================================================
   PONG — Retro Arcade Theme
   ============================================================ */

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

:root {
    --color-bg:        #080808;
    --color-bg-alt:    #0d0d0d;
    --color-primary:   #87ceeb; /* skyblue — matches the paddles */
    --color-accent:    #7ef8d0; /* mint green */
    --color-white:     #f0f0f0;
    --color-muted:     #555;
    --color-border:    #1e1e1e;
    --font-pixel:      'Press Start 2P', monospace;
    --font-mono:       'Share Tech Mono', monospace;
    --header-h:        64px;
    --section-pad:     5rem 1.5rem;
    --transition:      .25s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    background-color: var(--color-bg);
    color: var(--color-white);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.7;
    text-align: center;
    overflow-x: hidden;
}

/* Subtle CRT scanline overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,.08) 2px,
        rgba(0,0,0,.08) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-family: var(--font-pixel);
    letter-spacing: .05em;
}

p { max-width: 65ch; margin-inline: auto; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-accent); }

kbd {
    display: inline-block;
    padding: .1em .45em;
    border: 1px solid var(--color-primary);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: .85em;
    color: var(--color-primary);
    background: rgba(135,206,235,.07);
}

blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 1.2rem;
    margin: 1.5rem 0 0;
    font-style: italic;
    color: var(--color-white);
    text-align: left;
}
blockquote cite {
    display: block;
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--color-muted);
    font-style: normal;
}

/* ---------- Layout Helpers ---------- */
.section-inner {
    max-width: 1100px;
    margin-inline: auto;
}
.section-inner.narrow { max-width: 860px; }

.section {
    padding: var(--section-pad);
}
.section-dark { background-color: var(--color-bg-alt); }

.section-title {
    font-size: clamp(.75rem, 2.2vw, 1.1rem);
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 12px rgba(135,206,235,.45);
}

.section-subtitle {
    color: var(--color-muted);
    font-size: .95rem;
    margin-bottom: 2.5rem;
}

/* ---------- Glitch Effect (hero title) ---------- */
.glitch {
    position: relative;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: .7;
}
.glitch::before {
    color: #ff4d6d;
    clip-path: polygon(0 30%, 100% 30%, 100% 55%, 0 55%);
    animation: glitch-top 3.5s infinite linear;
}
.glitch::after {
    color: var(--color-accent);
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    animation: glitch-bot 4s infinite linear;
}
@keyframes glitch-top {
    0%,90%,100% { transform: translate(0); }
    92%          { transform: translate(-3px, 1px); }
    95%          { transform: translate(3px,-1px); }
}
@keyframes glitch-bot {
    0%,85%,100% { transform: translate(0); }
    87%         { transform: translate(3px, 1px); }
    91%         { transform: translate(-2px,-1px); }
}

/* ---------- Pong Divider (mimics in-game dashed line) ---------- */
.pong-divider {
    width: 5px;
    margin-inline: auto;
    height: 80px;
    background-image: repeating-linear-gradient(
        to bottom,
        var(--color-muted) 0px,
        var(--color-muted) 8px,
        transparent 8px,
        transparent 16px
    );
}

/* ============================================================
   HEADER
   ============================================================ */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(8,8,8,.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    height: 100%;
    margin-inline: auto;
    padding-inline: 1.5rem;
    gap: 1rem;
}

.logo {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    color: var(--color-white);
    white-space: nowrap;
}
.logo-dot { color: var(--color-primary); }

header nav ul {
    list-style: none;
    display: flex;
    gap: 1.8rem;
    flex-wrap: wrap;
}

header nav a {
    font-family: var(--font-pixel);
    font-size: .55rem;
    color: var(--color-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: color var(--transition), text-shadow var(--transition);
}
header nav a:hover {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(135,206,235,.6);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-muted);
    color: var(--color-white);
    font-size: 1.2rem;
    padding: .2rem .55rem;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1;
}

/* ============================================================
   PLAY SECTION
   ============================================================ */
.section-play {
    padding-top: calc(var(--section-pad) + 1rem);
}

.section-play .section-title {
    font-size: clamp(1rem, 4vw, 1.8rem);
    margin-bottom: .6rem;
}

.canvas-wrapper {
    display: inline-block;
    margin: 2rem 0 1.2rem;
    position: relative;
}

/* Glow around the canvas */
.canvas-wrapper::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 4px;
    box-shadow: 0 0 30px 4px rgba(135,206,235,.18);
    pointer-events: none;
}

#board {
    display: block;
    background-color: #000;
    border-top: 5px solid var(--color-primary);
    border-bottom: 5px solid var(--color-primary);
    box-shadow: 0 0 20px rgba(135,206,235,.3);
    max-width: 100%;
}

.controls-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: .8rem;
    color: var(--color-muted);
    flex-wrap: wrap;
}
.controls-hint .divider { color: var(--color-border); }

/* ============================================================
   HOW TO PLAY — Cards
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
    text-align: left;
}

.card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.6rem 1.4rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 16px rgba(135,206,235,.15);
}

.card-icon { font-size: 1.5rem; margin-bottom: .8rem; }

.card h3 {
    font-family: var(--font-pixel);
    font-size: .6rem;
    color: var(--color-primary);
    margin-bottom: .7rem;
    text-transform: uppercase;
}
.card p { font-size: .88rem; color: var(--color-white); max-width: unset; margin-inline: 0; }

/* ============================================================
   HISTORY — Timeline
   ============================================================ */
.timeline {
    position: relative;
    margin-top: 2.5rem;
    padding-left: 2rem;
    text-align: left;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-image: repeating-linear-gradient(
        to bottom,
        var(--color-primary) 0px,
        var(--color-primary) 8px,
        transparent 8px,
        transparent 18px
    );
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 1.4rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.3rem;
    top: .35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}

.timeline-year {
    font-family: var(--font-pixel);
    font-size: .6rem;
    color: var(--color-accent);
    display: block;
    margin-bottom: .4rem;
}

.timeline-content h3 {
    font-family: var(--font-pixel);
    font-size: .65rem;
    color: var(--color-primary);
    margin-bottom: .5rem;
}
.timeline-content p { font-size: .9rem; max-width: unset; margin-inline: 0; }

/* ============================================================
   IMPACT & LEGACY
   ============================================================ */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.impact-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-alt);
    transition: border-color var(--transition);
}
.impact-stat:hover { border-color: var(--color-accent); }

.impact-number {
    font-family: var(--font-pixel);
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--color-accent);
    text-shadow: 0 0 14px rgba(126,248,208,.4);
}

.impact-label { font-size: .82rem; color: var(--color-muted); }

.impact-text {
    font-size: .9rem;
    color: var(--color-white);
    line-height: 1.8;
}

/* ============================================================
   CREATOR
   ============================================================ */
.creator-card {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    text-align: left;
    align-items: flex-start;
    flex-wrap: wrap;
}

.creator-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-pixel);
    font-size: .75rem;
    color: var(--color-primary);
    background: rgba(135,206,235,.07);
    box-shadow: 0 0 16px rgba(135,206,235,.2);
}

.creator-info { flex: 1; min-width: 240px; }

.creator-info h3 {
    font-family: var(--font-pixel);
    font-size: .8rem;
    color: var(--color-primary);
    margin-bottom: .5rem;
}

.creator-tag {
    display: inline-block;
    font-size: .75rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.creator-info p {
    font-size: .9rem;
    margin-inline: 0;
    max-width: unset;
    margin-bottom: .8rem;
}

/* ============================================================
   SOCIAL LINKS
   ============================================================ */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 2.5rem;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 1.6rem 1.8rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-alt);
    color: var(--color-muted);
    font-family: var(--font-pixel);
    font-size: .5rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    min-width: 120px;
    transition: color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.social-link svg {
    width: 28px;
    height: 28px;
    transition: transform var(--transition);
}
.social-link:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 18px rgba(135,206,235,.18);
    transform: translateY(-3px);
}
.social-link:hover svg { transform: scale(1.15); }

/* Ko-fi gets a warm accent on hover */
.social-link--kofi:hover {
    color: #ff5e5b;
    border-color: #ff5e5b;
    box-shadow: 0 0 18px rgba(255,94,91,.2);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 1.5rem;
    background: var(--color-bg-alt);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
}

footer p { font-size: .85rem; color: var(--color-muted); }
footer a { color: var(--color-primary); }

.back-to-top {
    font-family: var(--font-pixel);
    font-size: .5rem;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    padding: .5rem 1rem;
    border-radius: 3px;
    transition: color var(--transition), border-color var(--transition);
}
.back-to-top:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    :root { --header-h: 56px; }

    .nav-toggle { display: block; }

    header nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: rgba(8,8,8,.97);
        border-bottom: 1px solid var(--color-border);
        padding: 1.2rem 1.5rem;
    }
    header nav.open { display: block; }

    header nav ul {
        flex-direction: column;
        gap: 1.2rem;
        align-items: flex-start;
    }

    header nav a { font-size: .62rem; }

    .creator-card { flex-direction: column; align-items: center; text-align: center; }
    blockquote { text-align: left; }

    .btn-primary { align-self: stretch; text-align: center; }

    .timeline { padding-left: 1.2rem; }
    .timeline-item { padding-left: .8rem; }
    .timeline-item::before { left: -1.5rem; }
}