:root {
  --ink: #12202b; --paper: #f5f8f7; --white: #fff;
  --teal: #0b8f8f; --teal-dark: #076b6b; --amber: #f2b134;
  --line: #d8e2e0; --muted: #53656e;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
.wrap { width: min(1060px, 92vw); margin: 0 auto; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 36em; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; }
nav { display: flex; gap: 6px; }
nav a { padding: 8px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover { background: var(--paper); }
nav a.active { background: var(--ink); color: var(--white); }
.menu-btn { display: none; font: inherit; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--white); cursor: pointer; }

/* buttons */
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 12px 22px; border: 2px solid var(--teal);
  border-radius: 10px; background: var(--teal); color: var(--white); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.alt { background: transparent; color: var(--teal-dark); }
.btn.alt:hover { background: var(--white); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.amber:hover { background: #ffc552; border-color: #ffc552; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* hero */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }

/* sections */
.section { padding: 56px 0; }
.page-head { padding: 56px 0 8px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 28px; }
.cols > div { border-top: 3px solid var(--teal); padding-top: 14px; }
.cols p { color: var(--muted); margin: 0; }
.band { background: var(--ink); color: var(--white); padding: 56px 0; }
.band-in p { color: #b9c9cf; max-width: 34em; margin: 0 0 24px; }

/* projects */
.project { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 28px 0; }
.project + .project { border-top: 1px solid var(--line); }
.project:nth-child(even) img { order: 2; }
.project img { border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.tags { color: var(--muted); font-size: .95rem; }

/* dashboard */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.led-box { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.led { width: 96px; height: 96px; border-radius: 50%; background: #c9d4d2; border: 4px solid #aebbb8;
  transition: background .25s, box-shadow .25s; }
.is-on .led { background: var(--amber); border-color: #d99a1c; box-shadow: 0 0 40px 10px rgba(242,177,52,.55); }
.led-box p { margin: 0 0 16px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0 0; }
.stats div { background: var(--paper); border-radius: 12px; padding: 16px 18px; }
.stats dt { color: var(--muted); font-size: .9rem; }
.stats dd { margin: 2px 0 0; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
#note { margin: 20px 0 0; min-height: 1.5em; color: var(--muted); }
#note.error { color: #b3261e; }

/* text pages */
.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.6em; }
code { background: var(--white); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* footer */
.site-footer { background: var(--ink); color: #b9c9cf; padding: 44px 0 20px; margin-top: 40px; }
.site-footer a { color: #b9c9cf; }
.site-footer strong { color: var(--white); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot p { margin: 8px 0 0; }
.copy { margin-top: 32px; padding-top: 16px; border-top: 1px solid #2c3d49; font-size: .9rem; }

/* phones */
@media (max-width: 760px) {
  .menu-btn { display: block; }
  nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 4vw 16px; }
  nav.open { display: flex; }
  .hero-grid, .project, .cols, .foot, .stats { grid-template-columns: 1fr; }
  .hero-grid > img { order: -1; max-width: 360px; margin: 0 auto; }
  .project:nth-child(even) img { order: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .led { transition: none; } }

/* recent readings table */
.sub { font-size: 1.2rem; margin: 32px 0 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .9rem; }
