:root {
  --bg: #e8e1d0;
  --paper: #f6f0df;
  --paper-2: #eee6d2;
  --surface: #f9f3e3;
  --surface-2: #ded5bf;
  --ink: #191713;
  --text: #252119;
  --muted: #665f50;
  --dim: #8b826f;
  --line: #948a74;
  --line-soft: rgba(25, 23, 19, 0.18);
  --active: #173f46;
  --active-ink: #f7f0dc;
  --accent: #b6402a;
  --signal: #2b7c72;
  --warning: #b87925;
  --code-bg: #e0d7c0;
  --shadow: 0 1px 0 rgba(25, 23, 19, 0.18);
  --radius: 2px;
  --shell: 1120px;
  --home-start: #ece4d0;
  --home-end: #ddd2ba;
  --grid-line: rgba(25, 23, 19, 0.045);
  --grid-line-strong: rgba(25, 23, 19, 0.055);
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #10130f;
  --paper: #171b15;
  --paper-2: #202519;
  --surface: #121711;
  --surface-2: #283121;
  --ink: #f1ead2;
  --text: #e0d8c1;
  --muted: #b3aa91;
  --dim: #7f775f;
  --line: #6f765a;
  --line-soft: rgba(241, 234, 210, 0.16);
  --active: #90d2bd;
  --active-ink: #111610;
  --accent: #e07b58;
  --signal: #77c99f;
  --warning: #d9a441;
  --code-bg: #202619;
  --shadow: 0 1px 0 rgba(241, 234, 210, 0.12);
  --home-start: #11170f;
  --home-end: #1d2418;
  --grid-line: rgba(241, 234, 210, 0.035);
  --grid-line-strong: rgba(144, 210, 189, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.52;
}

a {
  color: var(--active);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  line-height: 1.14;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

h3 {
  font-size: 1rem;
}

ul {
  margin: 0.8rem 0 0;
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.35rem;
  color: var(--muted);
}

code {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--ink);
  padding: 0.1em 0.3em;
  font-family: var(--mono);
  font-size: 0.92em;
}

/* Retrofuture OS homepage */
.os-home {
  display: grid;
  min-height: 100vh;
  padding: 0 clamp(0.75rem, 2vw, 1.25rem) clamp(0.75rem, 2vw, 1.25rem);
  background:
    linear-gradient(var(--grid-line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(180deg, var(--home-start) 0%, var(--home-end) 100%);
  background-size: 22px 22px, 22px 22px, auto;
}

.os-frame {
  display: grid;
  grid-template-columns: minmax(176px, 220px) minmax(0, 1.2fr) minmax(210px, 260px);
  gap: 0;
  width: min(100%, 1500px);
  min-height: calc(100vh - clamp(0.75rem, 2vw, 1.25rem));
  margin: 0 auto auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow:
    8px 8px 0 rgba(25, 23, 19, 0.15),
    inset 0 0 0 4px rgba(25, 23, 19, 0.04);
}

.os-rail,
.os-document,
.os-meta {
  min-width: 0;
}

.os-rail,
.os-meta {
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, var(--grid-line-strong) 31px 32px),
    var(--paper-2);
}

.os-rail {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--ink);
}

.identity-block {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-bottom: 1px solid var(--ink);
}

.os-mark,
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.7rem;
  border: 1px solid var(--ink);
  background: var(--active);
  color: var(--active-ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 800;
}

.identity-block h1 {
  max-width: 10ch;
  font-size: 1.55rem;
}

.identity-block p {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.os-nav {
  display: grid;
  align-content: start;
  overflow: hidden;
}

.os-nav a,
.rail-links a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.32rem 0.85rem;
  text-decoration: none;
}

.os-nav a span {
  color: var(--accent);
}

.os-nav a:hover,
.rail-links a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.os-nav a.is-active {
  background: var(--active);
  color: var(--active-ink);
}

.os-nav a.is-active span {
  color: var(--active-ink);
}

.rail-links {
  border-top: 1px solid var(--ink);
}

.rail-links a {
  grid-template-columns: 1fr;
  min-height: 34px;
  color: var(--active);
}

.os-document {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--surface);
  padding: 0;
  border-top: 0;
}

