/* Portable Labs — studio.css
   Riso print on a blue cutting board: two spot inks (Federal Blue, Forge Orange)
   overprinted with multiply on cool paper. One bold move: the misregistered hero. */

:root {
  --paper: #EFEFEA;
  --paper-2: #E2E2DA;
  --blue: #2743D3;
  --forge: #FF5704;
  --forge-text: #BF3C00; /* forge darkened for small type on paper (AA) */
  --ink: #1D1B2B;        /* blue x orange overprint, used for text */
  --muted: #5B5A66;
  --rule: rgba(39, 67, 211, .14);
  --board: var(--blue);           /* surface behind the sheet */
  --on-board: var(--paper);
  --tab: #4A62DC;
  --tab-2: #3A54D8;
  --grain: .22;
  --blend: multiply;              /* how the two inks overprint */

  --display: "Anybody", "Arial Narrow", sans-serif;
  --text: "Newsreader", Georgia, serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--text);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--forge); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--forge); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: .95; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Board layout ---------- */
.board {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gutter) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "mast mast" "sheet tabs" "foot foot";
}

.masthead {
  grid-area: mast;
  display: flex; flex-wrap: wrap; gap: .75rem 2rem;
  justify-content: space-between; align-items: center;
  padding: 1.5rem 0;
  color: var(--on-board);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark {
  width: 22px; height: 26px; background: var(--on-board);
  -webkit-mask: url(../../PortableLabsLogo_Egg.png) center / contain no-repeat;
          mask: url(../../PortableLabsLogo_Egg.png) center / contain no-repeat;
}
.brand-name { font: 700 1.05rem/1 var(--display); font-variation-settings: "wdth" 120; letter-spacing: -.01em; }
.mast-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.views { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.views-label { font-style: italic; font-size: .95rem; margin-right: .4rem; opacity: .85; }
.views select, .social a {
  font: 600 .85rem/1 var(--display); font-variation-settings: "wdth" 90;
  color: inherit; background: transparent;
  border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 4px;
  padding: .45rem .6rem; cursor: pointer; text-decoration: none;
}
.views select:hover, .social a:hover { border-color: currentColor; }
.views select { appearance: none; padding-right: 1.6rem; background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27%3E%3Cpath d=%27M0 0h10L5 6z%27 fill=%27%23888%27/%3E%3C/svg%3E") no-repeat right .55rem center; }
.views option { color: #1A1A1A; background: #FFFFFF; }
.social { display: flex; gap: 4px; }
.social a { display: inline-flex; align-items: center; gap: .45rem; }
.social svg { width: 1rem; height: 1rem; fill: currentColor; }
.contact-side .social { margin-top: .4rem; color: var(--ink); }

/* ---------- Index tabs ---------- */
.tabs {
  grid-area: tabs;
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 3rem;
  position: sticky; top: 1rem; align-self: start;
}
.tabs a {
  writing-mode: vertical-rl;
  font: 600 1rem/1 var(--display); font-variation-settings: "wdth" 90;
  text-decoration: none;
  padding: 1.1rem .7rem;
  background: var(--tab);
  color: var(--on-board);
  border-radius: 0 8px 8px 0;
  margin-left: 0;
  transition: background .2s, color .2s, padding .2s;
}
.tabs a:nth-child(even) { background: var(--tab-2); }
.tabs a:hover { background: var(--forge); }
.tabs a[aria-current="page"] {
  background: var(--paper); color: var(--ink);
  padding-right: 1rem;          /* active tab pulls further out, like a raised divider */
}

/* ---------- Sheet ---------- */
.sheet {
  grid-area: sheet;
  position: relative;
  background: var(--paper);
  border-radius: 8px 0 8px 8px;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  min-height: 80vh;
  isolation: isolate;
  overflow: hidden;
}
/* Paper grain, printed over everything */
.sheet::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .1 0 0 0 0 .2 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain);
  mix-blend-mode: var(--blend);
}

.js .panel:not(.is-open) { display: none; }
html:not(.js) .panel + .panel { margin-top: 6rem; }
.panel:focus { outline: none; }

.panel-head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 42rem; }
.panel-head h2 {
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 800; font-variation-settings: "wdth" 70;
  color: var(--blue);
}
.panel-head p { font-size: 1.2rem; color: var(--muted); max-width: 36em; }

/* ---------- Riso headline (the one bold move) ---------- */
.riso {
  --dx: 7px; --dy: 5px; --w: 105;
  position: relative;
  font-size: clamp(3.2rem, 12.4vw, 12rem);
  font-weight: 850;
  font-variation-settings: "wdth" var(--w);
  line-height: .84;
  letter-spacing: -.035em;
  color: var(--blue);
  margin: 0 0 clamp(2rem, 6vw, 4rem) -.04em;
}
.riso::after {
  content: attr(data-text);
  white-space: pre;
  position: absolute; left: 0; top: 0;
  color: transparent;
  /* orange plate printed as a halftone screen, so the overprint stays readable */
  background: radial-gradient(circle, var(--forge) 45%, transparent 48%) 0 0 / 6px 6px;
  -webkit-background-clip: text; background-clip: text;
  mix-blend-mode: var(--blend);
  transform: translate(var(--dx), var(--dy));
  pointer-events: none;
}
.riso.is-printing::after { animation: register .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes register {
  from { transform: translate(38px, -22px); opacity: 0; }
  40% { opacity: 1; }
}

/* ---------- Lab panel ---------- */
.lab-grid {
  display: grid; gap: 2.5rem 4rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
}
.lede { font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.4; max-width: 28em; }
.bench { margin: 0; display: grid; gap: 1.1rem; }
.bench div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule); }
.bench dt { font: 600 .95rem/1.5 var(--display); font-variation-settings: "wdth" 80; color: var(--forge-text); }
.bench dd { margin: 0; font-size: 1.05rem; line-height: 1.45; }
.lab-foot {
  margin-top: clamp(3rem, 7vw, 5rem);
  display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: end; justify-content: space-between;
}
.lab-foot p { max-width: 34em; color: var(--muted); }

