/* ========================================
   CSS Variables & Base Styles
   ======================================== */
:root {
    /* Colors - Amber/Orange Theme */
    --color-primary: #f59e0b;
    --color-primary-light: #fbbf24;
    --color-primary-dark: #d97706;
    
    --color-bg: #0a0a0b;
    --color-bg-secondary: #111113;
    --color-bg-card: #18181b;
    --color-bg-code: #1e1e22;
    
    --color-text: #fafafa;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;
    
    --color-border: #27272a;
    --color-border-light: #3f3f46;
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #0a0a0b 0%, #18181b 50%, #1f1f23 100%);
    --gradient-card: linear-gradient(145deg, #1a1a1e 0%, #18181b 100%);
    --gradient-glow: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.15), transparent);
    
    /* Typography */
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --container-width: 1200px;
    --section-padding: 100px;
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(245, 158, 11, 0.2);
    
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ========================================
   Container
   ======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.nav-logo:hover {
    color: var(--color-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-menu a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.nav-menu a:hover {
    color: var(--color-text);
}

.nav-menu a:hover::after {
    width: 100%;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.hero-content {
    position: relative;
    text-align: center;
    padding: 0 24px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #000;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-light);
}

.btn-secondary:hover {
    background: var(--color-bg-card);
    border-color: var(--color-primary);
}

/* ========================================
   Section Styles
   ======================================== */
section {
    padding: var(--section-padding) 0;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-desc {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* ========================================
   Playground Section
   ======================================== */
.playground {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.playground-container {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.playground-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    background: var(--color-bg);
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 16px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-text-secondary);
    background: var(--color-bg-card);
}

.tab-btn.active {
    color: var(--color-primary);
    background: var(--color-bg-card);
}

.tab-btn.active::after {
    background: var(--color-primary);
}

.playground-content {
    padding: 0;
}

.code-panel {
    position: relative;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.code-lang {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    font-size: 0.8rem;
    padding: 6px 14px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.copy-btn.copied {
    background: var(--color-primary);
    color: #000;
    border-color: var(--color-primary);
}

.code-block {
    margin: 0;
    padding: 24px;
    background: var(--color-bg-code);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.code-block code {
    font-family: inherit;
}

/* ========================================
   Documentation Section
   ======================================== */
.docs {
    background: var(--color-bg);
}

.docs-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    align-items: start;
}

@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-sidebar {
        display: none;
    }
}

.docs-sidebar {
    position: sticky;
    top: 88px;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--color-border);
}

.docs-sidebar h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.toc-group {
    margin-bottom: 24px;
}

.toc-group:last-child {
    margin-bottom: 0;
}

.toc-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--color-primary);
}

.toc-group ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toc-group a {
    display: block;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toc-group a:hover {
    color: var(--color-primary);
    background: rgba(245, 158, 11, 0.1);
}

.docs-content {
    min-width: 0;
}

.docs-section {
    margin-bottom: 64px;
}

.docs-section:last-child {
    margin-bottom: 0;
}

.docs-section > h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.func-doc {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
    transition: border-color var(--transition-base);
}

.func-doc:hover {
    border-color: var(--color-border-light);
}

.func-doc:last-child {
    margin-bottom: 0;
}

.func-doc h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    font-family: var(--font-mono);
}

.func-desc {
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.func-doc .code-block {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* ========================================
   Installation Section
   ======================================== */
.installation {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.install-steps {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.install-step {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #000;
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: 50%;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.step-content .code-block {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* ========================================
   Single Table Design Section
   ======================================== */
.single-table {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.design-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.design-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.design-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.design-card h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.design-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.design-card code {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-primary);
    background: rgba(245, 158, 11, 0.1);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.design-example {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--color-border);
}

.design-example h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.design-example .code-block {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 48px 0;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-links .divider {
    color: var(--color-text-muted);
}

/* ========================================
   Syntax Highlighting (Basic)
   ======================================== */
.code-block .keyword {
    color: #c678dd;
}

.code-block .string {
    color: #98c379;
}

.code-block .comment {
    color: #5c6370;
    font-style: italic;
}

.code-block .function {
    color: #61afef;
}

.code-block .type {
    color: #e5c07b;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    :root {
        --section-padding: 64px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .install-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.docs-section,
.design-card,
.install-step {
    animation: fadeIn 0.6s ease-out;
}

/* Staggered animation for cards */
.design-card:nth-child(1) { animation-delay: 0.1s; }
.design-card:nth-child(2) { animation-delay: 0.2s; }
.design-card:nth-child(3) { animation-delay: 0.3s; }
.design-card:nth-child(4) { animation-delay: 0.4s; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

