/* Tlectric — a single-line-diagram sensibility: drawing-sheet grid, ink type,
   and the real IEC conductor colors (L1 brown, L2 black, L3 grey, N blue, PE green/yellow) as the signature detail. */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #15191f;
  --ink-soft: #4a5260;
  --line: #d9ddd6;
  --accent: #1f56c9;
  --accent-ink: #ffffff;
  --l1: #7a4a2a;
  --l2: #15191f;
  --l3: #8b9098;
  --n: #2b6fd6;
  --pe-g: #2f8a3e;
  --pe-y: #e2c21b;
  --ok: #2f7d45;
  --ok-bg: #e3f1e6;
  --wip: #8a5a00;
  --wip-bg: #f7ecd2;
  --grid: rgba(21, 25, 31, 0.045);

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101318; --surface: #171b22; --ink: #e9ecef; --ink-soft: #a3abb8;
    --line: #2a303a; --accent: #6f9bff; --accent-ink: #0d1117;
    --l1: #b07a52; --l2: #e9ecef; --l3: #8b9098; --n: #5a95f0;
    --ok: #7fd197; --ok-bg: #1b3122; --wip: #f0c36a; --wip-bg: #3a2f17;
    --grid: rgba(233, 236, 239, 0.04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101318; --surface: #171b22; --ink: #e9ecef; --ink-soft: #a3abb8;
  --line: #2a303a; --accent: #6f9bff; --accent-ink: #0d1117;
  --l1: #b07a52; --l2: #e9ecef; --l3: #8b9098; --n: #5a95f0;
  --ok: #7fd197; --ok-bg: #1b3122; --wip: #f0c36a; --wip-bg: #3a2f17;
  --grid: rgba(233, 236, 239, 0.04);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 72rem; margin: 0 auto; padding-inline: 1.25rem; }

/* conductor stripe — the brand mark */
.stripe { display: flex; height: 6px; }
.stripe span { flex: 1; }
.stripe .l1 { background: var(--l1); }
.stripe .l2 { background: var(--l2); }
.stripe .l3 { background: var(--l3); }
.stripe .n  { background: var(--n); }
.stripe .pe { background: repeating-linear-gradient(90deg, var(--pe-g) 0 10px, var(--pe-y) 10px 20px); }

/* header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 28px; height: 28px; }
.brand b { font-family: var(--f-display); font-weight: 800; font-stretch: 112%; font-size: 1.25rem; letter-spacing: -0.01em; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; }
.nav a:hover { color: var(--ink); }

/* type */
.eyebrow { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 800; font-stretch: 115%; line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 750; font-stretch: 110%; line-height: 1.1; letter-spacing: -0.015em; }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 38rem; }

/* sections */
section { padding-block: 4.5rem; border-top: 1px solid var(--line); }
.sec-head { display: grid; gap: 0.75rem; margin-bottom: 2.25rem; max-width: 44rem; }

/* hero */
.hero { padding-block: 4rem 3.5rem; border-top: 0; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero-copy { display: grid; gap: 1.4rem; min-width: 0; }
.cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: 0.75rem 1.2rem; font-weight: 600; text-decoration: none; border-radius: 4px; font-size: 0.95rem; border: 1px solid var(--ink); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn:hover { transform: translateY(-1px); }

.scope { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1rem 0.75rem; min-width: 0; }
.scope-bar { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 0.5rem; }
.scope svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-soft); padding-top: 0.6rem; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 0.35rem; }

/* apps */
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.app { background: var(--surface); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.app-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.tag { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.chip { font-family: var(--f-mono); font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 99px; white-space: nowrap; }
.chip.ok { color: var(--ok); background: var(--ok-bg); }
.chip.wip { color: var(--wip); background: var(--wip-bg); }
.app p { color: var(--ink-soft); font-size: 0.95rem; }
.app ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.9rem; }
.app .meta { margin-top: auto; padding-top: 0.6rem; border-top: 1px dashed var(--line); font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-soft); display: flex; gap: 1rem; flex-wrap: wrap; }

/* tools */
.tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tool { border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem; background: var(--surface); display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.tool code { font-family: var(--f-mono); font-size: 0.8rem; color: var(--accent); }
.tool p { color: var(--ink-soft); font-size: 0.9rem; }

/* engineering */
.eng { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3rem; }
.eng div { display: grid; gap: 0.5rem; padding-left: 1rem; border-left: 3px solid var(--line); min-width: 0; }
.eng div:nth-child(1) { border-color: var(--l1); }
.eng div:nth-child(2) { border-color: var(--l2); }
.eng div:nth-child(3) { border-color: var(--l3); }
.eng div:nth-child(4) { border-color: var(--n); }
.eng p { color: var(--ink-soft); }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 3rem; align-items: start; }
.about-copy { display: grid; gap: 1rem; min-width: 0; }
.about-copy p { color: var(--ink-soft); max-width: 36rem; }
.record { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; overflow: hidden; }
.record div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 0.8rem 1rem; border-top: 1px solid var(--line); font-size: 0.93rem; }
.record div:first-child { border-top: 0; }
.record dt { font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); padding-top: 0.15rem; }
.record dd { margin: 0; }

/* contact */
.contact { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.mail { font-family: var(--f-display); font-weight: 750; font-stretch: 110%; font-size: clamp(1.4rem, 4vw, 2.4rem); color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--accent); word-break: break-word; }

/* footer */
footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: 0.88rem; color: var(--ink-soft); }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
footer a { color: var(--ink-soft); }

/* legal pages */
.doc { max-width: 46rem; padding-block: 3.5rem 4.5rem; display: grid; gap: 1.1rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); }
.doc h2 { font-size: 1.35rem; margin-top: 1.6rem; }
.doc h3 { font-size: 1.05rem; margin-top: 0.6rem; }
.doc p, .doc li { color: var(--ink-soft); }
.doc ul, .doc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.doc .note { border: 1px solid var(--line); border-left: 3px solid var(--n); background: var(--surface); padding: 1rem 1.1rem; border-radius: 4px; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.tbl table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: 0.9rem; }
.tbl th, .tbl td { text-align: left; padding: 0.65rem 0.8rem; border-top: 1px solid var(--line); vertical-align: top; }
.tbl th { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); border-top: 0; }

@media (max-width: 900px) {
  .hero .wrap, .about { grid-template-columns: minmax(0, 1fr); }
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .apps, .tools, .eng { grid-template-columns: minmax(0, 1fr); }
  section { padding-block: 3.25rem; }
  .nav { gap: 0.9rem; }
  .record div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