.btn {
  display: inline-block;
  font: 700 1.05rem/1 var(--display); font-variation-settings: "wdth" 110;
  background: var(--forge); color: var(--ink);
  border: 0; border-radius: 4px; cursor: pointer;
  padding: 1rem 1.4rem;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--blue);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--blue); text-decoration: none; }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--blue); }

/* ---------- Projects: an index, one row per project ----------
   Rows respond to the list's own width (container queries), so they reflow the
   same way on a phone, a narrow window or a zoomed-in laptop. */
.proj-list { list-style: none; margin: 0; padding: 0; container-type: inline-size; border-bottom: 1px solid var(--rule); }
.proj {
  --plate-col: clamp(8rem, 24%, 15rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) var(--plate-col);
  grid-template-areas: "main desc plate";
  gap: 1rem clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) 0;
  border-top: 1px solid var(--rule);
}
.proj-main { grid-area: main; display: grid; gap: .5rem; justify-items: start; }
.proj h3 { font-size: clamp(1.35rem, 3.6cqi, 2.4rem); font-weight: 800; font-variation-settings: "wdth" 75; overflow-wrap: break-word; } /* cqi: sized to the list, so names fit their column at any zoom */
.proj h3 a { text-decoration: none; }
.proj h3 a:hover { color: var(--blue); }
.proj-desc { grid-area: desc; display: grid; gap: .9rem; justify-items: start; max-width: 34em; }
.proj .plate { grid-area: plate; width: 100%; }
.proj-flag { padding-block: clamp(1.75rem, 4vw, 3rem); }
.proj-flag h3 { font-size: clamp(2.2rem, 7.5cqi, 4.8rem); font-variation-settings: "wdth" 115; }

@container (max-width: 44rem) {
  .proj { grid-template-columns: minmax(0, 1fr) var(--plate-col); grid-template-areas: "main plate" "desc desc"; }
  .proj { --plate-col: clamp(6rem, 32%, 11rem); }
}
@container (max-width: 26rem) {
  .proj { grid-template-columns: minmax(0, 1fr); grid-template-areas: "plate" "main" "desc"; }
  .proj .plate { aspect-ratio: 16 / 9; }
}

.plate {
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
}
.plate svg { display: block; width: 100%; height: 100%; }
.plate svg g { mix-blend-mode: var(--blend); }

