/* ============================================================
   Cumba Data Viewer - Main Stylesheet
   Aesthetic: Refined dark / editorial / precision-instrument
   ============================================================ */

:root {
    --bg-base:      #0a0c10;
    --bg-surface:   #111318;
    --bg-elevated:  #181c24;
    --bg-card:      #1a1f2b;

    --border:       rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.15);

    --text-primary: #eef0f4;
    --text-secondary: #8b90a0;
    --text-muted:   #555c70;

    --accent:       #3d9cf5;
    --accent-glow:  rgba(61,156,245,0.15);
    --accent-2:     #0fd6a4;

    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'Outfit', system-ui, sans-serif;
    --font-mono:    'DM Mono', 'Courier New', monospace;

    --radius-sm:    6px;
    --radius-md:    12px;
    --radius-lg:    20px;

    --shadow-card:  0 1px 3px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.3);
    --shadow-glow:  0 0 40px rgba(61,156,245,0.12);
}

/* ============================================================ Light Mode Variables */
:root.light {
    --bg-base:       #f5f6f8;
    --bg-surface:    #ffffff;
    --bg-elevated:   #eef0f4;
    --bg-card:       #ffffff;

    --border:        rgba(0,0,0,0.08);
    --border-hover:  rgba(0,0,0,0.18);

    --text-primary:  #0f1117;
    --text-secondary:#4a5068;
    --text-muted:    #9099b0;

    --accent:        #1a7fd4;
    --accent-glow:   rgba(26,127,212,0.12);
    --accent-2:      #0aad85;

    --shadow-card:   0 1px 3px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.08);
    --shadow-glow:   0 0 40px rgba(26,127,212,0.10);
}

/* Respect system preference as default when no manual override is set */
@media (prefers-color-scheme: light) {
    :root:not(.dark) {
        --bg-base:       #f5f6f8;
        --bg-surface:    #ffffff;
        --bg-elevated:   #eef0f4;
        --bg-card:       #ffffff;

        --border:        rgba(0,0,0,0.08);
        --border-hover:  rgba(0,0,0,0.18);

        --text-primary:  #0f1117;
        --text-secondary:#4a5068;
        --text-muted:    #9099b0;

        --accent:        #1a7fd4;
        --accent-glow:   rgba(26,127,212,0.12);
        --accent-2:      #0aad85;

        --shadow-card:   0 1px 3px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.08);
        --shadow-glow:   0 0 40px rgba(26,127,212,0.10);
    }
}

/* Smooth theme transition */
*, *::before, *::after {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================================ Layout */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================ Typography */
h1, h2, h3 { line-height: 1.15; }

em { font-style: italic; color: var(--accent); }

/* ============================================================ Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(61,156,245,0);
}
.btn-primary:hover {
    background: #5aaeff;
    box-shadow: 0 0 24px rgba(61,156,245,0.35);
    transform: translateY(-1px);
}

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

.btn-full { width: 100%; justify-content: center; }

/* ============================================================ Navigation */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: background 0.25s ease;
}
:root.light .nav { background: rgba(245, 246, 248, 0.88); }
@media (prefers-color-scheme: light) {
    :root:not(.dark) .nav { background: rgba(245, 246, 248, 0.88); }
}

/* ============================================================ Theme Toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s, transform 0.3s;
}
.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: rotate(25deg);
}

.nav-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-mark {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 17px;
    color: #fff;
    font-weight: 700;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text-primary);
}
.logo-accent { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
    margin-left: auto;
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    flex-shrink: 0;
}
.nav-cta:hover {
    background: var(--accent);
    color: #fff;
}

/* ============================================================ Hero */
.hero {
    position: relative;
    padding: 160px 0 100px;
    overflow: hidden;
}

/* Background grid */
.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
:root.light .hero-grid { background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px); }
@media (prefers-color-scheme: light) { :root:not(.dark) .hero-grid { background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px); } }

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.hero-orb-1 {
    width: 600px; height: 600px;
    top: -200px; left: -100px;
    background: radial-gradient(circle, rgba(61,156,245,0.12) 0%, transparent 70%);
}
.hero-orb-2 {
    width: 400px; height: 400px;
    top: 100px; right: -100px;
    background: radial-gradient(circle, rgba(15,214,164,0.08) 0%, transparent 70%);
}

.hero .container { position: relative; z-index: 1; }

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(61,156,245,0.1);
    border: 1px solid rgba(61,156,245,0.25);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 28px;
    animation: fadeSlideUp 0.6s ease both;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(42px, 6vw, 76px);
    color: var(--text-primary);
    margin-bottom: 24px;
    animation: fadeSlideUp 0.6s ease 0.1s both;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.7;
    margin-bottom: 40px;
    animation: fadeSlideUp 0.6s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
    animation: fadeSlideUp 0.6s ease 0.3s both;
}

