/* ═══════════════════════════════════════════════
   Premium Design System — Dark Luxury Theme
   ═══════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
    /* Background — true blacks */
    --bg-app: #0a0a0a;
    --bg-surface: #141414;
    --bg-elevated: #1c1c1c;
    --bg-input: #111111;
    --bg-glass: rgba(255, 255, 255, .03);

    /* Text — warm whites */
    --text-primary: #f5f5f4;
    --text-secondary: #a8a29e;
    --text-muted: #57534e;

    /* Brand — warm amber/gold */
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --primary-soft: rgba(245, 158, 11, .08);
    --primary-ring: rgba(245, 158, 11, .25);
    --accent: #fb923c;
    --gradient: linear-gradient(135deg, #f59e0b, #fb923c);
    --gradient-subtle: linear-gradient(135deg, rgba(245, 158, 11, .06), rgba(251, 146, 60, .03));

    /* Status */
    --success: #22c55e;
    --danger: #ef4444;

    /* Borders — very subtle warm tones */
    --border: rgba(255, 255, 255, .05);
    --border-strong: rgba(255, 255, 255, .08);
    --border-glow: rgba(245, 158, 11, .15);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgb(0 0 0/.5);
    --shadow-card: 0 2px 8px rgb(0 0 0/.3), 0 0 1px rgb(255 255 255/.05);
    --shadow-glow: 0 0 60px -15px rgba(245, 158, 11, .12);
    --shadow-hover: 0 8px 30px -8px rgba(245, 158, 11, .15), 0 0 1px rgba(245, 158, 11, .2);

    /* Radii */
    --radius: .75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;

    /* Animation */
    --ease: cubic-bezier(.22, 1, .36, 1);
    --transition: .3s cubic-bezier(.22, 1, .36, 1);
}

