:root {
    /* Advanced Palette */
    --bg-color: #fafafa;
    --surface-color: #ffffff;
    --primary-color: #111827;
    /* Near black key color */
    --primary-hover: #000000;
    --accent-color: #3b82f6;
    /* Electric Blue for accents */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-subtle: #e5e7eb;
    --border-hover: #d1d5db;
    --focus-ring: rgba(59, 130, 246, 0.3);

    /* Variables */
    --radius-xl: 1.5rem;
    --radius-lg: 0.75rem;
    --radius-md: 0.5rem;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background Orbs */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: drift 20s infinite alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #e0e7ff 0%, rgba(255, 255, 255, 0) 70%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #f3e8ff 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Nav */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-box {
    width: 32px;
    height: 32px;
    background: var(--text-primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.logo-accent {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.github-btn {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--text-primary);
}

.github-btn:hover {
    background: #e5e7eb;
}


/* Main Layout */
.main-layout {
    max-width: 1100px;
    margin: 100px auto 0;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 0;
    max-width: 800px;
}

.badge {
    background: white;
    border: 1px solid var(--border-subtle);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #111827 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p.hero-subtext {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.1rem;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-btn.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hero-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stats-row {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

/* Tool Section */
.tool-section {
    width: 100%;
    max-width: 900px;
    margin-top: 2rem;
}

.converter-card {
    background: var(--surface-color);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.tabs {
    background: #f9fafb;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    padding: 0.5rem 1rem 0;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    background: var(--surface-color);
    color: var(--primary-color);
    box-shadow: 0 -4px 6px -4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-subtle);
    border-bottom: 1px solid white;
    /* Hide bottom border */
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.tab-content {
    padding: 2.5rem;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    background: #fdfdfd;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--accent-color);
    background: #f0f7ff;
}

.drop-icon-bg {
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.drop-zone h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.drop-zone .sub-caption {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 1rem;
}

.browse-link {
    color: var(--accent-color);
    font-weight: 600;
}

/* Results */
.result-area {
    margin-top: 2rem;
    animation: slideUp 0.3s ease-out;
}

.preview-container {
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.file-overlay {
    margin-top: 1rem;
    background: white;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tag {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Output Area */
.output-group {
    margin-top: 1.5rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.copy-feedback {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.copy-feedback.show {
    opacity: 1;
}

.textarea-wrapper {
    position: relative;
}

textarea {
    width: 100%;
    height: 120px;
    padding: 1rem;
    padding-right: 3rem;
    /* space for btn */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-family: 'SF Mono', monospace;
    font-size: 0.8rem;
    background: #f9fafb;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
}

textarea:focus {
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.icon-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid var(--border-subtle);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Primary Btn Wide */
.primary-btn.wide {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* Features */
.features {
    padding: 6rem 0;
    max-width: 1000px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--text-secondary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.f-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 0;
    margin-top: 2rem;
    background: white;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand span {
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.footer-links a {
    margin-left: 2rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* Animation Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    /* Simplified mobile handling */
}