/* Samuel Braun: personal site. Charcoal, one red, Calibri. */
/* Calibri where the visitor has it (Windows); otherwise Carlito, a free font with the same letter widths
   (SIL Open Font License, see fonts/OFL.txt). */
@font-face { font-family: "Calibri"; font-weight: 400; font-display: swap; src: local("Calibri"), url("fonts/Carlito-Regular.ttf") format("truetype"); }
@font-face { font-family: "Calibri"; font-weight: 700; font-display: swap; src: local("Calibri Bold"), url("fonts/Carlito-Bold.ttf") format("truetype"); }

:root {
  --bg: #17181a; --panel: #1f2023; --panel-2: #26272b; --dot: #2a2b2f; --line: #33353a;
  --text: #c9c9c5; --bright: #f5f5f2; --muted: #8e8f8b; --red: #e0383e; --red-dim: #b32b30;
  --w: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 19px/1.65 Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 32px; }
.dots { background-image: radial-gradient(var(--dot) 1px, transparent 1.4px); background-size: 8px 8px; }

/* navigation */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(23, 24, 26, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; height: 64px; }
.nav .name { font-weight: 700; color: var(--bright); font-size: 20px; letter-spacing: .01em; }
.nav .name span { color: var(--red); }
.nav nav { margin-left: auto; display: flex; align-items: center; gap: 32px; font-size: 17px; }
.nav nav a { color: var(--muted); transition: color .15s; }
.nav nav a:hover { color: var(--bright); }

/* buttons */
.btn { display: inline-block; padding: 12px 26px; border-radius: 4px; font-weight: 700; font-size: 18px; border: 2px solid var(--red); background: var(--red); color: #fff; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.btn:hover { background: var(--red-dim); border-color: var(--red-dim); transform: translateY(-1px); }
.btn.line { background: transparent; color: var(--bright); border-color: var(--line); }
.btn.line:hover { border-color: var(--red); color: #fff; background: transparent; }
.nav .btn { padding: 7px 18px; font-size: 16px; }

/* opening */
.hero { border-bottom: 3px solid var(--red); }
.hero .wrap { min-height: calc(100vh - 67px); display: flex; flex-direction: column; justify-content: center; padding-top: 72px; padding-bottom: 88px; }
.eyebrow { font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); font-weight: 700; margin: 0 0 20px; }
.hero h1 { font-size: clamp(60px, 10.5vw, 148px); line-height: .95; font-weight: 700; color: var(--bright); margin: 0 0 28px; letter-spacing: -.025em; }
.hero .lede { font-size: clamp(21px, 2.2vw, 28px); line-height: 1.4; color: var(--text); max-width: 26em; margin: 0 0 40px; }
.hero .lede b { color: var(--bright); font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* section headings */
section { padding: 104px 0; }
.sec-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(34px, 4vw, 48px); line-height: 1.1; color: var(--bright); margin: 0; letter-spacing: -.015em; }
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }
.sec-head .count { color: var(--muted); font-size: 16px; }

/* capabilities */
.caps { background: var(--panel); border-bottom: 1px solid var(--line); }
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.cap { padding: 8px 36px 8px 0; }
.cap + .cap { padding-left: 36px; border-left: 1px solid var(--line); }
.cap .num { color: var(--red); font-weight: 700; font-size: 15px; letter-spacing: .14em; }
.cap h3 { font-size: 27px; color: var(--bright); margin: 10px 0 10px; }
.cap p { margin: 0; }

