/* ============================================
   Name: Simple
   Author: MevaSearch
   Colors: [Bg:#0f1115, Fg:#f1f5f9, Accent:#0ea5e9]
   ============================================ */

@font-face {
    font-family: 'Space Grotesk';
    src: url(/font/Space-Grotesk.ttf) format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

:root {
    color-scheme: dark;
    --background: #0f1115;
    --foreground: #f1f5f9;
    --card: #161a22;
    --card-hover: #1e242f;
    --muted: #64748b;
    --muted-background: #1e293b;
    --border: #2d3644;
    --border-hover: #3d4d60;           /* NEW: hover border tone */
    --primary: #0ea5e9;
    --primary-foreground: #ffffff;
    --primary-ring: rgba(14, 165, 233, 0.15); /* NEW: focus ring color */
    --success: #22c55e;
    --navbar-bg: rgba(15, 17, 21, 0.85);
    --grid-line: rgba(255, 255, 255, 0.03);
    --search-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

:root[data-theme="black"] {
    color-scheme: dark;
    --background: #000000;
    --foreground: #ffffff;
    --card: #0a0a0a;
    --card-hover: #121212;
    --muted: #888888;
    --muted-background: #111111;
    --border: #1f1f1f;
    --border-hover: #2e2e2e;
    --primary: #ffffff;
    --primary-foreground: #000000;
    --primary-ring: rgba(255, 255, 255, 0.12);
    --navbar-bg: rgba(0, 0, 0, 0.9);
    --grid-line: rgba(255, 255, 255, 0.05);
    --search-shadow: 0 0 0 1px #222;
}

:root[data-theme="light"] {
    color-scheme: light;
    --background: #f8fafc;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-hover: #f1f5f9;
    --muted: #64748b;
    --muted-background: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --primary: #0ea5e9;
    --primary-foreground: #ffffff;
    --primary-ring: rgba(14, 165, 233, 0.12);
    --navbar-bg: rgba(248, 250, 252, 0.85);
    --grid-line: rgba(15, 23, 42, 0.04);
    --search-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: 0.2s;
}

/* ── Layout ─────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Navbar ──────────────────────────────── */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);          /* IMPROVED: was 16px */
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

/* ── Mobile nav ──────────────────────────── */

.mobile-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);          /* IMPROVED: subtler lift */
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* IMPROVED: split transitions */
    pointer-events: none;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;                             /* IMPROVED: tighter gap */
}

.mobile-nav a {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    font-size: 1rem;                      /* IMPROVED: was 1.1rem, slightly more refined */
    font-weight: 500;
    color: var(--foreground);
    border-radius: 12px;
    transition: background 0.15s ease, color 0.15s ease;
    border-bottom: none;
}

.mobile-nav a:hover,
.mobile-nav a:active {
    background: var(--muted-background);
    color: var(--primary);
}

.mobile-nav-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-nav .btn {
    width: 100%;
    padding: 13px;
    font-size: 0.9375rem;
    border-radius: 100px;
    justify-content: center;
}

/* Arrow animation on mobile nav links */
.mobile-nav a::after {
    content: '→';
    margin-left: auto;
    opacity: 0;
    transform: translateX(-8px);         /* IMPROVED: slightly shorter travel */
    transition: opacity 0.2s, transform 0.2s;
}

.mobile-nav a:hover::after {
    opacity: 0.4;
    transform: translateX(0);
}

/* ── Logo ────────────────────────────────── */

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 28px;
    width: auto;
}

/* ── Nav links ───────────────────────────── */

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--muted);
    position: relative;
    padding-bottom: 2px;
}

/* IMPROVED: underline reveal on hover */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-links a:hover {
    color: var(--foreground);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* ── Hero / main ─────────────────────────── */

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    padding: 0 20px;
}

.search-container {
    width: 100%;
    max-width: 640px;
    text-align: center;
}

