:root {
  --bg: #0b0b0d;
  --blue: #0a3fd0;
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.62);
  --ink-faint: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.09);
  --rule: rgba(255, 255, 255, 0.32);
  --panel: rgba(0, 0, 0, 0.16);
  --accent: #ffd84a;
  --cell: 60px;
  --pad: clamp(16px, 2.6vw, 24px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Martian Mono", ui-monospace, monospace;
  font-variation-settings: "wdth" 100, "wght" 400;
  -webkit-font-smoothing: antialiased;
  padding: 10px;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: normal; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--blue); }

/* bold = widest */
.b, .logo, .nav a, .social a, .name, .tag, .sys-status .hi,
.archive-title, .cat-head, .rows .t, .rows em,
.page-title, .d-title, .filters button, .ls-head, .ls-name,
.btn, .d-tags span, .hero-cta, .code .copy, .frame-count, .nav-btn, .b-node b, .build-head h2, .build-links a, .meta-table td:last-child, .pager-next,
.term-head, .pkg dt, .log h3, .id-card dt,
.field-label, .msg-form input, .msg-form textarea, .uplinks a span:first-child, .clock {
  font-weight: 800;
  font-stretch: 112.5%;
  font-variation-settings: "wdth" 112.5, "wght" 800;
}

.frame {
  position: relative;
  min-height: calc(100vh - 20px);
  min-height: calc(100svh - 20px);
  background: var(--blue);
  border-radius: 8px;
  overflow: clip;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  padding: var(--pad) calc(var(--pad) + 4px);
}

.grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: -1px -1px;
}

.dim { color: var(--ink-faint); }
.accent { color: var(--accent); }

/* blinking block cursor */
.cursor {
  display: inline-block;
  inline-size: 0.42em;
  block-size: 0.74em;
  margin-inline-start: 0.12em;
  vertical-align: -0.08em;
  background: var(--ink);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── status ───────────────────────────── */
.sys-status {
  position: absolute;
  top: var(--pad);
  left: calc(var(--pad) + 4px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  z-index: 1;
}
.sys-status .hi { color: var(--ink); }
.sys-status b { font-weight: inherit; color: var(--ink-dim); }

/* ── header ───────────────────────────── */
.top {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-top: 56px;
}

.logo {
  font-size: 11px;
  letter-spacing: 0.08em;
  justify-self: start;
}

.nav {
  display: flex;
  gap: clamp(20px, 4vw, 48px);
  font-size: 14px;
}

.social {
  justify-self: end;
  display: flex;
  gap: 14px;
  font-size: 14px;
  padding-right: 20px;
}
.social a { color: var(--ink-dim); }

.nav a, .social a, .logo { position: relative; transition: color .2s; }
.nav > a::after, .has-menu > a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -6px;
  height: 2px;
  background: currentColor;
  transition: right .25s ease;
}
.nav > a:hover::after, .has-menu:hover > a::after, .nav a.active::after { right: 0; }
.nav a.active { color: var(--accent); }
.social a:hover, .logo:hover { color: var(--accent); }

/* scrolling pages: header sticks and blurs what passes under it */
.is-scroll .top {
  position: sticky;
  top: 0;
  margin: calc(var(--pad) * -1) calc((var(--pad) + 4px) * -1) 0;
  padding: calc(var(--pad) + 56px) calc(var(--pad) + 4px) 24px;
  background: rgba(10, 63, 208, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.is-scroll .top::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--line);
}

/* WORKS hover menu */
.has-menu { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 18px);
  left: -14px;
  min-width: 230px;
  padding: 6px;
  background: var(--blue);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
/* invisible bridge so the pointer can cross the gap */
.menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -20px;
  height: 20px;
}
.has-menu:hover .menu,
.has-menu:focus-within .menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav .menu a {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.menu a span { color: var(--ink-faint); font-size: 10px; align-self: center; }
.menu a:hover, .menu a:focus-visible {
  background: var(--ink);
  color: var(--blue);
  outline: none;
}
.menu a:hover span { color: var(--blue); }

/* ── shared page pieces ───────────────── */
.page {
  position: relative;
  z-index: 2;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 64px) clamp(0px, 4vw, 56px) 72px;
}