.hero-formats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    animation: fadeSlideUp 0.6s ease 0.4s both;
}

.format-tag {
    padding: 5px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* Screenshot placeholder */
.hero-screenshot-wrap {
    display: flex;
    justify-content: center;
    margin-top: 72px;
    padding: 0 24px;
    animation: fadeSlideUp 0.8s ease 0.5s both;
}

.hero-screenshot-frame {
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    overflow: hidden;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    position: relative;
}
.hero-screenshot-frame::before {
    content: '';
    display: block;
    height: 32px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    /* fake traffic lights */
    background: var(--bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32'%3E%3Ccircle cx='16' cy='16' r='5' fill='%23ff5f57'/%3E%3Ccircle cx='30' cy='16' r='5' fill='%23febc2e'/%3E%3Ccircle cx='44' cy='16' r='5' fill='%2328c840'/%3E%3C/svg%3E") no-repeat left center;
}

.screenshot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 420px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-mono);
    border: 2px dashed var(--border);
    margin: 20px;
    border-radius: var(--radius-md);
}
.placeholder-icon { font-size: 32px; }

/* ============================================================ Stats Bar */
.stats-bar {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 32px 0;
}

.stats-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 48px;
    gap: 4px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--text-primary);
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* ============================================================ Section shared */
.section-header {
    text-align: center;
    margin-bottom: 64px;
}
.section-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(61,156,245,0.08);
    border: 1px solid rgba(61,156,245,0.2);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    color: var(--text-primary);
    margin-bottom: 16px;
}
.section-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
}

/* ============================================================ Features */
.features {
    padding: 120px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}
.feature-card:hover::after { opacity: 1; }

.feature-card--large {
    grid-column: span 2;
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}
.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    position: relative;
    z-index: 1;
}
.feature-detail {
    margin-top: 16px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-2);
    display: inline-block;
    position: relative;
    z-index: 1;
}
.feature-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px 24px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}
.feature-list li {
    padding-left: 18px;
    position: relative;
}
.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-2);
    font-weight: 600;
}
.feature-list--two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) {
    .feature-list--two-col { grid-template-columns: 1fr; }
}

/* ============================================================ Formats */
.formats-section {
    padding: 80px 0 120px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.format-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: all 0.2s;
}
.format-card:hover {
    border-color: var(--accent);
    background: var(--bg-elevated);
}
.format-name {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.format-desc {
    font-size: 13px;
    color: var(--text-muted);
}
.format-card--soon {
    border-style: dashed;
    opacity: 0.6;
}
.format-card--soon .format-name { color: var(--text-muted); }

/* ============================================================ Gallery */
.gallery-section {
    padding: 120px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

.gallery-item--main {
    grid-row: span 2;
}

.screenshot-placeholder--dark {
    background: var(--bg-elevated);
    border-color: var(--border);
    border-radius: var(--radius-md);
    height: 100%;
    min-height: 260px;
}

/* ============================================================ Feedback */
.feedback-section {
    padding: 120px 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.feedback-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.feedback-info p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 32px;
    margin-top: 16px;
}

.contact-points {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.contact-point {
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.contact-point::before {
    color: var(--accent-2);
}

/* Form */
.feedback-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.form-group input,
.form-group textarea {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.2s;
    width: 100%;
    resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group--error input,
.form-group--error textarea {
    border-color: #e05c5c;
}
.field-error {
    font-size: 12px;
    color: #e05c5c;
    font-family: var(--font-mono);
}

/* Success state */
.form-success {
    text-align: center;
    padding: 40px 20px;
}
.success-icon {
    width: 56px;
    height: 56px;
    background: rgba(15,214,164,0.1);
    border: 2px solid var(--accent-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-2);
    margin: 0 auto 20px;
}
.form-success h3 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 8px;
}
.form-success p { color: var(--text-secondary); }

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

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-secondary); }

/* ============================================================ Animations */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================ Responsive */
@media (max-width: 900px) {
    .features-grid { grid-template-columns: 1fr 1fr; }
    .feature-card--large { grid-column: span 2; }
    .formats-grid { grid-template-columns: 1fr 1fr; }
    .feedback-inner { grid-template-columns: 1fr; gap: 48px; }
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item--main { grid-row: span 1; }
    .nav-links { display: none; }
}

@media (max-width: 600px) {
    .features-grid { grid-template-columns: 1fr; }
    .feature-card--large { grid-column: span 1; }
    .formats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stats-inner { gap: 0; }
    .stat { padding: 16px 24px; }
    .stat-divider { display: none; }
    .feedback-form-wrap { padding: 24px; }
    .hero-actions { flex-direction: column; }
}

/* ============================================================ Themed Screenshots */
.hero-screenshot-frame img.themed-screenshot {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.gallery-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: block;
    transition: opacity 0.3s ease;
}

/* Fade during src swap */
.themed-screenshot.swapping { opacity: 0; }