/* project cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--red); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.card .shot { aspect-ratio: 16 / 10; background: var(--panel-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.card .shot img, .card .shot svg { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .shot img { transform: scale(1.03); }
.card .body { padding: 28px 30px 30px; display: flex; flex-direction: column; flex: 1; }
.tagline { font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 700; margin: 0 0 10px; }
.card h3 { font-size: 29px; line-height: 1.2; color: var(--bright); margin: 0 0 12px; }
.card p { margin: 0 0 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.tags li { font-size: 15px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: var(--bg); }
.more { margin-top: auto; color: var(--bright); font-weight: 700; }
.more::after { content: " →"; color: var(--red); transition: margin .15s; }
.card:hover .more::after { margin-left: 6px; }

/* a card with no photo: the panel's three voltages in large type */
.card .shot.type { display: flex; flex-direction: column; justify-content: center; padding: 0 34px; background-color: var(--panel-2); }
.card .shot.type div { display: flex; gap: 22px; align-items: baseline; flex-wrap: nowrap; white-space: nowrap; }
.card .shot.type b { font-size: clamp(26px, 3.3vw, 44px); line-height: 1; color: var(--bright); letter-spacing: -.02em; }
.card .shot.type b + b { padding-left: 22px; border-left: 2px solid var(--red); }
.card .shot.type span { margin-top: 18px; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* contact */
.contact { background: var(--panel); border-top: 3px solid var(--red); }
.contact h2 { font-size: clamp(40px, 6vw, 76px); line-height: 1; color: var(--bright); margin: 0 0 16px; letter-spacing: -.02em; }
.contact p { font-size: 22px; max-width: 30em; margin: 0 0 36px; }
.fine { color: var(--muted); font-size: 15px; padding: 28px 0; border-top: 1px solid var(--line); margin: 0; }

/* project pages */
.p-head { border-bottom: 3px solid var(--red); padding: 72px 0 0; }
.back { color: var(--muted); font-size: 16px; display: inline-block; margin-bottom: 36px; transition: color .15s; }
.back:hover { color: var(--bright); }
.p-head h1 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.04; color: var(--bright); margin: 0 0 24px; letter-spacing: -.02em; max-width: 16em; }
.p-head .lede { font-size: 23px; line-height: 1.5; max-width: 34em; margin: 0 0 48px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.facts div { padding: 22px 24px 26px 0; }
.facts div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.facts dt { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; color: var(--bright); font-size: 20px; }

.lead-img { margin: 64px auto 0; }
.lead-img img, .lead-img svg { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.cap-text { font-size: 15px; color: var(--muted); margin-top: 10px; }

.rows { padding: 40px 0 24px; }
.row { display: grid; grid-template-columns: 280px 1fr; gap: 48px; padding: 40px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row h2 { font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin: 6px 0 0; position: sticky; top: 96px; align-self: start; }
.row .txt { max-width: 40em; }
.row p { margin: 0 0 16px; }
.row p:last-child, .row ul:last-child { margin-bottom: 0; }
.row ul { margin: 0 0 16px; padding-left: 22px; }
.row li { margin: 6px 0; }
.row li::marker { color: var(--red); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0 8px; }
.pair figure, .wide { margin: 0; }
.pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.wide { margin: 28px 0 8px; }
.wide img { width: 100%; border: 1px solid var(--line); border-radius: 6px; }

/* long project pages: grouped sections with a contents strip */
.lead-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 64px 0 0; }
.lead-pair figure { margin: 0; }
.lead-pair img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.toc { position: sticky; top: 65px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; margin: 48px -32px 0; padding: 12px 32px; background: rgba(23, 24, 26, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 16px; scrollbar-width: none; }
.toc a { color: var(--muted); white-space: nowrap; padding: 4px 12px; border-radius: 999px; transition: color .15s, background .15s; }
.toc a:hover { color: var(--bright); background: var(--panel-2); }
.group { padding: 88px 0 8px; scroll-margin-top: 110px; }
.group .sec-head { margin-bottom: 8px; }
.group .row { border-top: 0; padding: 32px 0; }
.group .row + .row { border-top: 1px solid var(--line); }
.group .row h3 { font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin: 6px 0 0; position: sticky; top: 130px; align-self: start; }
.group > .wide { margin: 32px 0 16px; }
.row ol { margin: 0 0 16px; padding-left: 24px; } .row ol li { margin: 8px 0; padding-left: 4px; } .row ol li::marker { color: var(--red); font-weight: 700; }
.row b { color: var(--bright); }
.tlink { color: var(--bright); border-bottom: 2px solid var(--red); padding-bottom: 1px; transition: color .15s; }
.tlink:hover { color: var(--red); }
.quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 28px 0 8px; } .quad figure { margin: 0; }
.quad img { width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 8px; } .trio figure { margin: 0; }
.pair.screen img { aspect-ratio: 16 / 9; }
.paper img { background: #fff; object-fit: contain; padding: 8px; }
video { width: 100%; aspect-ratio: 406 / 720; object-fit: contain; background: #000; border: 1px solid var(--line); border-radius: 6px; display: block; }
.pair.v { max-width: 600px; } .pair.v img { aspect-ratio: 406 / 720; }
.stack { display: grid; gap: 20px; margin: 28px 0 8px; } .stack figure { margin: 0; } .stack img { width: 100%; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; margin: 24px 0 8px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
td.n, th.n { text-align: right; }
tfoot td { color: var(--bright); font-weight: 700; border-bottom: 0; border-top: 2px solid var(--red); }
.volts h4 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; font-weight: 400; }

/* gate-voltage comparison */
.volts { margin: 28px 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 24px 26px; }
.volts h3 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; font-weight: 400; }
.bar { display: grid; grid-template-columns: 190px 1fr 70px; align-items: center; gap: 16px; margin: 12px 0; font-size: 17px; }
.bar .track { height: 14px; background: var(--panel-2); border-radius: 2px; position: relative; }
.bar .fill { height: 100%; background: var(--muted); border-radius: 2px; }
.bar.new .fill { background: var(--red); }
.bar .track::after { content: ""; position: absolute; left: 26.7%; top: -5px; bottom: -5px; width: 2px; background: var(--bright); } /* 3.2 V of 12 V */
.bar b { color: var(--bright); text-align: right; }
.volts .note { font-size: 15px; color: var(--muted); margin: 16px 0 0; }

.next { border-top: 1px solid var(--line); padding: 56px 0 88px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.next a.big { font-size: clamp(26px, 3.4vw, 40px); color: var(--bright); font-weight: 700; }
.next a.big:hover { color: var(--red); }
.next span { display: block; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* diagram */
.dg text { font-family: Calibri, Carlito, Arial, sans-serif; fill: var(--text); font-size: 15px; }
.dg .h { fill: var(--bright); font-weight: 700; font-size: 16px; }
.dg .s { fill: var(--muted); font-size: 13px; }
.dg .box { fill: #26272b; stroke: #4a4c52; stroke-width: 1.5; }
.dg .red { stroke: var(--red); }
.dg .wire { stroke: #6d6f75; stroke-width: 2; fill: none; }
.dg .net { stroke: var(--bright); stroke-width: 2; fill: none; }
.dg .safe { stroke: var(--red); stroke-width: 2; fill: none; stroke-dasharray: 7 5; }

@media (max-width: 860px) {
  body { font-size: 18px; }
  section { padding: 72px 0; }
  .cap-grid, .cards, .pair, .lead-pair { grid-template-columns: 1fr; }
  .quad { grid-template-columns: 1fr 1fr; } .group .row h3 { position: static; } .toc { margin: 32px -22px 0; padding: 10px 22px; }
  .cap, .cap + .cap { padding: 24px 0; border-left: 0; } .cap + .cap { border-top: 1px solid var(--line); }
  .row { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; } .row h2 { position: static; }
  .facts { grid-template-columns: 1fr; } .facts div, .facts div + div { padding: 16px 0; border-left: 0; } .facts div + div { border-top: 1px solid var(--line); }
  .nav nav a:not(.btn) { display: none; }
  .bar { grid-template-columns: 1fr 60px; } .bar .track { grid-column: 1 / -1; order: 3; }
  .wrap { padding: 0 22px; }
}

.pair.free { align-items: start; }
pre { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 6px; padding: 18px 22px; margin: 20px 0 8px; overflow-x: auto; }
code { font: 15px/1.55 "SF Mono", Menlo, Consolas, monospace; color: var(--bright); }

.rows .row h2 + .txt table td:first-child { color: var(--bright); white-space: nowrap; padding-right: 28px; vertical-align: top; }
.rows .row td { vertical-align: top; }