.system-banner {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: #101412;
}

.system-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(84px, 13vh, 142px);
  object-fit: cover;
  object-position: top;
  opacity: 0.74;
  filter: grayscale(1) contrast(1.05) brightness(0.9);
}

.system-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(245, 247, 240, 0.11) 0 1px, transparent 1px 6px),
    radial-gradient(ellipse at center, transparent 0 62%, rgba(245, 247, 240, 0.12) 100%);
  mix-blend-mode: screen;
  animation: banner-scan 18s linear infinite;
}

.system-banner::after {
  content: "visual channel / 418";
  position: absolute;
  z-index: 2;
  right: 0.65rem;
  bottom: 0.45rem;
  color: rgba(238, 239, 232, 0.72);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 4;
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: var(--surface-2);
}

.doc-tabs a {
  flex: 1 1 6.4rem;
  min-width: 0;
  border-right: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.55rem 0.72rem;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.breadcrumb {
  margin: -0.35rem 0 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.breadcrumb a {
  color: var(--active);
}

.prose-block {
  max-width: 72ch;
}

.prose-block p:last-child {
  margin-bottom: 0;
}

.doc-tabs a:hover,
.doc-tabs a.is-active {
  background: var(--surface);
  color: var(--accent);
}

.doc-surface {
  min-width: 0;
  padding: clamp(0.9rem, 2vw, 1.25rem);
  overflow-x: hidden;
  overflow-y: auto;
  transition: opacity 120ms ease;
}

.is-os-loading .doc-surface {
  opacity: 0.72;
}

.os-panel {
  display: none;
  grid-template-columns: minmax(9rem, 0.28fr) minmax(0, 1fr);
  gap: 0.9rem;
  min-height: min(520px, calc(100vh - 11rem));
  align-content: start;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.os-panel.is-active {
  display: grid;
}

.os-panel > .os-section {
  grid-column: 1 / -1;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr);
  gap: 0.9rem;
  align-items: start;
}

.intro-copy {
  display: grid;
  gap: 0.85rem;
}

.intro-copy .lead {
  margin: 0;
  max-width: 58ch;
}

.banner-strip {
  margin: 0;
  overflow: hidden;
  object-position: top;
  /* border: 1px solid var(--ink); */
  background: #061009;
}

.intro-copy .banner-strip {
  display: none;
}

.banner-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 5;
  object-fit: cover;
  filter: grayscale(0.35) contrast(1.12) brightness(0.9);
}

.doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 0.85rem;
}

.doc-header .os-label {
  grid-column: 1 / -1;
}

.doc-header h2 {
  margin: 0;
  font-size: 1.45rem;
}

.doc-header p:last-child {
  margin: 0;
  max-width: 36ch;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: right;
}