[data-theme="light"] {
    --bg-app: #f1f5f9;
    --bg-surface: #e2e8f0;
    --bg-elevated: #cbd5e1;
    --bg-input: #e2e8f0;
    --bg-glass: rgba(0, 0, 0, .03);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --primary: #b45309;
    --primary-hover: #92400e;
    --primary-soft: rgba(180, 83, 9, .08);
    --primary-ring: rgba(180, 83, 9, .2);
    --gradient: linear-gradient(135deg, #b45309, #c2410c);
    --gradient-subtle: linear-gradient(135deg, rgba(180, 83, 9, .06), rgba(194, 65, 12, .03));

    --border: rgba(0, 0, 0, .08);
    --border-strong: rgba(0, 0, 0, .12);
    --border-glow: rgba(180, 83, 9, .25);

    --shadow-card: 0 1px 3px rgb(0 0 0/.06), 0 0 0 1px rgb(0 0 0/.04);
    --shadow-hover: 0 8px 25px -6px rgba(180, 83, 9, .12);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul {
    list-style: none;
}

/* ─── App Layout (Sidebar + Content) ─── */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.main-content {
    padding: 2.5rem 3rem;
    max-width: 960px;
}

@media (max-width:768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }
}

/* ─── Landing Layout ─── */
.landing-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Typography ─── */
h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.15;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: .95rem;
    margin-top: .35rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Breadcrumbs ─── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.breadcrumbs a {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumbs a:hover {
    opacity: .75;
}

/* ═══════════════════════════════════════════════
   Landing Page — Premium Dashboard
   ═══════════════════════════════════════════════ */

/* ─ Top Bar ─ */
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: transparent;
    position: relative;
    z-index: 10;
}

.landing-nav .brand {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.landing-nav .brand-icon {
    font-size: 1.3rem;
    color: var(--primary);
}

.landing-nav .brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─ Hero ─ */
.hero {
    text-align: center;
    padding: 3rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Animated gradient mesh background */
.hero::before {
    content: '';
    position: absolute;
    inset: -50%;
    background:
        radial-gradient(600px circle at 30% 20%, rgba(245, 158, 11, .08), transparent 50%),
        radial-gradient(500px circle at 70% 60%, rgba(251, 146, 60, .06), transparent 50%),
        radial-gradient(400px circle at 50% 80%, rgba(234, 88, 12, .04), transparent 50%);
    animation: meshFloat 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes meshFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(2%, -3%) scale(1.02);
    }

    66% {
        transform: translate(-2%, 2%) scale(.98);
    }
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--border-glow);
    padding: .35rem .85rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.hero-badge i {
    font-size: .65rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -.05em;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: .5rem;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    margin-top: .15rem;
}

@media (max-width:640px) {
    .hero {
        padding: 3rem 1.25rem 2rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }
}

/* ─ Dashboard Section ─ */
.dashboard-section {
    padding: 0 2.5rem 5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.section-header i {
    color: var(--primary);
    font-size: .85rem;
}

.section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
}

/* 4 columns on desktop, 3 on medium, 2 on tablet, 1 on mobile */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width:1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ─ Tool Cards ─ */
.tool-card {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    padding: 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: all var(--transition);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

/* Top shine line */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
    background: var(--bg-surface);
}

.tool-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 1.15rem;
}

/* Unique accent backgrounds per tool */
.tool-icon.temp {
    background: rgba(239, 68, 68, .1);
    color: #ef4444;
}

.tool-icon.length {
    background: rgba(59, 130, 246, .1);
    color: #3b82f6;
}

.tool-icon.weight {
    background: rgba(168, 85, 247, .1);
    color: #a855f7;
}

.tool-icon.volume {
    background: rgba(6, 182, 212, .1);
    color: #06b6d4;
}

.tool-icon.speed {
    background: rgba(245, 158, 11, .1);
    color: #f59e0b;
}

.tool-icon.area {
    background: rgba(34, 197, 94, .1);
    color: #22c55e;
}

.tool-icon.fsize {
    background: rgba(99, 102, 241, .1);
    color: #6366f1;
}

.tool-icon.drate {
    background: rgba(236, 72, 153, .1);
    color: #ec4899;
}

.tool-icon.press {
    background: rgba(14, 165, 233, .1);
    color: #0ea5e9;
}

.tool-icon.energy {
    background: rgba(234, 179, 8, .1);
    color: #eab308;
}

.tool-icon.angle {
    background: rgba(16, 185, 129, .1);
    color: #10b981;
}

.tool-icon.time {
    background: rgba(244, 114, 182, .1);
    color: #f472b6;
}

.tool-info h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.tool-info p {
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.tool-arrow {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: auto;
    transition: color var(--transition);
}

.tool-card:hover .tool-arrow {
    color: var(--primary);
}

.tool-arrow i {
    font-size: .6rem;
    transition: transform var(--transition);
}

.tool-card:hover .tool-arrow i {
    transform: translateX(3px);
}

/* ─ Footer ─ */
.landing-footer {
    margin-top: auto;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    position: relative;
}

.landing-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: .35;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem 2rem;
}

.footer-col h4 {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-primary);
    margin-bottom: .85rem;
}

.footer-col .footer-brand-desc {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: .75rem;
}

.footer-col .footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}

.footer-col .footer-brand-link:hover {
    opacity: .7;
}

.footer-col a {
    display: block;
    font-size: .82rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: .2rem 0;
    transition: color .2s;
}

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

.footer-col .social-link {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.footer-col .social-link i {
    width: 16px;
    text-align: center;
    font-size: .85rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    text-align: center;
    font-size: .72rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ─── FAQ Accordion ─── */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .5rem;
    overflow: hidden;
    background: var(--bg-glass);
}

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .85rem 1.15rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: color .2s;
}

.faq-q:hover {
    color: var(--primary);
}

.faq-q i {
    font-size: .65rem;
    color: var(--text-muted);
    transition: transform .25s;
}

.faq-item.open .faq-q i {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.faq-item.open .faq-a {
    max-height: 200px;
}

.faq-a-inner {
    padding: 0 1.15rem .85rem;
    color: var(--text-secondary);
    font-size: .84rem;
    line-height: 1.7;
}

/* ─── Utility ─── */
.hidden {
    display: none !important;
}