:root {
    --bg-primary: #08080f;
    --bg-secondary: #0e0e1a;
    --bg-card: #131322;
    --bg-card-hover: #1a1a2e;
    --bg-input: #0e0e1a;
    --border: #1e1e3a;
    --border-hover: #2e2e5a;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #5a5a7a;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --green: #00d68f;
    --green-bg: rgba(0, 214, 143, 0.1);
    --red: #ff6b6b;
    --red-bg: rgba(255, 107, 107, 0.1);
    --yellow: #ffd93d;
    --gradient: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #6c5ce7 100%);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Navbar ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(8, 8, 15, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

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

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ── Hero ── */
.hero {
    position: relative;
    padding: 160px 0 100px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 50% 20%, rgba(108, 92, 231, 0.15), transparent),
        radial-gradient(ellipse 400px 300px at 80% 60%, rgba(168, 85, 247, 0.08), transparent);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    position: relative;
}

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

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
    position: relative;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.08);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
}

/* ── Sections ── */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* ── Ad Container ── */
.ad-container {
    padding: 20px 0;
    text-align: center;
}

.ad-container .container {
    min-height: 90px;
}

/* ── Calculator ── */
.calculator-section {
    padding: 80px 0;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.calculator-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.coin-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 32px;
}

.coin-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.coin-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.coin-tab.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

.coin-symbol {
    font-size: 1rem;
    font-weight: 700;
}

.coin-name {
    font-size: 0.7rem;
    white-space: nowrap;
}

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

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

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

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-unit {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}

.input-with-unit:focus-within {
    border-color: var(--accent);
}

.input-with-unit input {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
}

.input-with-unit input::placeholder {
    color: var(--text-muted);
}

.input-unit {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    border-left: 1px solid var(--border);
}

.info-value {
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ── Results ── */
.results-panel {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.results-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.result-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.result-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-coins {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-revenue {
    font-size: 1rem;
    color: var(--text-secondary);
}

.result-cost {
    font-size: 0.82rem;
    color: var(--red);
}

.result-profit {
    font-size: 1.4rem;
    font-weight: 700;
}

.result-profit.positive {
    color: var(--green);
}

.result-profit.negative {
    color: var(--red);
}

.results-disclaimer {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Calculator Sidebar ── */
.calculator-sidebar {
    position: sticky;
    top: 88px;
    min-height: 250px;
}

/* ── Coins Grid ── */
.coins-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

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

.coin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
    cursor: pointer;
}

.coin-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.coin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.coin-card-name {
    display: flex;
    flex-direction: column;
}

.coin-card-name .symbol {
    font-size: 1.1rem;
    font-weight: 700;
}

.coin-card-name .name {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.coin-card-algo {
    font-size: 0.72rem;
    padding: 4px 8px;
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent);
    border-radius: 4px;
    font-weight: 600;
}

.coin-card-price {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.coin-card-change {
    font-size: 0.82rem;
    font-weight: 600;
}

.coin-card-change.up {
    color: var(--green);
}

.coin-card-change.down {
    color: var(--red);
}

.coin-card-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coin-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.coin-stat-label {
    color: var(--text-muted);
}

.coin-stat-value {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Hardware ── */
.hardware-section {
    padding: 80px 0;
}

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

.hardware-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
}

.hardware-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.hardware-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    background: var(--green-bg);
    color: var(--green);
}

.hardware-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hardware-specs {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    flex: 1;
}

.hardware-specs li {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hardware-specs strong {
    color: var(--text-muted);
    font-weight: 500;
}

.affiliate-disclaimer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ── Guides ── */
.guides-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

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

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: all var(--transition);
}

.guide-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.guide-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.guide-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.guide-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── CTA ── */
.cta-section {
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 600px 300px at 50% 50%, rgba(108, 92, 231, 0.12), transparent);
    pointer-events: none;
}

.cta-section h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 60px 0 32px;
    background: var(--bg-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color var(--transition);
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

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

.footer-bottom a {
    color: var(--accent);
    text-decoration: none;
}

.footer-disclaimer {
    margin-top: 8px;
    font-size: 0.75rem !important;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .calculator-sidebar {
        position: static;
    }

    .coins-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hardware-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 24px;
        gap: 16px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .coin-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .coin-name {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .coins-grid {
        grid-template-columns: 1fr;
    }

    .hardware-grid {
        grid-template-columns: 1fr;
    }

    .guides-grid {
        grid-template-columns: 1fr;
    }

    .calculator-main {
        padding: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .coin-selector {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* ── Loading Spinner ── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}
