:root {
    --bg: #f5f2ed;
    --surface: #ffffff;
    --text: #1f2a1f;
    --muted: #5c6b5c;
    --primary: #2d4c31;
    --primary-dark: #1e3321;
    --accent: #7fb069;
    --accent-soft: #e8f2e3;
    --copper: #b87333;
    --cool: #7eb6d9;
    --border: #d8e2d3;
    --shadow: 0 12px 30px rgba(45, 76, 49, 0.1);
    --mode-monitor: #6b8cae;
    --mode-holiday: #d38b5d;
    --serif: "Playfair Display", Georgia, serif;
    --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

h1, h2, h3, .brand-mark {
    font-family: var(--serif);
    font-weight: 700;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
}

.page-content { padding: 0 0 4rem; }

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--primary);
}

.brand:hover { text-decoration: none; }

.brand-mark {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.brand-tagline {
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    font-family: var(--sans);
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

nav a, .link-button {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
}

.nav-cta:hover { background: var(--primary-dark); text-decoration: none; }

.inline-form { display: inline; margin: 0; }

.link-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

/* Brand hero band */
.brand-hero {
    background: var(--primary);
    color: #fff;
    padding: 3rem 0 3.5rem;
    margin-bottom: 0;
}

.brand-hero-inner {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.brand-hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 0.75rem;
    font-family: var(--sans);
}

.brand-hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    margin: 0 0 1rem;
    color: #fff;
}

.brand-hero-lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 0.5rem;
}

.brand-hero-sub {
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 1.5rem;
}

.brand-hero-visual {
    text-align: center;
    position: relative;
}

/* CSS device illustration (from product specs, not a raster image) */
.device-illustration {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    max-width: 120px;
}

