/* bryceware.com
   Palette shared with Leo: paper, ink and one signal red.
   Type: IBM Plex Sans and Plex Mono (SIL OFL), self-hosted. */

@font-face { font-family: "Plex Sans"; src: url("/fonts/IBMPlexSans-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #fffef7; --ink: #0d0d0c; --accent: #ff1500; --surface: #f2f1ea;
  --muted: #73726f; --rule: #dddcd4; --soft: #40403e;
  --sage: #bbc6a9; --steel: #c1cbd9; --rose: #e1cbc8; --iris: #9ea5bf;
  --sans: "Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wide: 76rem; --measure: 40rem; --gut: clamp(1.1rem, 4vw, 2.5rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211; --ink: #f4f3ec; --accent: #ff4b3a; --surface: #1f1f1d;
    --muted: #9a9993; --rule: #33332f; --soft: #c9c8c1;
    --sage: #3a4232; --steel: #333a45; --rose: #45373a; --iris: #3a3d52;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gut) 5rem; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--paper); padding: 0.4rem 0.8rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

.label, .bar, .stamp, .meta, .chip, .figcap, th, .ledger td:first-child, kbd, code {
  font-family: var(--mono); }
.label { font-weight: 500; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; }

/* ---- top bar ---------------------------------------------------------- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; flex-wrap: wrap; padding: 0.9rem var(--gut); background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.mark { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; font-weight: 500;
  font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase; }
.mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.mark:hover svg path:nth-child(3) { stroke: var(--accent); }
.bar nav { display: flex; gap: 1.6rem; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; overflow-x: auto; }
.bar nav a { text-decoration: none; padding: 0.2rem 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.bar nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---- hero ------------------------------------------------------------- */
.hero { position: relative; min-height: min(72vh, 44rem); display: flex; align-items: flex-end;
  padding: 6rem var(--gut) 4.5rem; overflow: hidden; border-bottom: 1px solid var(--rule);
  /* without JS the field is a still row of ticks */
  background: repeating-linear-gradient(90deg, transparent 0 13px, var(--rule) 13px 14px) top / 100% 38% no-repeat; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero:has(canvas.live) { background: none; }
.hero-text { position: relative; max-width: 58rem; }
.hero h1 { font-weight: 300; font-size: clamp(2.3rem, 5.6vw, 4.9rem); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 1.4rem; }
.hero .lede { max-width: 36rem; font-size: 1.12rem; color: var(--soft); margin: 0; }
.hero .hero-text::before { content: ""; position: absolute; inset: -2rem -2.5rem -2rem -2.5rem; z-index: -1;
  background: radial-gradient(closest-side, var(--paper) 55%, transparent); }
.figcap { position: absolute; right: var(--gut); bottom: 1.2rem; margin: 0; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.06em; }

/* ---- page head -------------------------------------------------------- */
.page-head { width: 100%; max-width: var(--wide); margin: 0 auto; padding: clamp(3rem, 9vw, 6.5rem) var(--gut) 2.5rem; }
.page-head h1 { font-weight: 300; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 1.1rem; max-width: 50rem; }
.page-head .lede { font-size: 1.12rem; color: var(--soft); max-width: var(--measure); margin: 0; }

/* ---- running text ----------------------------------------------------- */
main > p, main > ul, main > ol, main > blockquote, .prose > * { max-width: var(--measure); }
main h2 { font-weight: 300; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.015em; line-height: 1.15;
  margin: 4.5rem 0 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--ink); display: flex; gap: 1.2rem; align-items: baseline; }
main h2 .n { font: 500 0.74rem var(--mono); letter-spacing: 0.14em; color: var(--accent); }
main h3 { font-weight: 600; font-size: 1.08rem; margin: 0 0 0.4rem; letter-spacing: -0.005em; }
main h4 { font: 500 0.74rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 0.6rem; }
main li { margin: 0.25rem 0; }
main li::marker { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }
code, kbd { font-size: 0.86em; background: var(--surface); padding: 0.08em 0.35em; border-radius: 4px; }
.meta { font-size: 0.76rem; color: var(--muted); letter-spacing: 0.04em; margin: 0 0 0.7rem; }
.chip { display: inline-block; font-size: 0.74rem; padding: 0.12rem 0.55rem; border: 1px solid currentColor;
  border-radius: 999px; margin: 0 0.25rem 0.35rem 0; letter-spacing: 0.02em; white-space: nowrap; }
.red { color: var(--accent); }
.muted { color: var(--muted); }

/* ---- intro split ------------------------------------------------------ */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 2rem 4rem; margin-top: 4rem; }
.intro > :first-child p { margin: 0; }
.intro p { margin: 0 0 1rem; font-size: 1.12rem; }
.intro .label { margin-top: 0.35rem; }

/* ---- selected work cards --------------------------------------------- */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.card { background: var(--paper); padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: 0.2rem; position: relative; }
.card.sage { background: color-mix(in srgb, var(--sage) 38%, var(--paper)); }
.card.steel { background: color-mix(in srgb, var(--steel) 42%, var(--paper)); }
.card.rose { background: color-mix(in srgb, var(--rose) 45%, var(--paper)); }
.card.iris { background: color-mix(in srgb, var(--iris) 30%, var(--paper)); }
.card h3 { font-weight: 300; font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0.3rem 0 0.7rem; }
.card p { margin: 0 0 0.9rem; }
.card .more { margin-top: auto; padding-top: 0.6rem; font: 500 0.76rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.card .more a { text-decoration: none; }
.card .more p { margin: 0; }
.card .more a::after { content: " →"; }
.card svg.scope { width: 100%; height: auto; margin: 0.4rem 0 1rem; }

/* scope trace (a sketch of the LT3083 transient) */
.scope .grid { stroke: var(--ink); stroke-opacity: 0.12; stroke-width: 1; }
.scope .axis { stroke: var(--ink); stroke-opacity: 0.45; stroke-width: 1; }
.scope .trace { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.scope .ref { stroke: var(--ink); stroke-dasharray: 3 4; stroke-opacity: 0.5; }
.scope text { font: 400 10px var(--mono); fill: var(--muted); }

/* ---- ledger (timeline / tables) -------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1rem; }
th { text-align: left; font-weight: 500; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--ink); padding: 0 1rem 0.5rem 0; }
td { padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger td:first-child { white-space: nowrap; font-size: 0.8rem; color: var(--muted); padding-top: 1.05rem; width: 9.5rem; }
.ledger td:nth-child(2) { font-weight: 600; }

/* ---- dark band -------------------------------------------------------- */
.band { margin: 5rem calc(50% - 50vw) 0; padding: 4.5rem max(var(--gut), calc(50vw - var(--wide) / 2 + var(--gut)));
  background: #0d0d0c; color: #f4f3ec; }
.band h2 { border-top-color: #f4f3ec; margin-top: 0; }
.band .label, .band .meta { color: #9a9993; }
.band a:hover { color: #ff4b3a; }
.bench { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2rem 3rem; }
.bench h4 { color: #9a9993; margin-top: 0; }
.bench ul { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 0.88rem; line-height: 1.9; }
.bench li { margin: 0; }
.bench li::before { content: "— "; color: #ff4b3a; }

/* ---- project entries -------------------------------------------------- */
.entries { border-top: 1px solid var(--rule); }
.entry { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.4rem 2.5rem; padding: 1.8rem 0; border-bottom: 1px solid var(--rule); }
.entry > .meta { margin: 0.2rem 0 0; line-height: 1.7; }
.entry > div > p { max-width: var(--measure); margin: 0 0 0.8rem; }
.entry > div > p:last-child { margin-bottom: 0; }
.status { color: var(--accent); }

/* ---- figures in research -------------------------------------------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); margin: 1.5rem 0 2rem; }
.figures > div { background: var(--paper); padding: 1.1rem 1.2rem; }
.figures .v { font-weight: 300; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.1; display: block; }
.figures .k { font: 400 0.72rem var(--mono); color: var(--muted); letter-spacing: 0.06em; display: block; margin-top: 0.35rem; }
figure { margin: 1.5rem 0 2rem; max-width: 46rem; }
figcaption { font: 400 0.74rem/1.5 var(--mono); color: var(--muted); margin-top: 0.6rem; }

/* ---- contact ---------------------------------------------------------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.contact > div { background: var(--paper); padding: 1.4rem 1.5rem; }
.contact .label { margin-bottom: 0.4rem; }
.contact a { font-size: 1.05rem; }

/* ---- Leo pages -------------------------------------------------------- */
.leo .page-head .label { color: var(--accent); }
.leo-mark { width: 84px; height: 84px; border-radius: 19px; margin-bottom: 1.6rem; }
.steps ol { counter-reset: s; list-style: none; padding: 0; max-width: var(--measure); }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 3rem; margin: 0 0 1rem; }
.steps li::before { content: "0" counter(s); position: absolute; left: 0; top: 0.15rem; font: 500 0.76rem var(--mono); color: var(--accent); letter-spacing: 0.1em; }
.qa dl { margin: 0; }
.qa dt { font-weight: 600; margin-top: 1.2rem; }
.qa dd { margin: 0.25rem 0 0; max-width: var(--measure); }
.button { display: inline-block; font: 500 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  padding: 0.7rem 1.1rem; border: 1px solid var(--ink); border-radius: 999px; margin-top: 1rem; }
.button:hover { background: var(--ink); color: var(--paper); }

/* ---- colophon swatches ------------------------------------------------ */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.8rem; margin: 1.2rem 0 2rem; }
.swatches > div { border: 1px solid var(--rule); }
.swatches i { display: block; height: 4.5rem; }
.swatches span { display: block; font: 400 0.72rem var(--mono); padding: 0.5rem 0.6rem; color: var(--muted); }

/* ---- footer ----------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding: 1.6rem var(--gut) 2rem; font-size: 0.86rem; }
.foot-row { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; align-items: baseline; max-width: var(--wide); margin: 0 auto; }
.foot-row .label { margin: 0; color: var(--ink); }
.foot a { color: var(--muted); }
.stamp { max-width: var(--wide); margin: 1rem auto 0; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em; }

/* ---- small screens ---------------------------------------------------- */
@media (max-width: 760px) {
  .intro, .work, .entry { grid-template-columns: minmax(0, 1fr); }
  .entry { gap: 0.3rem; }
  .hero { min-height: 82vh; padding-bottom: 3.5rem; }
  .figcap { left: var(--gut); right: auto; }
  .bar nav { gap: 1.1rem; width: 100%; }
  .ledger td:first-child { width: auto; }
}
@media print {
  .bar, .hero canvas, .foot .stamp, .skip { display: none; }
  .band { background: none; color: inherit; margin: 2rem 0; padding: 0; }
  html { font-size: 11pt; }
}


/* project entries: dates and status on the left */
.entry > .meta { font-size: 0.74rem; }
.entry > .meta span { display: block; }
.entry > .body > p { max-width: var(--measure); margin: 0 0 0.8rem; }
.entry > .body > p:last-child { margin-bottom: 0; }

/* the ? list */
.keys { border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 1.4rem 1.6rem 1.2rem; width: min(24rem, calc(100vw - 2rem)); }
.keys::backdrop { background: color-mix(in srgb, var(--paper) 70%, transparent); backdrop-filter: blur(2px); }
.keys dl { display: grid; gap: 0.3rem; margin: 0 0 1rem; }
.keys dl div { display: grid; grid-template-columns: 5.5rem 1fr; }
.keys dt { font: 500 0.82rem var(--mono); color: var(--accent); }
.keys dd { margin: 0; }
.keys button { font: 500 0.74rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; background: none; color: inherit;
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; }
.ledger td:nth-child(2) { width: 17rem; }
.ledger td:nth-child(3) { color: var(--soft); }
.intro > .cell:first-child .label { margin-top: 0.35rem; }
main ul + h3, main p + h3 { margin-top: 2.4rem; }
