:root {
    --ink: #081813;
    --ink-soft: #173229;
    --paper: #f2f0e8;
    --paper-deep: #e6e4da;
    --lime: #c8ff62;
    --mint: #83d7bb;
    --amber: #ffb84d;
    --muted: #6c766f;
    --line: rgba(8, 24, 19, .17);
    --white-line: rgba(255, 255, 255, .16);
    --display: "Arial Narrow", "Aptos Display", "Segoe UI", sans-serif;
    --body: "Aptos", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.55; }
body::selection { background: var(--lime); color: var(--ink); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--lime); padding: .75rem 1rem; color: var(--ink); }
.skip-link:focus { top: 1rem; }

.site-header, .dashboard-header {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
    min-height: 78px; padding: 0 clamp(1rem, 4vw, 4.5rem); background: rgba(242, 240, 232, .92);
    border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.brand { display: inline-flex; gap: .75rem; align-items: center; text-decoration: none; font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.brand small { display: block; margin-top: .22rem; color: var(--muted); font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--ink); border-radius: 50%; background: var(--ink); color: var(--lime); font-size: .75rem; letter-spacing: .08em; }
.site-header nav { display: flex; align-items: center; gap: clamp(1rem, 2.3vw, 2.2rem); }
.site-header nav a { text-decoration: none; font-size: .88rem; font-weight: 700; }
.site-header nav a:hover { color: #436d5e; }
.site-header nav .nav-cta { padding: .65rem 1rem; border: 1px solid var(--ink); border-radius: 999px; }
.menu-button { display: none; background: none; border: 0; color: var(--ink); font-weight: 800; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); min-height: calc(100vh - 78px); overflow: hidden; background: var(--ink); color: #f8f7f1; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .23; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to right, black, transparent 72%); }
.hero-copy { position: relative; z-index: 2; align-self: center; padding: clamp(4rem, 8vw, 8.5rem) clamp(1.5rem, 7vw, 8rem); padding-right: 2rem; }
.eyebrow { margin: 0 0 1.25rem; color: var(--mint); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 0; font-family: var(--display); font-size: clamp(3.7rem, 7.2vw, 8.1rem); font-weight: 850; letter-spacing: -.075em; line-height: .91; }
.hero h1 em { color: var(--lime); font-family: Georgia, serif; font-weight: 400; }
.hero-lead { max-width: 680px; margin: 2.2rem 0 0; color: #cbd5cf; font-size: clamp(1.05rem, 1.5vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.4rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.2rem; border: 1px solid transparent; border-radius: 999px; cursor: pointer; text-decoration: none; font-weight: 800; }
.button-primary { background: var(--lime); color: var(--ink); }
.button-primary:hover { background: #dbff96; }
.button-quiet { border-color: rgba(255,255,255,.32); color: #fff; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 3.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--white-line); }
.hero-facts div { min-width: 0; }
.hero-facts dt { color: #81968b; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-facts dd { margin: .35rem 0 0; color: #f3f4f1; font-size: .88rem; }
.hero-visual { position: relative; display: grid; place-items: center; min-height: 620px; overflow: hidden; background: #102920; }
.hero-visual::after { content: ""; position: absolute; inset: auto 0 0; height: 36%; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.orbit { position: absolute; border: 1px solid rgba(200,255,98,.32); border-radius: 50%; }
.orbit-one { width: 76%; aspect-ratio: 1; }
.orbit-two { width: 108%; aspect-ratio: 1; }
.engineering-mark { position: relative; z-index: 3; display: grid; place-items: center; width: min(72%, 460px); aspect-ratio: 1; border: 1px solid rgba(200,255,98,.42); background: rgba(8,24,19,.5); box-shadow: 0 36px 70px rgba(0,0,0,.3); }
.engineering-mark::before, .engineering-mark::after { content: ""; position: absolute; background: rgba(200,255,98,.32); }
.engineering-mark::before { width: 1px; height: 100%; }
.engineering-mark::after { width: 100%; height: 1px; }
.engineering-label { position: absolute; top: 1rem; left: 1rem; color: var(--mint); font-size: .65rem; font-weight: 800; letter-spacing: .15em; }
.engineering-core { position: relative; z-index: 2; display: flex; align-items: center; gap: 1rem; width: 54%; padding: 1.2rem; border: 1px solid var(--lime); background: var(--ink); }
.engineering-core strong { color: var(--lime); font-family: var(--display); font-size: clamp(3.2rem, 7vw, 6.5rem); line-height: .8; letter-spacing: -.08em; }
.engineering-core small { color: #a7bbb1; font-size: .62rem; font-weight: 800; letter-spacing: .13em; line-height: 1.5; }
.engineering-mark > p { position: absolute; right: 1rem; bottom: .8rem; margin: 0; color: #9fb0a8; font-size: .62rem; font-weight: 800; letter-spacing: .13em; }
.engineering-mark > p b { color: var(--lime); }
.engineering-nodes i { position: absolute; z-index: 2; width: 13px; height: 13px; border: 2px solid var(--lime); border-radius: 50%; background: var(--ink); }
.node-a { left: -7px; top: 24%; }.node-b { right: -7px; top: 35%; }.node-c { left: 30%; bottom: -7px; }.node-d { right: 24%; top: -7px; }
.status-chip { position: absolute; z-index: 4; right: 8%; bottom: 8%; padding: .65rem .9rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(8,24,19,.78); color: #e9f2ed; font-size: .75rem; backdrop-filter: blur(10px); }
.status-chip span { display: inline-block; width: 7px; height: 7px; margin-right: .4rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(200,255,98,.12); }

.statement, .featured, .projects, .experience, .contact { padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 6vw, 7rem); }
.section-index { margin: 0 0 2.4rem; color: #537365; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.statement-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(3rem, 8vw, 9rem); }
.statement h2, .section-heading h2, .contact h2 { margin: 0; font-family: var(--display); font-size: clamp(2.5rem, 5vw, 5.8rem); letter-spacing: -.06em; line-height: .95; }
.statement-grid > div > p { margin-top: .2rem; color: #33453e; font-size: clamp(1.05rem, 1.4vw, 1.25rem); }
.skill-line { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 2rem; }
.skill-line span, .project-tags span { padding: .42rem .68rem; border: 1px solid var(--line); border-radius: 999px; font-size: .74rem; font-weight: 750; }

.featured { background: #dfeee5; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3.5rem; }
.section-heading .section-index { margin-bottom: 1rem; }
.section-heading > p { max-width: 420px; margin: 0 0 .5rem; color: #527064; }
.featured-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.project-figure { margin: 0; }
.project-figure img { width: 100%; aspect-ratio: 1048 / 572; object-fit: cover; border-radius: 2px; box-shadow: 0 25px 55px rgba(23,50,41,.16); }
.project-figure figcaption { margin-top: .75rem; color: #5e7068; font-size: .76rem; }
.project-system-visual { min-height: 530px; padding: 1.4rem; border: 1px solid rgba(8,24,19,.24); background: var(--ink); color: #eef5f1; }
.system-caption { color: var(--lime); font-size: .68rem; font-weight: 800; letter-spacing: .15em; }
.system-map { position: relative; min-height: 430px; margin-top: 1rem; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 38px 38px; }
.system-center, .system-item { position: absolute; z-index: 2; border: 1px solid rgba(255,255,255,.28); background: #102b21; }
.system-center { left: 50%; top: 50%; width: 165px; padding: 1.5rem; transform: translate(-50%, -50%); border-color: var(--lime); text-align: center; }
.system-center strong, .system-center small { display: block; }
.system-center strong { color: var(--lime); font-family: var(--display); font-size: 2rem; }
.system-center small, .system-item small { color: #88a096; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; }
.system-item { width: 145px; padding: .85rem; }
.system-item strong, .system-item span { display: block; }
.system-item strong { margin: .3rem 0; font-family: var(--display); }
.system-item span { color: #aebdb6; font-size: .68rem; }
.system-sensor { left: 3%; top: 12%; }.system-soil { left: 5%; bottom: 10%; }.system-pump { right: 4%; top: 12%; }.system-fan { right: 6%; bottom: 10%; }
.connector { position: absolute; z-index: 1; height: 1px; background: rgba(200,255,98,.55); transform-origin: left center; }
.connector-a { left: 25%; top: 28%; width: 28%; transform: rotate(28deg); }.connector-b { left: 26%; bottom: 27%; width: 28%; transform: rotate(-28deg); }.connector-c { left: 59%; top: 52%; width: 25%; transform: rotate(-30deg); }.connector-d { left: 59%; top: 52%; width: 27%; transform: rotate(29deg); }
.project-system-visual > p { margin: .7rem 0 0; color: #82988e; font-size: .72rem; }
.project-kicker { color: #527064; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.project-summary h3 { margin: .75rem 0 1.2rem; font-family: var(--display); font-size: clamp(1.8rem, 3.2vw, 3.4rem); letter-spacing: -.045em; line-height: 1.02; }
.project-summary > p:not(.project-kicker) { color: #314a40; }
.clean-list { margin: 2rem 0; padding: 0; list-style: none; border-top: 1px solid rgba(8,24,19,.2); }
.clean-list li { display: flex; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid rgba(8,24,19,.2); font-size: .9rem; }
.clean-list span { color: #628676; font-size: .7rem; font-weight: 800; }
.project-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.project-links a { font-weight: 800; text-underline-offset: .25rem; }
.architecture { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 1rem; align-items: center; margin-top: 5rem; padding: 2rem; border: 1px solid rgba(8,24,19,.22); background: rgba(255,255,255,.28); }
.architecture div { text-align: center; }
.architecture small { display: block; margin-bottom: .35rem; color: #678174; text-transform: uppercase; letter-spacing: .12em; }
.architecture strong { font-size: .9rem; }
.architecture > span { color: #77998a; }
.project-progress { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 1.5rem; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.project-progress div { min-height: 140px; padding: 1.4rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-progress span, .project-progress small { display: block; color: #71857c; font-size: .7rem; }
.project-progress strong { display: block; margin: 1.5rem 0 .4rem; font-family: var(--display); }
.project-progress .active { background: var(--ink); color: white; }
.project-progress .active span, .project-progress .active small { color: var(--lime); }

.projects { background: var(--paper); }
.project-row { display: grid; grid-template-columns: 70px 1.05fr 1.25fr 1fr; gap: 2rem; align-items: start; padding: 2.3rem 0; border-top: 1px solid var(--line); }
.project-row:last-child { border-bottom: 1px solid var(--line); }
.project-number { color: #779087; font-size: .72rem; font-weight: 800; }
.project-row h3 { margin: .45rem 0 0; font-family: var(--display); font-size: clamp(1.6rem, 2.5vw, 2.6rem); letter-spacing: -.04em; line-height: 1; }
.project-row > p { margin: 0; color: #42574f; }
.project-tags { display: flex; flex-wrap: wrap; gap: .35rem; }

.experience { background: var(--ink); color: #eef1ee; }
.experience .section-index, .experience .eyebrow { color: var(--lime); }
.experience .section-heading > p { color: #9aaba3; }
.timeline { margin-left: 18%; }
.timeline article { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--white-line); }
.timeline article:last-child { border-bottom: 1px solid var(--white-line); }
.timeline time { color: #92a49b; font-size: .78rem; }
.timeline h3 { margin: 0; font-family: var(--display); font-size: clamp(1.45rem, 2.3vw, 2.4rem); }
.timeline .company { color: var(--lime); font-weight: 750; }
.timeline article div > p:last-child { max-width: 720px; color: #b7c3bd; }

.contact { background: var(--lime); }
.contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(3rem, 8vw, 8rem); }
.contact h2 { max-width: 850px; }
.contact-grid > div > p { max-width: 640px; margin-top: 2rem; }
.contact-links { border-top: 1px solid var(--ink); }
.contact-links a { display: block; padding: 1.2rem 0; border-bottom: 1px solid var(--ink); text-decoration: none; }
.contact-links span { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.contact-links strong { display: block; margin-top: .3rem; font-family: var(--display); font-size: 1.1rem; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.3rem clamp(1.25rem, 6vw, 7rem); background: var(--ink); color: #8fa097; font-size: .75rem; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Authentication */
.auth-page { min-height: 100vh; background: var(--ink); color: white; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 3rem 1rem; background-image: radial-gradient(circle at 70% 20%, rgba(131,215,187,.17), transparent 36%), linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: auto, 48px 48px, 48px 48px; }
.back-link { position: absolute; left: 2rem; top: 2rem; color: #bdc9c3; text-decoration: none; }
.auth-card { width: min(100%, 480px); padding: clamp(2rem, 6vw, 4rem); border: 1px solid var(--white-line); background: rgba(17,42,33,.82); box-shadow: 0 40px 100px rgba(0,0,0,.3); }
.auth-card .brand-mark { margin-bottom: 2rem; }
.auth-card h1 { margin: 0; font-family: var(--display); font-size: 3rem; letter-spacing: -.06em; }
.auth-card > p:not(.eyebrow):not(.form-error) { color: #b9c5bf; }
.auth-card label { display: block; margin: 2rem 0 .5rem; font-weight: 750; }
.auth-card input { width: 100%; height: 50px; padding: 0 .9rem; border: 1px solid #6b8077; background: #0e241c; color: white; }
.auth-card .button { width: 100%; margin-top: 1rem; }
.form-error { padding: .8rem; background: rgba(255,105,97,.15); color: #ffaaa5; }

/* Dashboard */
.dashboard-page { min-height: 100vh; background: #071711; color: #edf5f1; }
.dashboard-header { background: rgba(7,23,17,.92); border-color: var(--white-line); }
.dashboard-header .brand { color: white; }
.dashboard-header .brand small { color: #86a095; }
.dashboard-actions { display: flex; gap: 1.2rem; align-items: center; }
.dashboard-actions a { color: #c4d0ca; font-size: .8rem; }
.connection-status { padding: .45rem .7rem; border: 1px solid var(--white-line); border-radius: 999px; color: #a9b9b1; font-size: .73rem; }
.connection-status i { display: inline-block; width: 7px; height: 7px; margin-right: .4rem; border-radius: 50%; background: #c8a94d; }
.connection-status.online i { background: var(--lime); box-shadow: 0 0 0 4px rgba(200,255,98,.1); }
.dashboard { width: min(1480px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 5rem; }
.dashboard-title { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
.dashboard-title h1 { margin: 0; font-family: var(--display); font-size: clamp(2.6rem, 5vw, 5.2rem); letter-spacing: -.065em; line-height: .95; }
.dashboard-title > div > p:last-child { color: #849a90; }
.mode-switch { min-width: 160px; padding: 1rem; border-left: 1px solid var(--white-line); }
.mode-switch span { display: block; color: #789187; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; }
.mode-switch strong { color: var(--lime); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--white-line); border: 1px solid var(--white-line); }
.metric { min-width: 0; min-height: 185px; padding: 1.2rem; background: #0d241b; }
.metric > div:first-child { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.metric span { color: #8ca097; font-size: .73rem; text-transform: uppercase; letter-spacing: .1em; }
.metric strong { font-family: var(--display); font-size: clamp(1.5rem, 2.5vw, 2.5rem); white-space: nowrap; }
.metric b { font-weight: 750; }
.metric small { display: block; color: #7f948a; }
.sparkline { width: 100%; height: 62px; margin: 1.2rem 0 .55rem; overflow: visible; }
.sparkline path { fill: none; stroke: var(--lime); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.water-gauge { position: relative; height: 64px; margin: 1.2rem 0 .55rem; overflow: hidden; background: #162f25; }
.water-gauge i { position: absolute; inset: auto 0 0; height: 0; background: linear-gradient(90deg, #4ca9b5, #83d7bb); transition: height .4s; }
.device-strip { display: grid; grid-template-columns: repeat(6,1fr); gap: 1px; margin-top: 1rem; background: var(--white-line); border: 1px solid var(--white-line); }
.device-strip div { min-width: 0; padding: .9rem 1rem; background: #0a1d16; }
.device-strip span,.device-strip strong { display:block; overflow-wrap:anywhere; }
.device-strip span { color:#71877d; font-size:.63rem; letter-spacing:.08em; text-transform:uppercase; }
.device-strip strong { margin-top:.25rem; color:#dce8e2; font-size:.84rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.55fr .65fr; gap: 1rem; margin-top: 1rem; }
.dashboard-grid.lower { grid-template-columns: .8fr 1.2fr; }
.panel { min-width: 0; padding: clamp(1.2rem, 2.5vw, 2rem); border: 1px solid var(--white-line); background: #0b2018; }
.panel-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.panel-heading .eyebrow { margin-bottom: .45rem; }
.panel h2 { margin: 0; font-family: var(--display); letter-spacing: -.04em; }
.chart-legend { display: flex; gap: 1rem; color: #81968c; font-size: .72rem; }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .35rem; border-radius: 50%; background: var(--lime); }
.chart-legend .hum::before { background: var(--mint); }
.chart-legend .soil::before { background: #e8bd72; }
.chart-legend .water::before { background: #62b8ff; }
.archive-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-top: 1.25rem; padding: 1rem; background: rgba(255,255,255,.025); border: 1px solid var(--white-line); }
.archive-toolbar label { display: grid; gap: .35rem; color: #81968c; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; }
.archive-toolbar select, .archive-toolbar input, .thresholds select { min-height: 42px; padding: .55rem .7rem; color: #dce8e2; border: 1px solid #3f594e; background: #071710; color-scheme: dark; }
.archive-toolbar .custom-range { display: flex; flex-wrap: wrap; gap: .75rem; }
.archive-toolbar .custom-range[hidden] { display: none; }
.archive-toolbar .button { min-height: 42px; margin: 0; }
.archive-summary { min-height: 1.2em; margin: .8rem 0 0; color: #789087; font-size: .72rem; }
#trend-chart { display: block; width: 100%; height: 310px; margin-top: 1rem; }
.switch-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.25rem 0; border-bottom: 1px solid var(--white-line); cursor: pointer; }
.switch-row span { min-width: 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: .2rem; color: #789087; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 48px; height: 27px; flex: 0 0 auto; border: 1px solid #52685f; border-radius: 999px; transition: .2s; }
.switch-row i::after { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: #7a8e85; transition: .2s; }
.switch-row input:checked + i { border-color: var(--lime); background: rgba(200,255,98,.14); }
.switch-row input:checked + i::after { transform: translateX(21px); background: var(--lime); }
.switch-row input:disabled + i { opacity: .38; }
.control-note { color: #71867d; font-size: .75rem; }
.thresholds form { margin-top: 1rem; }
.thresholds label { display: block; padding: 1rem 0; color: #b8c6c0; }
.thresholds label span { float: right; color: var(--lime); }
.thresholds input[type="range"] { width: 100%; margin-top: 1rem; accent-color: var(--lime); }
.thresholds .select-setting { border-top: 1px solid var(--white-line); }
.thresholds .select-setting select { float: right; min-width: 145px; }
.thresholds .select-setting small { display: block; clear: both; padding-top: .65rem; color: #71867d; line-height: 1.5; }
.thresholds .button { margin-top: .8rem; }
.system-log .panel-heading > span { color: #799086; font-size: .72rem; }
.system-log ol { margin: 1.2rem 0 0; padding: 0; list-style: none; }
.system-log li { display: grid; grid-template-columns: 82px 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--white-line); color: #bfcbc5; font-size: .83rem; }
.system-log time { color: #789087; }
.oled-remote { margin-top: 1rem; }
.oled-console { display: grid; grid-template-columns: minmax(330px, 1fr) 280px; gap: 2rem; align-items: center; margin-top: 1.5rem; }
.oled-console[hidden] { display: none; }
.oled-screen { width: min(100%, 640px); aspect-ratio: 2 / 1; padding: 5%; border: 12px solid #17211d; border-radius: 12px; background: #03131b; box-shadow: inset 0 0 35px rgba(52,197,255,.2), 0 0 20px rgba(52,197,255,.08); }
.oled-screen pre { margin: 0; color: #7ee7ff; font: clamp(.72rem,1.8vw,1.35rem)/1.25 "Courier New",monospace; white-space: pre-wrap; text-shadow: 0 0 7px rgba(126,231,255,.75); }
.oled-keypad { display: grid; grid-template-columns: repeat(3,58px); gap: .55rem; justify-content: center; }
.oled-keypad button { min-height: 52px; color: var(--lime); border: 1px solid #4b655a; border-radius: 8px; background: #0d291e; cursor: pointer; font-weight: 800; }
.oled-keypad button:hover,.oled-keypad button:focus-visible { border-color: var(--lime); background: #163729; }
.oled-keypad button[data-oled-key="up"] { grid-column: 2; }
.oled-keypad button[data-oled-key="left"] { grid-column: 1; grid-row: 2; }
.oled-keypad button[data-oled-key="ok"] { grid-column: 2; grid-row: 2; }
.oled-keypad button[data-oled-key="right"] { grid-column: 3; grid-row: 2; }
.oled-keypad button[data-oled-key="down"] { grid-column: 2; grid-row: 3; }
.oled-keypad small { grid-column: 1 / -1; color: #71867d; line-height: 1.45; text-align: center; }

@media (max-width: 1050px) {
    .hero { grid-template-columns: 1fr .72fr; }
    .hero-facts { grid-template-columns: 1fr; }
    .project-row { grid-template-columns: 55px 1fr 1.25fr; }
    .project-tags { grid-column: 2 / -1; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .device-strip { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 780px) {
    .site-header { min-height: 68px; }
    .menu-button { display: block; }
    .site-header nav { position: absolute; left: 0; right: 0; top: 68px; display: none; flex-direction: column; align-items: stretch; padding: 1.3rem; background: var(--paper); border-bottom: 1px solid var(--line); }
    .site-header nav.open { display: flex; }
    .site-header nav .nav-cta { text-align: center; }
    .hero { grid-template-columns: 1fr; }
    .hero-copy { padding: 5.5rem 1.25rem 3rem; }
    .hero h1 { font-size: clamp(3.5rem, 16vw, 5.8rem); }
    .hero-visual { min-height: 550px; }
    .hero-facts { grid-template-columns: repeat(3, 1fr); }
    .statement-grid, .featured-grid, .contact-grid, .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
    .architecture { grid-template-columns: 1fr; }
    .architecture > span { transform: rotate(90deg); justify-self: center; }
    .project-progress { grid-template-columns: repeat(2, 1fr); }
    .project-row { grid-template-columns: 40px 1fr; }
    .project-row > p, .project-tags { grid-column: 2; }
    .timeline { margin-left: 0; }
    .timeline article { grid-template-columns: 1fr; gap: .5rem; }
    .section-heading, .dashboard-title { align-items: start; flex-direction: column; }
    .dashboard-header { padding: 0 1rem; }
    .dashboard-actions .connection-status { display: none; }
    #trend-chart { height: 250px; }
    .archive-toolbar { align-items: stretch; }
    .archive-toolbar, .archive-toolbar .custom-range { flex-direction: column; }
    .archive-toolbar select, .archive-toolbar input, .archive-toolbar .button { width: 100%; }
    .oled-console { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .hero-facts, .metric-grid, .project-progress { grid-template-columns: 1fr; }
    .device-strip { grid-template-columns: repeat(2,1fr); }
    .hero-visual { min-height: 480px; }
    .engineering-mark { width: 82%; }
    .section-heading { margin-bottom: 2rem; }
    footer { flex-direction: column; }
    .dashboard { width: min(100% - 1rem, 1480px); }
    .dashboard-header .brand small { display: none; }
    .chart-legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