.os-label,
.eyebrow,
.kicker,
.work-type,
.artifact-type {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.os-section {
  display: grid;
  grid-template-columns: minmax(9rem, 0.28fr) minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.section-title h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
}

.os-table {
  display: grid;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.os-table a {
  display: grid;
  grid-template-columns: minmax(10rem, 0.42fr) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: baseline;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  min-height: 42px;
  padding: 0.58rem 0.7rem;
  text-decoration: none;
}

.os-table a:last-child {
  border-bottom: 0;
}

.os-table a:hover {
  background: var(--surface-2);
}

.os-table span {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 800;
}

.os-table small {
  color: var(--muted);
  font-size: 0.86rem;
}

.os-facts,
.meta-list {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.os-facts div,
.meta-list div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.28fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line-soft);
}

.os-facts div:last-child,
.meta-list div:last-child {
  border-bottom: 0;
}

.os-facts dt,
.os-facts dd,
.meta-list dt,
.meta-list dd {
  margin: 0;
  padding: 0.55rem 0.65rem;
}

.os-facts dt,
.meta-list dt {
  border-right: 1px solid var(--line-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.os-facts dd,
.meta-list dd {
  color: var(--text);
}

.os-meta {
  display: grid;
  align-content: start;
  gap: 0;
  border-left: 1px solid var(--ink);
}

.os-meta section {
  border-top: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.85rem;
}

.os-meta .tag-list {
  margin: 0;
}

.file-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.theme-toggle {
  min-height: 28px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
}

.theme-toggle[aria-pressed="true"] {
  background: var(--active);
  color: var(--active-ink);
}

.holo-window {
  position: relative;
  min-width: 0;
  width: min(100%, 260px);
  margin: 0;
  justify-self: end;
  border: 1px solid var(--ink);
  background: #09130d;
  color: #9cf0b5;
  box-shadow: var(--shadow);
}

.holo-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px solid rgba(156, 240, 181, 0.35);
  background: #101b12;
  color: #9cf0b5;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.42rem 0.55rem;
}

.holo-toolbar button {
  border: 1px solid rgba(156, 240, 181, 0.5);
  border-radius: var(--radius);
  background: transparent;
  color: #c8ffd4;
  cursor: pointer;
  font: inherit;
  padding: 0.12rem 0.4rem;
}

.holo-toolbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holo-step {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0;
}

.holo-screen {
  position: relative;
  overflow: hidden;
  background: #061009;
  border-radius: 50% / 4%;
  box-shadow: inset 0 0 0 1px rgba(156, 240, 181, 0.18);
}

.holo-screen::before,
.holo-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.holo-screen::before {
  z-index: 1;
  background:
    repeating-linear-gradient(0deg, rgba(156, 240, 181, 0.055) 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at 50% 45%, transparent 0 55%, rgba(156, 240, 181, 0.06) 100%);
  background-size: auto, 100% 100%;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0 68%, transparent 96%);
  mask-image: radial-gradient(ellipse at center, #000 0 68%, transparent 96%);
  mix-blend-mode: screen;
  animation: monitor-scan 14s linear infinite;
}

.holo-screen::after {
  z-index: 2;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0 64%, rgba(0, 0, 0, 0.76) 94%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.44), transparent 18% 82%, rgba(0, 0, 0, 0.44));
  border: 1px solid rgba(156, 240, 181, 0.28);
  border-radius: 50% / 5%;
  box-shadow:
    inset 0 0 24px rgba(156, 240, 181, 0.16),
    inset 0 0 72px rgba(0, 0, 0, 0.42);
}

.holo-screen img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(0.88) sepia(0.52) hue-rotate(70deg) saturate(1.12) contrast(1.02) brightness(0.96);
  transform: scale(1.01);
  animation: monitor-jitter 10s steps(2, end) infinite;
}

.holo-overlay {
  position: absolute;
  inset: auto 0.65rem 0.65rem;
  z-index: 3;
  display: none;
  border: 1px solid rgba(156, 240, 181, 0.32);
  background: rgba(6, 16, 9, 0.68);
  color: #b7f7c3;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.2vw, 0.84rem);
  padding: 0.55rem;
}

.holo-overlay strong {
  display: block;
  margin-bottom: 0.22rem;
  color: #d0ffd8;
}

.holo-window.is-expanded .holo-overlay {
  display: block;
}

.holo-overlay a {
  display: inline-flex;
  width: max-content;
  margin-top: 0.45rem;
  border: 1px solid rgba(156, 240, 181, 0.42);
  color: #d0ffd8;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.4rem;
  text-decoration: none;
}

.holo-overlay a:hover {
  background: rgba(156, 240, 181, 0.12);
  color: #f1fff4;
}

.holo-window:not(.is-expanded) .holo-overlay {
  inset: auto 0.45rem 0.45rem;
  padding: 0.42rem;
  font-size: 0.68rem;
}

.holo-window:not(.is-expanded) .holo-overlay span,
.holo-window:not(.is-expanded) .holo-overlay a {
  display: none;
}

.holo-window:not(.is-expanded) .holo-overlay strong {
  margin-bottom: 0;
}

.holo-screen.is-gallery-project img {
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: 0.65rem;
  background: #061009;
}

.holo-window.is-expanded .holo-screen.is-gallery-project img {
  object-fit: contain;
}