.status { display: inline-flex; align-items: center; gap: .5rem; font: 600 .9rem/1 var(--display); font-variation-settings: "wdth" 85; }
.status::before { content: ""; width: .7em; height: .7em; border-radius: 1px; }
.status-live::before { background: var(--forge); }
.status-build::before { background: var(--blue); }
.status-private::before { box-shadow: inset 0 0 0 1.5px var(--ink); }
.subhead { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; font-variation-settings: "wdth" 75; color: var(--blue); margin: clamp(4rem, 8vw, 6rem) 0 .6rem; padding-top: 2rem; border-top: 2px solid var(--ink); }
.subhead-note { color: var(--muted); margin-bottom: clamp(2rem, 4vw, 3rem); }
.open-app { justify-self: start; margin-top: .3rem; font: 700 1rem/1 var(--display); font-variation-settings: "wdth" 100; color: var(--blue); text-decoration: none; padding: .6rem .8rem; border: 1.5px solid var(--blue); border-radius: 4px; }
.open-app:hover { background: var(--blue); color: var(--paper); text-decoration: none; }


/* ---------- Cases ---------- */
.case { padding: clamp(2rem, 4vw, 3rem) 0; border-top: 1px solid var(--rule); }
.case h3 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); font-variation-settings: "wdth" 80; font-weight: 750; max-width: 16em; margin-bottom: 1rem; }
.case-hook { font-style: italic; font-size: clamp(1.15rem, 2vw, 1.4rem); color: var(--muted); max-width: 34em; margin-bottom: 2rem; }
.case-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 4.5rem); }
.case h4 { font: 700 1rem/1.4 var(--display); font-variation-settings: "wdth" 85; color: var(--forge-text); margin: 1.2rem 0 .3rem; letter-spacing: 0; }
.case h4:first-child { margin-top: 0; }
.case-cols > div > p { max-width: 36em; }
.figures { margin: 0; display: grid; gap: 1.5rem; align-content: start; }
.figures dt { font-size: .95rem; color: var(--muted); }
.figures dd {
  margin: .2rem 0 0;
  font: 800 clamp(1.9rem, 3.6vw, 2.8rem)/1 var(--display); font-variation-settings: "wdth" 75;
  color: var(--blue); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.figures dd span { font: italic 400 1.1rem var(--text); color: var(--forge-text); padding: 0 .15em; letter-spacing: 0; }
.figures dd a { text-decoration: none; }

/* ---------- CV ---------- */
.cv-figures {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1.5rem clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.cv-figures div { display: flex; flex-direction: column; justify-content: space-between; } /* numbers share a baseline even when labels wrap */
.cv-figures dd { font-size: clamp(2.4rem, 4.6vw, 3.6rem); }
.cv-roles { list-style: none; margin: 0; padding: 0; }
.cv-roles li {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .4rem 2rem;
  padding: 1.8rem 0; border-top: 1px solid var(--rule);
}
.cv-when { font-style: italic; color: var(--muted); padding-top: .3rem; }
.cv-roles h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 750; font-variation-settings: "wdth" 85; }
.cv-org { font: 600 1rem/1.4 var(--display); font-variation-settings: "wdth" 85; color: var(--forge-text); margin: .4rem 0 .6rem; }
.cv-roles li p:last-child { max-width: 40em; }
.cv-foot {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 2.5rem);
  padding-top: 2rem; border-top: 2px solid var(--ink);
}
.cv-foot h3 { font-size: 1.2rem; font-weight: 750; font-variation-settings: "wdth" 90; margin-bottom: .7rem; }
.cv-foot ul { margin: 0; padding-left: 1.1rem; }
.cv-foot li { padding: .15rem 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem clamp(2rem, 6vw, 5rem); }
#contact-form { display: grid; gap: 1.6rem; max-width: 36rem; justify-items: start; }
.f { display: grid; gap: .35rem; width: 100%; }
.f > span { font: 600 1rem/1.2 var(--display); font-variation-settings: "wdth" 90; }
.f small { font: italic 400 .95rem var(--text); color: var(--muted); }
.f input, .f textarea {
  font: inherit; color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 2px solid var(--blue); border-radius: 0;
  padding: .45rem 0;
  resize: vertical;
}
.f input:focus, .f textarea:focus { outline: none; border-bottom-color: var(--forge); background: rgba(255, 87, 4, .05); }
.f.has-error input, .f.has-error textarea { border-bottom-color: var(--forge); }
.f-err { font-size: .95rem; color: #B23A00; }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.6em; font-style: italic; }
.contact-side { display: grid; gap: .8rem; align-content: start; color: var(--muted); }
.contact-side .mail { font: 700 clamp(1.3rem, 2.4vw, 1.7rem)/1.1 var(--display); font-variation-settings: "wdth" 75; color: var(--blue); overflow-wrap: anywhere; margin-bottom: 1.2rem; }

/* ---------- Footer ---------- */
.colophon {
  grid-area: foot;
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
  padding: 1.5rem 0 0; color: var(--on-board); font-size: .95rem; opacity: .9;
}
.colophon a { margin-left: 1.25rem; }

/* ---------- Panel entrance: the sheet re-registers when you switch tabs ---------- */
.panel.is-open { animation: sheet-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Top-tab layout: narrow screens, and views that want a menu bar.
   data-layout is set by the inline script in <head> and kept in sync by studio.js. ---------- */
[data-layout="top"] .board { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mast" "tabs" "sheet" "foot"; }
[data-layout="top"] .tabs {
  flex-direction: row; gap: 4px; padding-top: 0; position: static; align-items: end;
  overflow-x: auto; scrollbar-width: none;
}
[data-layout="top"] .tabs a { writing-mode: horizontal-tb; border-radius: 8px 8px 0 0; padding: .8rem 1rem; flex: none; }
[data-layout="top"] .tabs a[aria-current="page"] { padding-right: 1rem; padding-top: 1rem; }
[data-layout="top"] .sheet { border-radius: 0 8px 8px 8px; }

@media (max-width: 820px) {
  .lab-grid, .case-cols, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .bench div { grid-template-columns: 1fr; gap: .2rem; }
  .cv-roles li { grid-template-columns: minmax(0, 1fr); }
  .riso { font-size: 14.5vw; }
}

/* =====================================================================
   VIEWS. Same content, different print process. Each view swaps the
   tokens above, then overrides only what its medium changes.
   ===================================================================== */

/* ---------- Dark: the riso inks glowing on a night screen ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15182B; --paper-2: #1E2238;
  --blue: #8193FF; --forge: #FF6A1F; --forge-text: #FF8F55;
  --ink: #E9E8F0; --muted: #A3A4B8; --rule: rgba(129, 147, 255, .2);
  --board: #07091A; --on-board: #E9E8F0; --tab: #1B1F36; --tab-2: #171A2E;
  --grain: .5; --blend: screen;
}
[data-theme="dark"] .sheet::after { mix-blend-mode: overlay; filter: invert(1); opacity: .12; }
[data-theme="dark"] .riso { text-shadow: 0 0 60px rgba(129, 147, 255, .35); }
[data-theme="dark"] .riso.is-printing::after { animation: glow-in 1.4s ease-out both; }
[data-theme="dark"] .panel.is-open { animation: blur-in .6s ease-out both; }
[data-theme="dark"] .btn { color: #140A04; box-shadow: 4px 4px 0 var(--blue); }
@keyframes glow-in { from { opacity: 0; filter: blur(14px); } }
@keyframes blur-in { from { opacity: 0; filter: blur(6px); } }

/* ---------- B&W: photocopied zine. One toner, hard edges. ---------- */
[data-theme="bw"] {
  --paper: #FFFFFF; --paper-2: #F0F0F0;
  --blue: #000000; --forge: #000000; --forge-text: #000000;
  --ink: #000000; --muted: #3D3D3D; --rule: rgba(0, 0, 0, .3);
  --board: #000000; --on-board: #FFFFFF; --tab: #000000; --tab-2: #000000;
  --grain: .45; --blend: multiply;
}
[data-theme="bw"] .tabs a { box-shadow: inset 0 0 0 1.5px #FFFFFF; }
[data-theme="bw"] .tabs a:hover { background: #FFFFFF; color: #000000; }
[data-theme="bw"] .plate svg g:last-child { opacity: .4; }
[data-theme="bw"] .btn { background: #000000; color: #FFFFFF; box-shadow: 4px 4px 0 #9A9A9A; }
[data-theme="bw"] .riso.is-printing, [data-theme="bw"] .panel.is-open { animation: xerox .7s linear both; }
@keyframes xerox { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Minimal: white page, one serif, nothing decorative ---------- */
[data-theme="minimal"] {
  --paper: #FFFFFF; --paper-2: #F4F4F4;
  --blue: #1A1A1A; --forge: #FF5704; --forge-text: #1A1A1A;
  --ink: #1A1A1A; --muted: #6B6B6B; --rule: #E4E4E4;
  --board: #FFFFFF; --on-board: #1A1A1A; --tab: transparent; --tab-2: transparent;
  --grain: 0; --blend: normal;
  --display: "Newsreader", Georgia, serif;
}
[data-theme="minimal"] :is(h1, h2, h3, h4, .brand-name, .btn, .tabs a, .status, .views select, .social a, .f > span, .figures dd) {
  font-weight: 400; font-variation-settings: normal; letter-spacing: -.01em;
}
[data-theme="minimal"] .riso { font-size: clamp(3rem, 8vw, 6.5rem); line-height: 1; }
[data-theme="minimal"] .riso::after, [data-theme="minimal"] .plate { display: none; }
[data-theme="minimal"] .panel-head h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
[data-theme="minimal"] .proj { --plate-col: 0px; }
[data-theme="minimal"] .tabs a { padding: .6rem .9rem .6rem 0; font-size: 1.05rem; color: var(--muted); }
[data-theme="minimal"] .tabs a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: .35em; padding-top: .6rem; }
[data-theme="minimal"] .tabs a:hover { background: none; color: var(--ink); }
[data-theme="minimal"] .sheet { padding-inline: 0; border-radius: 0; }
[data-theme="minimal"] .btn { background: none; border: 1px solid var(--ink); box-shadow: none; }
[data-theme="minimal"] .btn:hover { background: var(--ink); color: var(--paper); transform: none; }
[data-theme="minimal"] .panel.is-open { animation: fade .3s ease-out both; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Terminal: a TUI on a phosphor screen ---------- */
[data-theme="terminal"] {
  color-scheme: dark;
  --paper: #080B08; --paper-2: #0F150F;
  --blue: #5CFF8A; --forge: #FFB000; --forge-text: #FFB000;
  --ink: #B9F2C8; --muted: #6E9E7C; --rule: rgba(92, 255, 138, .25);
  --board: #030503; --on-board: #5CFF8A; --tab: transparent; --tab-2: transparent;
  --grain: 1; --blend: screen;
  --display: "IBM Plex Mono", ui-monospace, monospace;
  --text: "IBM Plex Mono", ui-monospace, monospace;
}
[data-theme="terminal"] body { font-size: 1rem; }
[data-theme="terminal"] .lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); }
[data-theme="terminal"] :is(h1, h2, h3, h4, .brand-name, .btn, .tabs a, .status, .views select, .social a, .f > span, .figures dd, .bench dt) {
  font-variation-settings: normal; letter-spacing: 0;
}
[data-theme="terminal"] .sheet { border-radius: 0; border: 1px solid var(--rule); text-shadow: 0 0 6px rgba(92, 255, 138, .35); }
[data-theme="terminal"] .sheet::after { background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .35) 2px 3px); mix-blend-mode: normal; }
[data-theme="terminal"] .tabs a { border-radius: 0; color: var(--blue); padding-inline: .6rem; }
[data-theme="terminal"] .tabs a::before { content: "["; }
[data-theme="terminal"] .tabs a::after { content: "]"; }
[data-theme="terminal"] .tabs a[aria-current="page"], [data-theme="terminal"] .tabs a:hover { background: var(--blue); color: var(--paper); }
[data-theme="terminal"] .riso { font-size: clamp(2.6rem, 9vw, 7.5rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; }
[data-theme="terminal"] .riso::after {
  content: ""; position: static; display: inline-block;
  width: .5em; height: .75em; margin-left: .08em; vertical-align: baseline;
  background: var(--blue); transform: none;
  animation: blink 1.1s steps(1) infinite;
}
[data-theme="terminal"] .riso.is-printing { animation: type 1s steps(14) both; }
[data-theme="terminal"] .panel-head h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
[data-theme="terminal"] .panel-head h2::before { content: "~/"; color: var(--muted); }
[data-theme="terminal"] .proj h3, [data-theme="terminal"] .case h3 { font-weight: 600; }
[data-theme="terminal"] .proj-flag h3 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
[data-theme="terminal"] .plate { border-radius: 0; border: 1px dashed var(--rule); }
[data-theme="terminal"] .btn { background: none; color: var(--blue); border: 1px solid var(--blue); border-radius: 0; box-shadow: none; }
[data-theme="terminal"] .btn::before { content: "> "; }
[data-theme="terminal"] .btn:hover { background: var(--blue); color: var(--paper); transform: none; }
[data-theme="terminal"] .f input, [data-theme="terminal"] .f textarea { border-bottom-style: dashed; }
[data-theme="terminal"] .views select, [data-theme="terminal"] .social a { border-radius: 0; }
[data-theme="terminal"] .panel.is-open { animation: crt .35s steps(4) both; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes crt { 0% { opacity: 0; } 50% { opacity: .6; } 75% { opacity: .3; } }

/* ---------- Paper: an e-ink reader. Greys only, no transitions, a refresh flash. ---------- */
[data-theme="paper"] {
  --paper: #DCDBD6; --paper-2: #CDCCC7;
  --blue: #242424; --forge: #707070; --forge-text: #333333;
  --ink: #1E1E1E; --muted: #555555; --rule: rgba(0, 0, 0, .18);
  --board: #2B2B2B; --on-board: #DCDBD6; --tab: #353535; --tab-2: #353535;
  --grain: .3; --blend: multiply;
  --display: "Newsreader", Georgia, serif;
}
[data-theme="paper"] .board { max-width: 62rem; }
[data-theme="paper"] :is(h1, h2, h3, h4, .brand-name, .tabs a, .status, .views select, .social a, .f > span, .figures dd) {
  font-weight: 500; font-variation-settings: normal; letter-spacing: -.01em;
}
[data-theme="paper"] .riso { font-size: clamp(3rem, 9vw, 7rem); line-height: 1; font-style: italic; }
[data-theme="paper"] .riso::after { display: none; }
[data-theme="paper"] .plate { filter: grayscale(1) contrast(1.3); }
[data-theme="paper"] .btn { background: var(--blue); color: var(--paper); box-shadow: none; }
[data-theme="paper"] *, [data-theme="paper"] *::before { transition: none !important; }
[data-theme="paper"] .panel.is-open, [data-theme="paper"] .riso.is-printing { animation: eink .5s steps(1) both; }
@keyframes eink { 0% { filter: invert(1); } 30% { filter: none; } }

/* Two-tone views can't tell ink colours apart, so a hatch stands in for the second ink. */
:is([data-theme="bw"], [data-theme="paper"]) .status-build::before {
  background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 4px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Project page (Daxis) ---------- */
.back { display: inline-block; margin-bottom: 1.5rem; font: 600 .95rem/1 var(--display); font-variation-settings: "wdth" 90; color: var(--blue); text-decoration: none; }
.back:hover { text-decoration: underline; }
.product .panel-head { max-width: 50rem; }
.product-video { margin: 0 0 1.75rem; }
.product-video video { display: block; width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; background: #171717; border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--blue); }
.product-video figcaption, .product-shots figcaption { margin-top: .6rem; font-size: .95rem; color: var(--muted); }
.product-cta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.product-cta .open-app { margin-top: 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem clamp(1.5rem, 4vw, 3rem); margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.product-grid h3 { font-size: 1.5rem; font-variation-settings: "wdth" 100; margin-bottom: .9rem; }
.product-grid ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .6rem; }
.product-grid li, .product-grid p { line-height: 1.45; }
.product-grid pre { margin: .8rem 0 0; padding: .9rem 1rem; overflow-x: auto; background: var(--paper-2); border-radius: 4px; font: .85rem/1.5 "IBM Plex Mono", monospace; white-space: pre; }
.product-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.5rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.product-shots figure { margin: 0; }
.product-shots img { display: block; width: 100%; height: auto; border: 1.5px solid var(--ink); border-radius: 4px; }
@media (max-width: 480px) { .product-shots { grid-template-columns: 1fr; } }
