/* ============================================
   PINGPONG4D — Main Stylesheet
   Mobile-first | Performance optimized
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0A0A0F;
    --white: #111118;
    --primary: #FFFFFF;
    --accent: #A855F7;
    --accent-hover: #9333EA;
    --secondary: #F59E0B;
    --text: #D1D5DB;
    --muted: #9CA3AF;
    --border: #1E1E2E;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max-w: 1120px;
    --header-h: 64px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Gold link variant */
.gold {
    color: var(--secondary);
}
.gold:hover {
    color: #D97706;
}

ul {
    list-style: none;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover {
    color: var(--primary);
}

.logo-icon {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.logo-img:hover {
    opacity: 0.85;
}

.logo-text {
    letter-spacing: 0.04em;
}

/* Desktop Nav */
.main-nav {
    display: none;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 4px 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.hamburger.open .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.open .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.main-nav.open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.main-nav.open .nav-list {
    flex-direction: column;
    gap: 24px;
}

.main-nav.open .nav-link {
    font-size: 20px;
    color: var(--primary);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-h) + 40px) 20px 60px;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(245, 158, 11, 0.05) 40%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero-title {
    font-size: clamp(40px, 10vw, 72px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.hero-tagline {
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.hero-desc {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.75;
    max-width: 560px;
    margin: 0 auto 36px;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    min-height: 48px;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
    width: 100%;
    max-width: 320px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 320px;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(168, 85, 247, 0.08);
}

/* --- Features --- */
.features {
    padding: 0 20px 80px;
    margin-top: -20px;
    position: relative;
    z-index: 2;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.05);
}

.feature-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-sm);
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.feature-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.65;
}

/* --- Sections --- */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    border-radius: 2px;
    margin: 0 auto;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.section-content {
    max-width: 760px;
    margin: 0 auto;
}

.section-content p {
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.8;
}

.section-content p:last-child {
    margin-bottom: 0;
}

/* --- Info Grid --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 760px;
    margin: 0 auto;
}

.info-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.04);
}

.info-card:hover {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: var(--shadow-md);
}

.info-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.info-card p {
    font-size: 15px;
    color: var(--text);
    line-height: 1.75;
}

.info-card-full {
    grid-column: 1 / -1;
}

/* --- Timeline --- */
.timeline {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    padding-left: 48px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding-bottom: 40px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -48px;
    top: 2px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(168, 85, 247, 0.5);
    flex-shrink: 0;
}

.timeline-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: var(--shadow-md);
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.timeline-content p {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
}

/* --- FAQ --- */
.faq-list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.faq-item[open] {
    border-color: rgba(168, 85, 247, 0.4);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    gap: 16px;
    transition: color 0.2s ease;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--bg);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.faq-item[open] .faq-question::after {
    transform: rotate(180deg);
}

.faq-question:hover {
    color: var(--accent);
}

.faq-answer a {
    color: var(--secondary);
}

.faq-answer {
    padding: 0 20px 18px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.75;
}

/* --- Footer --- */
.site-footer {
    background: #050508;
    color: rgba(255,255,255,0.7);
    padding: 60px 0 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-brand .logo-text {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.65;
    max-width: 320px;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.footer-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a {
    color: rgba(168, 85, 247, 0.7);
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    margin-top: 20px;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    text-align: center;
}

/* --- Focus states (accessibility) --- */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE — Tablet (640px+)
   ============================================ */
@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-card-full {
        grid-column: 1 / -1;
    }

    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }

    .btn {
        width: auto;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ============================================
   RESPONSIVE — Desktop (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    :root {
        --header-h: 72px;
    }

    .hamburger {
        display: none;
    }

    .main-nav {
        display: flex;
    }

    .hero {
        padding-top: calc(var(--header-h) + 60px);
        padding-bottom: 80px;
    }

    .hero-glow {
        width: 800px;
        height: 800px;
    }

    .section {
        padding: 100px 0;
    }

    .features {
        padding-bottom: 100px;
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .feature-card {
        padding: 32px 24px;
    }

    .info-card {
        padding: 32px 28px;
    }

    .timeline-content {
        padding: 28px;
    }

    .faq-question {
        padding: 20px 24px;
        font-size: 16px;
    }

    .faq-answer {
        padding: 0 24px 20px;
        font-size: 15px;
    }

    .footer-inner {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 48px;
    }

    .footer-brand {
        flex: 1 1 280px;
    }

    .footer-links {
        flex: 1 1 400px;
    }
}