.holo-window figcaption {
  margin: 0;
  border-top: 1px solid rgba(156, 240, 181, 0.25);
  color: #9cf0b5;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.45rem 0.55rem;
}

.holo-window.is-expanded {
  position: fixed;
  inset: clamp(0.75rem, 3vw, 2rem);
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: min(920px, calc(100vw - 2rem));
  width: min(920px, calc(100vw - 2rem));
  margin: auto;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.58);
}

.holo-window.is-expanded .holo-screen img {
  height: 100%;
  aspect-ratio: auto;
}

.monitor-strip,
.monitor-thumb,
.mini-monitor {
  position: relative;
}

.monitor-strip::after,
.monitor-thumb::after,
.mini-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(232, 234, 226, 0.07) 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0 68%, rgba(0, 0, 0, 0.55) 96%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0 72%, transparent 98%);
  mask-image: radial-gradient(ellipse at center, #000 0 72%, transparent 98%);
  mix-blend-mode: normal;
  animation: monitor-scan 16s linear infinite;
}

.preview-stack,
.preview-list {
  display: grid;
  gap: 0.55rem;
}

.mini-monitor,
.preview-row {
  min-width: 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.mini-monitor {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-monitor img,
.monitor-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.45) sepia(0.35) hue-rotate(65deg) saturate(1.04) contrast(1.02);
}

.preview-row {
  display: grid;
  grid-template-columns: clamp(5.5rem, 16vw, 8rem) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.55rem;
}

.preview-row:hover,
.mini-monitor:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.monitor-thumb {
  display: block;
  overflow: hidden;
  min-height: 4.6rem;
  border: 1px solid var(--line);
  background: #061009;
}

.preview-row strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.92rem;
}

.preview-row small {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.cv-module {
  display: grid;
  gap: 1rem;
}

.cv-artifacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.note-list {
  display: grid;
  gap: 0.55rem;
}

.note-item {
  display: grid;
  grid-template-columns: minmax(8rem, 0.28fr) minmax(0, 1fr);
  gap: 0.75rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 0.65rem;
}

.note-item time,
.note-item span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.note-item p {
  margin-bottom: 0;
}

@keyframes monitor-scan {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 -80px, 0 0;
  }
}

@keyframes monitor-jitter {
  0%,
  86%,
  100% {
    transform: scale(1.015) translate(0, 0);
  }
  88% {
    transform: scale(1.018) translate(1px, -1px);
  }
  90% {
    transform: scale(1.014) translate(-1px, 1px);
  }
}

@keyframes banner-scan {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 -96px, 0 0;
  }
}

/* Compact route pages */
.route-page {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto;
}

.route-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
  padding-top: 1rem;
}

.route-header,
.route-panel {
  min-width: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.route-header {
  align-self: start;
  position: sticky;
  top: 78px;
}

.route-header h1 {
  font-size: 1.7rem;
}

.route-panel {
  display: grid;
  grid-template-columns: minmax(8rem, 0.32fr) minmax(0, 1fr);
  gap: 0.85rem;
}

/* Shared site shell and compatibility layer */
.shell {
  width: calc(100% - 32px);
  max-width: var(--shell);
  margin: 0 auto;
}

.site-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -2;
}

.site-header,
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--ink);
  background: rgba(246, 240, 223, 0.95);
  backdrop-filter: blur(10px);
}

.nav-shell,
.site-nav .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  flex: 0 0 auto;
  margin: 0;
  width: 2rem;
  height: 2rem;
}

.brand-text {
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--paper-2);
  color: var(--ink);
}

.nav-links .primary-link {
  border-color: var(--active);
  color: var(--active);
}

.nav-secondary {
  flex-wrap: nowrap;
}

main {
  padding-bottom: 3rem;
}

.desk-hero,
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: end;
  padding: clamp(1.6rem, 4vw, 2.7rem) 0 clamp(1.2rem, 3vw, 2rem);
}

.hero.slim {
  grid-template-columns: minmax(0, 1fr);
  max-width: 820px;
}

.desk-copy {
  max-width: 720px;
}