.kicker {
  font-size: 11px;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.page-title {
  font-size: clamp(22px, 4.2vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Works / About / Contact share one title block: kicker + title, same height */
.page-head { margin-bottom: 44px; }
.page-head .kicker { line-height: 1.4; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .page-title { white-space: nowrap; }

.page-sub {
  margin-top: 14px;
  font-size: clamp(10px, 1.1vw, 12px);
  color: var(--ink-faint);
}

.panel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 26px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: transparent;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--ink); color: var(--blue); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* moving scanline for panels */
.scan { overflow: hidden; }
.scan::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 6px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: scanline 5s linear infinite;
  pointer-events: none;
}
@keyframes scanline {
  from { transform: translateY(-10px); }
  to { transform: translateY(1200px); }
}

/* ── hero (home) ──────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 48px 0;
}

.hero-inner {
  display: inline-flex;
  flex-direction: column;
}

.tag {
  font-size: clamp(11px, 1.3vw, 13px);
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}
.tag-top { align-self: flex-start; margin-bottom: 0.4em; }
.tag-bottom { align-self: flex-end; margin-top: 0.8em; }

/* "esko" + cursor ≈ 3.5em wide → 20vw fills ~70% of the frame */
.name {
  font-size: min(20vw, 52vh);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  /* squash vertically, then pull the layout box in to match */
  transform: scaleY(0.72);
  margin-block: -0.14em;
}

/* ── works ────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
}
.filters-label { font-size: 10px; color: var(--ink-faint); margin-right: 6px; }
.filters button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filters button sup { font-size: 9px; color: var(--ink-faint); vertical-align: baseline; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--blue);
}
.filters button[aria-pressed="true"] sup { color: var(--blue); }

/* desktop: ls -al file list */
.ls { font-size: 12px; }
.ls-row {
  display: grid;
  grid-template-columns: 5fr 2fr 3fr 2fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ls-head {
  padding-block: 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.ls-row > :nth-child(2) { text-align: center; }
.ls-row > :nth-child(4) { text-align: right; }
.ls-year, .ls-cat, .ls-size { color: var(--ink-dim); }
.ls-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ls-name i { color: var(--accent); font-style: normal; }
.ls-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ls-row { transition: background .15s; }
a.ls-row:hover { background: rgba(255, 255, 255, 0.1); }
a.ls-row:hover .ls-name span { text-decoration: underline; text-underline-offset: 4px; }
a.ls-row:hover .ls-name i { color: var(--ink); }
.ls-empty, .archive-empty { padding: 28px 16px; font-size: 11px; color: var(--ink-faint); }

/* hover preview that follows the pointer */
.preview {
  position: fixed;
  z-index: 50;
  left: 0; top: 0;
  width: 320px;
  height: 200px;
  padding: 4px;
  background: var(--blue);
  border: 1px solid var(--rule);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.22);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}
.preview.on { opacity: 1; }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.preview .ph { width: 100%; height: 100%; }
.preview-tag {
  position: absolute;
  left: 10px; bottom: 10px;
  padding: 4px 7px;
  font-size: 8px;
  background: #06246f;
}

/* image placeholder: dashed box with a label */
.ph {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 10px, transparent 10px 20px),
    rgba(6, 36, 111, 0.45);
  border: 2px dashed rgba(255, 255, 255, 0.14);
}

/* mobile: PROJECT_ARCHIVE scrolling list */
.view-mobile { display: none; }

.cat { margin-top: 48px; scroll-margin-top: 150px; }
.cat:first-child { margin-top: 0; }
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: clamp(16px, 1.9vw, 22px);
  letter-spacing: 0.06em;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.cat-head span { font-size: 10px; color: var(--ink-faint); letter-spacing: 0; }

.rows > li > * {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.rows time { font-size: 10px; color: var(--ink-faint); }
.rows .t { font-size: 12px; letter-spacing: 0.03em; transition: transform .2s; overflow-wrap: anywhere; }
.rows em {
  font-size: 9px;
  padding: 4px 7px;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
}
.rows a:hover { background: rgba(255, 255, 255, 0.06); }
.rows a:hover .t { transform: translateX(6px); color: var(--accent); }

/* ── project detail (art) ─────────────── */
.d-title {
  font-size: clamp(30px, 6.4vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.d-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.d-tags span { padding: 3px 8px; font-size: 9px; background: var(--ink); color: var(--blue); }

.d-hero {
  position: relative;
  margin: 44px 0 48px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
}
.d-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-hero .ph { position: absolute; inset: 0; }
.dots { position: absolute; z-index: 3; top: 10px; left: 12px; display: flex; gap: 7px; padding: 7px 9px; background: #06246f; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }

.d-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}
.d-meta { padding: 24px; background: rgba(255, 255, 255, 0.05); }
.panel-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.meta-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.meta-table td { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.meta-table tr:last-child td { border-bottom: 0; }
.meta-table td:first-child { color: var(--ink-faint); }
.meta-table td:last-child { text-align: right; }
.d-meta .btn { width: 100%; margin-top: 24px; }

.d-text { display: grid; gap: 32px; }
.d-text .note { font-size: 9px; color: var(--ink-faint); margin-bottom: 10px; }
.d-text .lead, .r-body .lead { font-size: clamp(14px, 1.5vw, 17px); line-height: 1.75; }
.d-text .body, .r-body .body { font-size: 12px; line-height: 1.85; color: var(--ink-dim); }
.term-log {
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 4px solid var(--accent);
  font-size: 11px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}
.term-log .note { color: var(--accent); }

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 80px 0 20px;
  padding-bottom: 14px;
  scroll-margin-top: 140px;
  border-bottom: 1px solid var(--rule);
  font-size: 10px;
  color: var(--ink-faint);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.shot { margin: 0; min-width: 0; }
.shot-frame {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  cursor: zoom-in;
}
.shot-frame:disabled { cursor: default; }
.shot-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.shot-frame:hover img { transform: scale(1.03); }
.shot-frame .ph { height: 100%; border: 0; }
.shot figcaption { margin-top: 8px; font-size: 9px; color: var(--ink-faint); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 88px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}
.pager-back { font-size: 11px; color: var(--ink-faint); transition: color .2s; }
.pager-back:hover { color: var(--ink); }
.pager-next { display: flex; align-items: center; gap: 16px; font-size: clamp(14px, 1.7vw, 20px); text-align: right; transition: color .2s; }
.pager-next small { display: block; font-size: 9px; color: var(--ink-faint); margin-bottom: 4px; font-weight: 400; }
.pager-next .box {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: border-color .2s;
}
.pager-next:hover { color: var(--accent); }
.pager-next:hover .box { border-color: var(--accent); }

/* vibe: stack tags, demo hero, link buttons */
.d-tags.stack span { background: transparent; color: var(--ink); border: 1px solid var(--rule); }

.hero-cta {
  position: absolute;
  z-index: 3;
  right: 14px; bottom: 14px;
  padding: 8px 12px;
  font-size: 10px;
  background: var(--accent);
  color: var(--blue);
  transition: transform .2s;
}
.hero-cta:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--ink); }

/* frame viewer: big image paged by arrows / keys / swipe / contact sheet */
.viewer .slide { position: absolute; inset: 0; display: grid; }
.viewer .slide img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.22);
  cursor: zoom-in;
  animation: frame-in .25s ease;
}
.viewer .slide .ph { position: static; }
@keyframes frame-in { from { opacity: 0; } to { opacity: 1; } }
.frame-count {
  position: absolute;
  z-index: 4;
  top: 10px; right: 12px;
  padding: 5px 9px;
  font-size: 10px;
  letter-spacing: 0.06em;
  background: #06246f;
  pointer-events: none;
}
.frame-count b { color: var(--accent); font-weight: inherit; }
.nav-btn {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 40px; height: 40px;
  transform: translateY(-50%);
  font-size: 14px;
  background: rgba(6, 36, 111, 0.78);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.nav-btn.prev { left: 12px; }
.nav-btn.next { right: 12px; }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.gallery.sheet { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery.sheet .shot-frame { aspect-ratio: 4 / 3; cursor: pointer; opacity: .62; transition: opacity .2s, outline-color .2s; outline: 2px solid transparent; outline-offset: 2px; }
.gallery.sheet .shot-frame:hover { opacity: 1; }
.gallery.sheet .shot-frame.is-current { opacity: 1; outline-color: var(--accent); }
.gallery.sheet .shot-frame.is-current + figcaption { color: var(--accent); }
.gallery.sheet figcaption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery.sheet .shot-frame:hover img { transform: none; }

.btn-solid { background: var(--ink); color: var(--blue); }
.btn-solid:hover:not(:disabled) { background: var(--accent); color: var(--blue); }
.btn-stack { display: grid; gap: 10px; margin-top: 24px; }
.d-meta .btn-stack .btn { margin-top: 0; }
.no-links { margin-top: 22px; font-size: 10px; color: var(--ink-faint); }

.gallery.wide { grid-template-columns: repeat(2, 1fr); }
.gallery.wide .shot-frame { aspect-ratio: 16 / 10; }

/* builds: git-graph map + one section per build */
.branch-map { margin: 40px 0 52px; }
.branch-map .note { font-size: 9px; color: var(--ink-faint); margin-bottom: 8px; }
.branch-canvas { position: relative; }
.branch-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.branch-canvas path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transition: stroke .2s, stroke-width .2s;
}
.branch-canvas path.hl { stroke: var(--accent); stroke-width: 3; }
.b-commit {
  position: absolute;
  width: 7px; height: 7px;
  transform: translate(-50%, -50%);
  background: var(--blue);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}
.b-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translate(-7px, -50%);
  white-space: nowrap;
}
.b-node i {
  flex: none;
  width: 14px; height: 14px;
  background: var(--blue);
  border: 2px solid var(--ink);
  transition: background .2s, border-color .2s, transform .2s;
}
.b-node span { display: grid; gap: 3px; padding: 4px 8px; background: rgba(10, 63, 208, 0.85); }
.b-node b { font-size: 11px; letter-spacing: 0.04em; transition: color .2s; }
.b-node small { font-size: 9px; color: var(--ink-faint); }
.b-node.hl i, .b-node:focus-visible i { background: var(--accent); border-color: var(--accent); transform: rotate(45deg); }
.b-node.hl b { color: var(--accent); }

.build { margin-top: 72px; scroll-margin-top: 150px; }
.build-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.build-dot { width: 10px; height: 10px; border: 2px solid var(--accent); align-self: center; }
.build-head h2 { font-size: clamp(16px, 1.9vw, 22px); letter-spacing: 0.06em; }
.build-meta { font-size: 10px; color: var(--ink-faint); }
.build-links { margin-left: auto; display: flex; gap: 16px; }
.build-links a { font-size: 10px; color: var(--ink-dim); transition: color .2s; }
.build-links a:hover { color: var(--accent); }
.build .d-hero { margin-top: 24px; }
.build .gallery-head { margin-top: 32px; }

.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}
.phone { margin: 0; min-width: 0; }
.phone-screen {
  display: block;
  width: 100%;
  aspect-ratio: 804 / 1628;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  background: #f5f2ec;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.18);
  cursor: zoom-in;
}
.phone-screen img { display: block; width: 100%; }
.phone-screen.is-long { overflow-y: auto; cursor: ns-resize; }

/* thin scrollbar for the long screenshot: 3px, translucent white thumb with a dark
   edge so it reads on both the purple and the cream parts, clear track */
.phone-screen.is-long::-webkit-scrollbar { width: 3px; }
.phone-screen.is-long::-webkit-scrollbar-track { background: transparent; }
.phone-screen.is-long::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(6, 36, 111, 0.55);
}
.phone-screen.is-long::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 1px rgba(6, 36, 111, 0.75); }
/* Firefox only (Chrome 121+ would let these override the rules above). Firefox can't
   outline the thumb, so it gets a translucent dark blue that shows on both backgrounds */