.logo-large {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, var(--foreground), var(--muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Search ──────────────────────────────── */

.search-form {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 8px 6px 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--search-shadow);
}

.search-input-wrapper:hover {
    border-color: var(--border-hover);   /* NEW: hover state before focus */
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px var(--primary-ring), /* NEW: focus ring */
                0 10px 30px -8px rgba(0, 0, 0, 0.25);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--foreground);
    font-size: 1.0625rem;               /* IMPROVED: slightly tighter than 1.1rem */
    outline: none;
}

.search-input::placeholder {
    color: var(--muted);
    transition: color 0.2s;
}

.search-input:focus::placeholder {
    color: transparent;                  /* NEW: placeholder fades on focus */
}

.search-icon {
    margin-left: 14px;
    color: var(--muted);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--primary);              /* NEW: icon tints on focus */
}

/* ── Buttons ─────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.18s, background 0.18s, border-color 0.18s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97) !important;  /* NEW: press feedback */
}

.btn-primary {
    background: var(--foreground);
    color: var(--background);
}

.btn-primary:hover {
    opacity: 0.88;
    transform: scale(1.02);
}

.btn-outline {
    border-color: var(--border);
    color: var(--foreground);
    background: transparent;
}

.btn-outline:hover {
    background: var(--muted-background);
    border-color: var(--border-hover);  /* IMPROVED: border shifts on hover */
}

/* NEW: ghost button variant */
.btn-ghost {
    color: var(--muted);
    background: transparent;
    border-color: transparent;
    padding: 10px 14px;
}

.btn-ghost:hover {
    color: var(--foreground);
    background: var(--muted-background);
}

/* ── Badges ──────────────────────────────── */

/* NEW: badge component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.badge-primary {
    background: rgba(14, 165, 233, 0.12);
    color: var(--primary);
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.badge-muted {
    background: var(--muted-background);
    color: var(--muted);
}

/* ── Feature cards ───────────────────────── */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;                          /* IMPROVED: tighter gap */
    padding: 60px 0;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;               /* IMPROVED: slightly less than 24px — more modern */
    padding: 28px;
    transition: border-color 0.25s, background 0.25s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.feature-card:hover {
    border-color: var(--primary);
    background: var(--card-hover);
    transform: translateY(-2px);        /* NEW: subtle lift on hover */
}

/* NEW: card icon container */
.feature-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
    transition: background 0.25s;
}

.feature-card:hover .feature-card-icon {
    background: rgba(14, 165, 233, 0.18);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ── Settings ────────────────────────────── */

.settings-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    transition: background 0.15s;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row:hover {
    background: rgba(255, 255, 255, 0.015); /* NEW: very subtle row hover */
}

.settings-row-label {
    font-size: 0.9375rem;
    font-weight: 500;
}

.settings-row-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Toggle switch ───────────────────────── */

/* NEW: proper toggle switch */
.toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--muted-background);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border);
}

.toggle input:checked ~ .toggle-track {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--foreground);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle input:checked ~ .toggle-track::after {
    left: 20px;
}

/* ── Theme pill group ────────────────────── */

.theme-pill-group {
    display: flex;
    background: var(--muted-background);
    padding: 4px;
    border-radius: 100px;
    gap: 3px;
}

.theme-pill {
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    color: var(--muted);
    user-select: none;
}

.theme-pill.active {
    background: var(--card);
    color: var(--primary);
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.theme-pill:not(.active):hover {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.04);
}

/* ── Footer ──────────────────────────────── */

.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 0.8125rem;               /* IMPROVED: slightly tighter */
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-links a:hover {
    color: var(--foreground);
}

/* ── Background grid ─────────────────────── */

.hero-grid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent); /* IMPROVED: ellipse for wider fade */
    pointer-events: none;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 768px) {
    .logo-large {
        font-size: 2.5rem;
    }

    .navbar-inner {
        height: 60px;
        padding: 0 16px;
    }

    .nav-links {
        display: none;
    }

    .search-input-wrapper {
        border-radius: 20px;            /* IMPROVED: matches card radius on mobile */
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 40px 0;
    }

    .feature-card {
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* NEW: respect reduced-motion preference */
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}