.lead {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 0.48rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.button.primary {
  background: var(--active);
  color: var(--active-ink);
}

.desk-panel,
.card,
.artifact-card,
.desk-note,
.contact-panel,
.values-card,
.status-list li {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.desk-panel,
.card,
.artifact-card,
.values-card,
.desk-note {
  padding: 0.9rem;
}

.panel-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding-bottom: 0.6rem;
}

.panel-line strong,
.status-ok {
  color: var(--signal);
  font-weight: 800;
}

.signal-list {
  margin: 0;
}

.signal-list div {
  display: grid;
  gap: 0.14rem;
  padding: 0.7rem 0 0;
}

.signal-list dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-list dd {
  margin: 0;
  color: var(--text);
}

.desk-section,
section:not(.os-document) {
  padding: clamp(1.7rem, 4vw, 2.8rem) 0;
  border-top: 1px solid var(--line);
}

.desk-section.compact {
  padding-bottom: 3rem;
}

.section-head {
  max-width: 720px;
  margin-bottom: 1rem;
}

.artifact-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.3rem;
  align-items: start;
}

.desk-hero > *,
.hero > *,
.grid > *,
.artifact-grid > *,
.two-col > * {
  min-width: 0;
}

.card.tight p:last-child,
.artifact-card p:last-child {
  margin-bottom: 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 0.45rem;
}

.project-card .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.artifact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.artifact-links a,
.inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.24rem 0.45rem;
  color: var(--active);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.desk-band,
.band {
  margin: 0;
  border-block: 1px solid var(--ink);
  background: var(--paper-2);
}

.desk-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: clamp(1rem, 4vw, 1.6rem);
}

.route-list {
  display: grid;
  gap: 0.5rem;
}

.route-list a {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 0.65rem 0;
  text-decoration: none;
}

.route-list span {
  color: var(--ink);
  font-weight: 850;
}

.route-list small {
  color: var(--muted);
  font-size: 0.9rem;
}

.visual {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.visual img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--code-bg);
}

.visual.wide img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.caption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.6rem 0.75rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  margin-top: 0.8rem;
}

.tag,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 0;
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.04rem 0 0.04rem 0.42rem;
}

.metric {
  color: var(--accent);
  font-weight: 850;
}

.status-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  margin: 0;
  padding: 0.75rem;
}

.status-pending {
  color: var(--warning);
  font-weight: 800;
}

.status-blocked {
  color: var(--accent);
  font-weight: 800;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 0.58rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: var(--code-bg);
}

.cv-toolbar {
  position: sticky;
  top: 63px;
  z-index: 8;
  border-bottom: 1px solid var(--ink);
  background: var(--bg);
  padding: 0.7rem 0;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.segmented button {
  min-height: 36px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 0.65rem;
}

.segmented button[aria-pressed="true"] {
  background: var(--active);
  color: var(--active-ink);
}

.cv-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.55rem;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem;
}

.site-footer,
footer {
  border-top: 1px solid var(--ink);
  color: var(--muted);
  padding: 1.25rem 0 2rem;
  font-size: 0.9rem;
}

.footer-shell {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 1280px) {
  .os-frame {
    grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
  }

  .os-meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .os-meta section {
    border-right: 1px solid var(--ink);
    border-bottom: 0;
  }

  .os-meta section:last-child {
    border-right: 0;
  }
}