.device-cap {
    width: 52px;
    height: 28px;
    background: linear-gradient(180deg, #3a3f44 0%, #2a2e32 100%);
    border-radius: 8px 8px 2px 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-led {
    width: 18px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 6px var(--accent);
}

.device-body {
    width: 44px;
    height: 140px;
    background: linear-gradient(90deg, #8a9098 0%, #c5c9ce 35%, #a8adb4 65%, #7d848c 100%);
    border-radius: 4px;
    position: relative;
}

.device-spec {
    position: absolute;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    font-family: var(--sans);
}

.device-spec.left { left: -52px; top: 50%; }
.device-spec.right { right: -36px; top: 30%; }

.device-copper-ring {
    width: 48px;
    height: 14px;
    background: linear-gradient(180deg, #d4a574 0%, var(--copper) 50%, #9a6530 100%);
    border-radius: 2px;
    margin-top: -2px;
    position: relative;
}

.device-probe {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 28px solid #6b7078;
    position: relative;
}

.device-label {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    font-family: var(--sans);
    text-align: left;
}

.device-cap .device-label,
.device-copper-ring .device-label,
.device-probe .device-label {
    display: none;
}

.brand-hero-badge {
    margin-top: 1rem;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.btn-light {
    background: #fff;
    color: var(--primary) !important;
}

.btn-light:hover { background: var(--accent-soft); text-decoration: none; }

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #fff !important;
}

.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }

/* Demo showcase */
.demo-showcase {
    width: min(1140px, calc(100% - 2rem));
    margin: -1.5rem auto 2rem;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 5;
}

.demo-showcase-intro h2 {
    color: var(--primary);
    margin: 0.3rem 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.demo-showcase-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: start;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 700;
    margin: 0;
    font-family: var(--sans);
}

.lead, .muted { color: var(--muted); }

/* Phone mock */
.phone-mock {
    background: #1a1c20;
    border-radius: 28px;
    padding: 10px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.2);
    max-width: 300px;
}

.phone-notch {
    width: 80px;
    height: 5px;
    background: #333;
    border-radius: 99px;
    margin: 4px auto 8px;
}

.phone-screen {
    background: var(--bg);
    border-radius: 20px;
    padding: 1rem;
    min-height: 420px;
}

.phone-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.phone-plant-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.phone-plant-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    border: 2px solid var(--accent);
}

.phone-status {
    margin: 0;
    font-weight: 700;
    font-size: 0.9rem;
}

.phone-status.healthy { color: var(--accent); }

.phone-status-text {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.phone-rows {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    border-top: 1px solid var(--border);
}

.phone-rows li {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.phone-rows strong { color: var(--primary); }

.phone-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.phone-metrics div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
}

.phone-metrics span { display: block; color: var(--muted); }
.phone-metrics strong { color: var(--primary); }

/* Demo charts */
.demo-charts-panel { min-width: 0; }

.demo-chart-card {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.demo-chart-card.featured {
    background: var(--surface);
    border-color: var(--accent);
    border-width: 2px;
}

.demo-chart-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--primary);
    font-family: var(--sans);
    font-weight: 600;
}

.chart-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.chart-legend {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chart-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.chart-legend .dot.soil { background: var(--accent); }

.demo-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.demo-footnote {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Split bands */
.split-band {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto 2rem;
    padding: 2.5rem;
    border-radius: 18px;
}

.sustainable-band {
    background: var(--surface);
    border: 1px solid var(--border);
}

.split-band h2 {
    color: var(--primary);
    margin: 0.4rem 0 0.75rem;
}

.split-band p { color: var(--muted); line-height: 1.6; }

.trust-list {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.trust-list li {
    padding-left: 1.2rem;
    position: relative;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.92rem;
}

.trust-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.eco-stats {
    display: grid;
    gap: 0.75rem;
}

.eco-stat {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.eco-stat strong {
    display: block;
    font-size: 1.35rem;
    color: var(--primary);
    font-family: var(--serif);
}

.eco-stat span {
    font-size: 0.85rem;
    color: var(--muted);
}

.chart-legend .dot.temp { background: #d38b5d; }

/* Modes band */
.modes-band {
    background: var(--primary);
    color: #fff;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.modes-band-head {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto 1.5rem;
    text-align: center;
}

.modes-band-head h2 {
    color: #fff;
    margin: 0 0 0.5rem;
}

.modes-band-head .muted { color: rgba(255, 255, 255, 0.75); }

.infographic-modes {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.infographic-modes .mode-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1.25rem;
    color: #fff;
}

.infographic-modes .mode-card h3 {
    color: #fff;
    margin: 0.5rem 0;
    font-family: var(--sans);
    font-size: 1rem;
}

.infographic-modes .mode-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0 0 0.85rem;
    line-height: 1.5;
}

.mode-example {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-top: auto;
}

.mode-example-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-family: var(--sans);
}

.mode-example p {
    margin: 0 !important;
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.mode-example strong {
    color: #fff;
    font-weight: 600;
}

.mode-example em {
    color: var(--accent);
    font-style: normal;
    font-weight: 500;
}

.infographic-modes .mode-card {
    display: flex;
    flex-direction: column;
}

.mode-num {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--sans);
}

/* Feature pillars */
.feature-pillars {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feature-pillars article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
}

.feature-pillars h3 {
    color: var(--primary);
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-family: var(--sans);
}

.feature-pillars p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Planet band */
.planet-band {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.planet-band h2 {
    color: var(--primary);
    margin: 0 0 0.5rem;
}

.planet-band p {
    color: var(--muted);
    margin: 0 0 1.25rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.hero-actions.center { justify-content: center; }

/* Shared components */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    width: min(1140px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
}

.auth-card, .device-card, .empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.auth-card { max-width: 440px; margin: 2rem auto; }
.auth-card.wide { max-width: 560px; }

.device-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
}

.btn {
    display: inline-block;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--sans);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }

.btn-secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.stack-form {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
}

input:focus {
    outline: 2px solid rgba(127, 176, 105, 0.45);
    border-color: var(--accent);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.validation-summary, .field-error {
    color: #c92a2a;
    font-size: 0.92rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.metric-grid.large { grid-template-columns: repeat(4, 1fr); }

.metric {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem;
}

.metric .label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.metric .value {
    font-size: 1.2rem;
    font-weight: 700;
}

.status-on { color: var(--accent); }
.status-off { color: var(--muted); }

.serial, code {
    font-family: Consolas, monospace;
    font-size: 0.92rem;
}

.last-update { color: var(--muted); font-size: 0.92rem; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data-table th {
    background: var(--accent-soft);
    font-size: 0.9rem;
}

.chart-section {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    width: min(1140px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
}

.stat-card .label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0 2rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.5);
    margin-top: 2rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 900px) {
    .brand-hero-inner,
    .demo-showcase-grid,
    .split-band,
    .feature-pillars,
    .infographic-modes,
    .demo-chart-row,
    .metric-grid.large,
    .admin-stats,
    .details-chart-grid,
    .details-metrics {
        grid-template-columns: 1fr;
    }

    .phone-mock { margin: 0 auto; }
    .brand-tagline { display: none; }
    .demo-showcase { margin-top: 1rem; }
}

/* Device details page */
.details-page {
    padding-top: 1.5rem;
}

.details-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.details-status-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.details-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 2px solid var(--accent);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.details-status-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-pill {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.status-pill.active {
    color: var(--accent);
    border-color: var(--accent);
}

.details-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.details-metric-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.details-metric-group h3 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-family: var(--sans);
    font-weight: 600;
}

.details-charts h2 {
    color: var(--primary);
    margin: 0 0 1rem;
}

.details-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-subtitle {
    margin: -0.4rem 0 0.75rem;
    font-size: 0.85rem;
}

.details-charts .demo-chart-card {
    margin-bottom: 1rem;
}

.details-charts .demo-chart-card h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary);
    font-family: var(--sans);
    font-weight: 600;
}