@supports (-moz-appearance: none) {
  .phone-screen.is-long { scrollbar-width: thin; scrollbar-color: rgba(6, 36, 111, 0.45) transparent; }
  .phone-screen.is-long:hover { scrollbar-color: rgba(6, 36, 111, 0.7) transparent; }
}
.phone-screen.is-long:focus-visible, .phone-screen:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.phone figcaption { margin-top: 10px; font-size: 9px; color: var(--ink-faint); }

/* random: free-form column */
.r-body { display: grid; gap: 28px; max-width: 780px; margin-top: 44px; }
.r-body .gallery { margin: 12px 0; }
.gallery.free { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gallery.free .shot-frame { aspect-ratio: 4 / 3; }

.code { margin: 12px 0 0; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.25); }
.code figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 8px 16px;
  font-size: 10px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.code .copy {
  padding: 5px 10px;
  font-size: 9px;
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
}
.code .copy:hover { border-color: var(--accent); color: var(--accent); }
.code pre { margin: 0; padding: 18px 16px; overflow-x: auto; font-family: inherit; }
.code code { font-family: inherit; font-size: 12px; line-height: 1.75; color: rgba(255, 255, 255, 0.88); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(4, 22, 74, 0.94);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); max-height: calc(100svh - 110px); object-fit: contain; }
.lightbox figcaption { margin-top: 12px; font-size: 10px; color: var(--ink-dim); }
.lightbox button {
  background: none;
  border: 1px solid var(--rule);
  width: 44px; height: 44px;
  font-size: 14px;
  cursor: pointer;
}
.lightbox button:hover { border-color: var(--ink); }
.lightbox .lb-close { position: absolute; top: 20px; right: 20px; }

