/* === Custom Properties === */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-stats: #0f1623;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --accent-dim: rgba(6, 182, 212, 0.1);
    --border: rgba(6, 182, 212, 0.15);
    --border-hover: rgba(6, 182, 212, 0.4);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Hero === */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
                linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero__grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.4;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero__content { position: relative; z-index: 1; }

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 1rem;
    margin-bottom: 1.5rem;
}

.hero__badge-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.hero__title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero__title-accent {
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
}

.hero__tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: var(--accent);
    color: var(--bg-primary);
}
.btn--primary:hover {
    background: #22d3ee;
    box-shadow: 0 0 20px var(--accent-glow);
    text-decoration: none;
}

.btn--outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border-hover);
}
.btn--outline:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    text-decoration: none;
}

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

.stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stats__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.stats__item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 10%;
    height: 80%;
    width: 1px;
    background: var(--border);
}

.stats__number {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stats__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats__number--animated {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.stats__number--animated.is-visible {
    opacity: 1;
}

@media (max-width: 640px) {
    .stats__grid { grid-template-columns: repeat(2, 1fr); }
    .stats__item:nth-child(2)::after { display: none; }
}

/* === Section Title === */
.section__title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/* === Features === */
.features {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-dim);
}

.feature-card__icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.feature-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card__desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50% { opacity: 0.5; }
}

/* === Device Cards === */
.devices {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.devices__group-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    margin-top: 2.5rem;
    padding-left: 0.25rem;
}

.devices__group-label:first-of-type {
    margin-top: 0;
}

.devices__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.device-card {
    display: grid;
    grid-template-rows: auto auto auto;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
        'name  name  value'
        'icon  desc  desc'
        'star  time  tools';
    column-gap: 8px;
    row-gap: 4px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 6px;
    box-shadow: 0 0 0 1.5px var(--accent), 0 0 12px var(--accent-dim);
    color: var(--text-primary);
    font-size: 0.82rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.device-card:hover {
    box-shadow: 0 0 0 2px var(--accent), 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.device-card__name {
    grid-area: name;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: center;
}

.device-card__value {
    grid-area: value;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    text-align: right;
    white-space: nowrap;
    align-self: center;
}

.device-card__value--text {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.device-card__unit {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.device-card__icon {
    grid-area: icon;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.device-card__icon svg {
    width: 36px;
    height: 36px;
}

.device-card__desc {
    grid-area: desc;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.device-card__star {
    grid-area: star;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-card__time {
    grid-area: time;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.6;
    display: flex;
    align-items: center;
}

.device-card__tools {
    grid-area: tools;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    opacity: 0.4;
}

/* Toggle switch for Cooling card */
.device-card__toggle {
    display: inline-block;
    width: 36px;
    height: 18px;
    border-radius: 9px;
    background: var(--text-muted);
    position: relative;
    opacity: 0.6;
}

.device-card__toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    transition: transform 0.2s ease;
}

.device-card__toggle--on {
    background: #22c55e;
    opacity: 1;
}

.device-card__toggle--on::after {
    transform: translateX(18px);
}

/* Sparkline chart (click-to-expand) */
.device-card__chart {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    animation: chart-slide 0.25s ease-out;
}

.device-card__chart-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.device-card__chart svg {
    width: 100%;
    height: 45px;
    display: block;
}

@keyframes chart-slide {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 80px; }
}

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

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

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

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

.footer__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer__brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.footer__name {
    font-weight: 700;
    font-size: 1.1rem;
}

.footer__sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer__links {
    display: flex;
    gap: 1.5rem;
}

.footer__links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer__links a:hover { color: var(--accent); }

.footer__version {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .footer__content { flex-direction: column; text-align: center; }
}