@media (max-width: 900px) {
  .desk-hero,
  .hero,
  .two-col,
  .desk-columns,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .artifact-grid,
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 100%;
  }

  .os-home {
    padding: 0 0.6rem 0.6rem;
  }

  .os-frame {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .os-rail {
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .identity-block h1 {
    max-width: none;
  }

  .identity-block::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
      linear-gradient(90deg, var(--paper-2) 0 34%, rgba(246, 240, 223, 0.6)),
      url("../img/418_informal_banner.jpg") center / cover;
    opacity: 0.38;
  }

  .identity-block > * {
    position: relative;
    z-index: 1;
  }

  .os-nav {
    grid-template-columns: repeat(auto-fit, minmax(6.4rem, 1fr));
  }

  .os-nav a {
    grid-template-columns: 1fr;
    gap: 0.1rem;
    min-height: 46px;
    border-right: 1px solid var(--line-soft);
    text-align: center;
  }

  .rail-links {
    display: flex;
    flex-wrap: wrap;
  }

  .rail-links a {
    flex: 1 1 8rem;
    border-right: 1px solid var(--line-soft);
  }

  .os-section {
    grid-template-columns: 1fr;
  }

  .os-panel,
  .os-panel.is-active,
  .intro-grid,
  .cv-artifacts,
  .note-item {
    grid-template-columns: 1fr;
  }

  .holo-window {
    justify-self: start;
    width: min(100%, 220px);
  }

  .route-shell,
  .route-panel {
    grid-template-columns: 1fr;
  }

  .route-header {
    position: static;
  }

  .os-meta {
    grid-template-columns: 1fr;
  }

  .os-meta section {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .nav-shell,
  .site-nav .shell {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.75rem 0;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
  }

  .nav-secondary {
    border-top: 1px solid var(--line);
    padding-top: 0.55rem;
  }

  .desk-hero,
  .hero {
    gap: 1rem;
    padding-top: 1.25rem;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 300px);
  }

  .button {
    width: 100%;
  }

  .route-list a,
  .os-table a,
  .os-facts div,
  .meta-list div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .os-facts dt,
  .meta-list dt {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 0.25rem;
  }

  .doc-header {
    grid-template-columns: 1fr;
  }

  .doc-tabs a {
    flex-basis: 33.333%;
    padding-inline: 0.45rem;
  }

  .doc-header p:last-child {
    text-align: left;
  }

  .os-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card .actions {
    grid-template-columns: 1fr;
  }

  .preview-row {
    grid-template-columns: 1fr;
  }

  .monitor-thumb {
    min-height: 7rem;
  }

  .footer-shell {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .holo-screen::before,
  .system-banner::before,
  .monitor-strip::after,
  .monitor-thumb::after,
  .mini-monitor::after {
    animation: none !important;
  }

  .holo-screen img {
    animation: none !important;
    transform: none;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --paper: #ffffff;
    --paper-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --ink: #000000;
    --text: #111827;
    --muted: #374151;
    --line: #cbd5e1;
    --line-soft: #e2e8f0;
    --code-bg: #f1f5f9;
    --shadow: none;
  }

  body {
    background: #ffffff;
    color: #111827;
    font-size: 11pt;
    line-height: 1.36;
  }

  .site-grid,
  .site-header,
  .site-nav,
  footer,
  .site-footer,
  .actions,
  .cv-toolbar,
  .no-print,
  .os-rail,
  .os-meta,
  .doc-tabs {
    display: none !important;
  }

  .shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  main {
    padding: 0;
  }

  .os-home {
    display: block;
    padding: 0;
    background: #ffffff;
  }

  .os-frame,
  .os-document,
  .doc-surface,
  .doc-header,
  .os-section,
  .hero,
  .hero.slim,
  .desk-hero,
  section,
  .desk-section {
    display: block;
    min-height: 0;
    border: 0;
    box-shadow: none;
    padding: 8px 0;
    break-inside: avoid;
  }

  .os-table,
  .os-facts,
  .card,
  .artifact-card,
  .desk-panel,
  .status-list li,
  table {
    border: 1px solid #cbd5e1;
    box-shadow: none;
    break-inside: avoid;
  }

  .grid,
  .grid.two,
  .artifact-grid,
  .two-col,
  .desk-columns,
  .route-shell,
  .route-panel {
    display: block;
  }

  .grid > *,
  .grid.two > *,
  .artifact-grid > *,
  .two-col > *,
  .desk-columns > *,
  .route-shell > *,
  .route-panel > * {
    margin-bottom: 8px;
  }

  h1 {
    max-width: none;
    font-size: 24pt;
    margin-bottom: 6px;
  }

  h2 {
    font-size: 15pt;
    margin-bottom: 6px;
  }

  h3 {
    font-size: 12pt;
  }

  p,
  li {
    margin-bottom: 4px;
  }

  a::after {
    content: " (" attr(href) ")";
    color: #374151;
    font-size: 9pt;
    overflow-wrap: anywhere;
  }
}