.not-found { padding: 80px 0; }
.not-found p { margin-top: 18px; font-size: 12px; color: var(--ink-dim); }
.not-found a { display: inline-block; margin-top: 32px; }

/* ── about ────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 4fr 3fr 5fr;
  gap: 28px;
  align-items: stretch;
}
.about-col { display: flex; flex-direction: column; gap: 28px; }
.term { padding: 24px; }
.term-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 0.04em;
  opacity: .55;
  margin-bottom: 18px;
}
.ascii {
  margin: 0;
  padding: 16px;
  font-family: inherit;
  font-size: 8px;
  line-height: 1.15;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.id-card { margin-top: 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 11px; }
.id-card dt { color: var(--accent); }
.readme { flex: 1; }
.readme p { font-size: 11px; line-height: 1.9; color: var(--ink-faint); }

.pkg { display: grid; gap: 16px; }
.pkg > div { position: relative; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }

/* AI_IMAGE_GEN: hover (tap on touch) shows its sub-packages */
.pkg-panel { z-index: 3; }
.pop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-decoration: underline dotted rgba(255, 255, 255, 0.45);
  text-underline-offset: 4px;
}
.pop-hint {
  display: inline-grid;
  place-items: center;
  width: 14px; height: 14px;
  font-size: 10px;
  border: 1px solid var(--rule);
  color: var(--accent);
  transition: transform .2s;
}
.pkg-pop {
  position: absolute;
  z-index: 10;
  top: calc(100% + 10px);
  left: -10px;
  min-width: 220px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  background: var(--blue);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.pkg-pop .pop-label { font-size: 9px; color: var(--ink-faint); font-weight: 400; font-variation-settings: "wdth" 100, "wght" 400; }
.pkg-pop span { display: flex; justify-content: space-between; gap: 16px; font-size: 10px; }
.pkg-pop b { font-weight: inherit; }
.pkg-pop em { color: var(--accent); }
.has-pop.open .pkg-pop,
.pop-trigger:focus-visible + .pkg-pop { opacity: 1; visibility: visible; transform: none; }
.has-pop.open .pop-hint { transform: rotate(45deg); }
.has-pop.open .pop-trigger, .pop-trigger:hover { color: var(--accent); }
@media (hover: hover) {
  .has-pop:hover .pkg-pop { opacity: 1; visibility: visible; transform: none; }
  .has-pop:hover .pop-hint { transform: rotate(45deg); }
}
.pkg dd { color: var(--accent); }
.health { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 9px; color: var(--ink-faint); }
.bar { height: 4px; margin: 10px 0 6px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--v); background: var(--accent); }
.health .pct { text-align: right; color: var(--ink); }

.log { display: grid; gap: 26px; }
.log li { position: relative; padding: 0 0 6px 24px; border-left: 1px solid rgba(255, 255, 255, 0.12); }
.log li::before {
  content: "";
  position: absolute;
  left: -4px; top: 0;
  width: 7px; height: 7px;
  background: rgba(255, 255, 255, 0.45);
}
.log li.now { border-left-color: rgba(255, 216, 74, 0.35); }
.log li.now::before { background: var(--accent); }
.log time { display: block; font-size: 9px; color: var(--ink-faint); margin-bottom: 6px; }
.log li.now time { color: var(--accent); }
.log h3 { font-size: 12px; letter-spacing: 0.02em; margin-bottom: 6px; }
.log p { font-size: 10px; line-height: 1.7; color: var(--ink-faint); }
.log-done { margin-top: 26px; font-size: 9px; color: var(--accent); display: flex; gap: 8px; align-items: center; }
.log-done i { animation: blink 1.4s steps(1) infinite; font-style: normal; }

/* ── contact ──────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
}
.msg-form { display: grid; gap: 34px; }
.field { display: block; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-faint); margin-bottom: 10px; }
.field-label .cursor { opacity: 0; font-size: 13px; }
.field:focus-within .field-label { color: var(--ink); }
.field:focus-within .field-label .cursor { opacity: 1; }
.msg-form input, .msg-form textarea {
  display: block;
  width: 100%;
  padding: 6px 0 10px;
  font-size: clamp(15px, 1.7vw, 20px);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: none;
  caret-color: var(--accent);
  border-radius: 0;
  transition: border-color .2s;
}
.msg-form textarea { height: 140px; resize: vertical; line-height: 1.5; }
.msg-form input:focus, .msg-form textarea:focus { border-bottom-color: var(--accent); }
.msg-form .bot { display: none; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.form-status { font-size: 11px; color: var(--ink-dim); min-height: 1.4em; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #ffb3b3; }

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 8px 0 0 48px;
  border-left: 1px solid var(--line);
}
.side-label { font-size: 9px; letter-spacing: 0.14em; color: var(--ink-faint); margin-bottom: 14px; }
.clock { font-size: 22px; }
.clock + p { margin-top: 6px; font-size: 11px; }
.uplinks { display: grid; gap: 16px; }
.uplinks a { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; transition: color .2s; }
.uplinks a span:last-child { color: var(--ink-faint); transition: color .2s; }
.uplinks a:hover, .uplinks a:hover span:last-child { color: var(--accent); }
.side-mark { margin-top: auto; width: 44px; opacity: .2; image-rendering: pixelated; }

/* ── pixel crosses ────────────────────── */
.pixel {
  --p: 8px;
  position: absolute;
  z-index: 1;
  width: var(--p);
  height: var(--p);
  background: #d6c7d8;
  box-shadow:
    0 calc(var(--p) * -1) 0 #7a3f8e,
    calc(var(--p) * -1) 0 0 #9b3f7e,
    var(--p) 0 0 #9b3f7e,
    0 var(--p) 0 #2f7c6a,
    0 calc(var(--p) * 2) 0 #1f6a5a;
  animation: flicker 3.2s steps(1) infinite;
  pointer-events: none;
}
.pixel-a { top: 150px; left: 13%; }
.pixel-b { top: 70%; left: 77%; animation-delay: -1.6s; }

.is-scroll .pixel { position: fixed; opacity: .5; }
.is-scroll .pixel-a { top: 32%; left: 5%; }
.is-scroll .pixel-b { top: 84%; left: 91%; }

@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 1; }
  48% { opacity: .3; }
  52% { opacity: 1; }
  80% { opacity: .65; }
  82% { opacity: 1; }
}

/* ── footer ───────────────────────────── */
.bottom {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 16px;
  font-size: 9px;
  letter-spacing: 0.04em;
}
.bottom.has-center { grid-template-columns: 1fr auto 1fr; }
.bottom-center { color: var(--accent); align-self: center; }

.meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--ink-dim);
}
.meta-right { align-items: flex-end; text-align: right; }

/* ── tablet ───────────────────────────── */
@media (max-width: 1080px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-grid > .term-log-col { grid-column: 1 / -1; }
}

/* ── small screens ────────────────────── */
@media (max-width: 760px) {
  :root { --cell: 44px; }
  .top {
    grid-template-columns: 1fr auto;
    row-gap: 18px;
  }
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 18px;
    font-size: 12px;
  }
  .social { padding-right: 0; font-size: 12px; }
  .is-scroll .top { padding-bottom: 18px; }

  /* name turned 90° clockwise; tags rotate with it */
  .hero-inner { writing-mode: vertical-rl; }
  .tag-top { margin-bottom: 0; margin-left: 0.6em; }
  .tag-bottom { margin-top: 0; margin-right: 0.8em; }
  .name {
    font-size: min(17svh, 46vw);
    transform: none;
    margin-block: 0;
  }

  .page { padding-top: 36px; padding-bottom: 56px; }

  /* works: swap the file table for the scrolling archive */
  .view-desktop { display: none; }
  .view-mobile { display: block; }
  .page-head { margin-bottom: 32px; }
  .filters { margin: 0 0 36px; gap: 6px; }
  .filters-label { width: 100%; margin-bottom: 2px; }
  .filters button { padding: 7px 9px; font-size: 10px; }

  .d-hero { margin: 32px 0; aspect-ratio: 4 / 3; }
  .d-title { font-size: 6.2vw; }
  .d-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gallery.wide { grid-template-columns: 1fr; }
  .branch-map { margin: 28px 0 40px; }
  .build { margin-top: 56px; }
  .build-links { margin-left: 0; width: 100%; }
  .phones {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 62%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 14px;
  }
  .phone { scroll-snap-align: start; }
  .gallery.sheet { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gallery.sheet figcaption { font-size: 8px; }
  .nav-btn { width: 34px; height: 34px; }
  .hero-cta { right: 10px; bottom: 10px; padding: 6px 9px; font-size: 9px; }
  .r-body { margin-top: 32px; gap: 22px; }
  .code code { font-size: 11px; }
  .gallery-head { margin-top: 56px; }
  .pager { margin-top: 56px; flex-direction: column; align-items: stretch; gap: 28px; }
  .pager-next { justify-content: space-between; text-align: left; overflow-wrap: anywhere; }
  .pager-next .box { width: 40px; height: 40px; }
  .lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; padding: 64px 12px 16px; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; }
  .lightbox img { max-height: calc(100svh - 190px); }
  .lightbox .lb-prev { grid-row: 2; justify-self: start; }
  .lightbox .lb-next { grid-row: 2; justify-self: end; }

  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .about-col { gap: 20px; }
  .term { padding: 20px; }
  .ascii { font-size: 7px; }

  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .msg-form { gap: 28px; }
  .contact-side { padding: 36px 0 0; border-left: 0; border-top: 1px solid var(--line); gap: 36px; }
  .side-mark { display: none; }

  .bottom.has-center { grid-template-columns: 1fr 1fr; }
  .bottom-center { grid-column: 1 / -1; grid-row: 1; justify-self: center; margin-bottom: 8px; }

  .pixel { --p: 6px; }
  .pixel-a { left: 8%; top: 190px; }
}

/* no hover on touch: tapping WORKS just opens the page */
@media (hover: none) {
  .menu, .preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pixel, .cursor, .scan::after, .log-done i { animation: none; }
}
