/* v32 site theme, shared by the home (site/home/index.html), the case studies and /play.
   Values are the computed end state of mocks/home-v32 (grey grain desktop, square ink-framed windows, navy #0e3b8f as
   the only accent, Silkscreen pixel type + JetBrains Mono). Tokens are prefixed --v- so they never clash with the
   older public/mocks/k*.css variables that still load site-wide. */
@import url('https://fonts.googleapis.com/css2?family=Silkscreen&family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --v-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --v-pixel: 'Silkscreen', 'JetBrains Mono', monospace;
  --v-sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --v-desk: #e6e6e8;
  --v-win: #f7f7f8;
  --v-ink: #2b2b2d;
  --v-ink-soft: #4a4a4e;
  --v-muted: #6c6c72;
  --v-rule: #3a3a3e;
  --v-navy: #0e3b8f;
  --v-navy-dark: #0a2c6b;
  --v-navy-t: #e8edf7;
  --v-grey-t: #eeeef0;
  --v-dots: rgba(0, 0, 0, 0.25);
  --v-checker: conic-gradient(var(--v-navy) 25%, transparent 0 50%, var(--v-navy) 0 75%, transparent 0) 0 0 / 6px 6px;
  --v-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --v-pixelwall-w: 150px;
}

/* ---- the desktop: grey + paper grain. The home's <body class="v-desk">; Next pages wrap themselves in .v-page ---- */
html:has(body.v-desk), body.v-desk, html:has(.v-page), body:has(.v-page) { background: var(--v-desk); }
body:has(.v-page) { margin: 0; padding: 0; }
.v-page { position: relative; min-height: 100vh; background: var(--v-desk); color: var(--v-ink); }
body.v-desk::after, .v-page::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background-image: var(--v-grain); opacity: 0.55; mix-blend-mode: multiply;
}
@media (prefers-reduced-motion: reduce) { body.v-desk::after, .v-page::after { opacity: 0.4; } }

/* ---- the navy pixel block down the left edge: stepped silhouette + a dithered fringe (decorative only) ---- */
.v-pixelwall { position: fixed; left: 0; top: 0; bottom: 0; width: var(--v-pixelwall-w); pointer-events: none; z-index: 0; }
.v-pixelwall::before {
  content: ''; position: absolute; inset: 0; background: var(--v-navy);
  clip-path: polygon(0 0, 28% 0, 28% 9%, 46% 9%, 46% 22%, 62% 22%, 62% 40%, 40% 40%, 40% 52%, 58% 52%, 58% 70%, 78% 70%, 78% 86%, 94% 86%, 94% 100%, 0 100%);
}
.v-pixelwall::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 16%;
  background: conic-gradient(var(--v-navy) 25%, transparent 0 50%, var(--v-navy) 0 75%, transparent 0) 0 0 / 8px 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent 60%, #000 75%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 60%, #000 75%, transparent 100%);
}
@media (max-width: 900px) { .v-pixelwall { display: none; } }

/* ---- the ASCII field: an asymmetric block of dither characters on the right, behind the windows (filled by
   /v32/ascii.js). Fixed and clipped, so it can never add scroll. ---- */
.v-ascii {
  position: fixed; top: 0; right: 0; width: 58vw; height: 100vh; margin: 0; overflow: hidden;
  pointer-events: none; user-select: none; z-index: 0;
  font: 400 12px/12px var(--v-mono); letter-spacing: 0; white-space: pre; color: var(--v-navy); opacity: 0.2;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}
@media (max-width: 900px) { .v-ascii { width: 100vw; opacity: 0.1; } }

/* ---- a window: square, thin ink frame, plain title bar with a dotted rule ---- */
.v-win { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; background: var(--v-win); border: 1px solid var(--v-ink); border-radius: 2px; }
.v-bar {
  flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 8px; height: 26px; padding: 0 12px; margin: 0;
  color: var(--v-ink); font: 500 11px/1 var(--v-mono); text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden; border-bottom: 1px dotted var(--v-ink);
}
.v-bar > * { margin: 0; font: inherit; overflow: hidden; text-overflow: ellipsis; }
.v-bar .v-hint { margin-left: auto; color: var(--v-muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
/* the inverted navy label bar (the home's intro window) */
.v-bar.v-inv { background: var(--v-navy); color: #fff; border-bottom: 0; letter-spacing: 0.04em; }
/* checker block in the window's top-right corner */
.v-check::after {
  content: ''; position: absolute; right: 10px; top: 7px; width: 40px; height: 12px; pointer-events: none; background: var(--v-checker);
}
.v-check.v-check-inv::after { background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 6px 6px; }

/* ---- pinned status bar: name · city | links | date ---- */
.v-status {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; height: 34px; padding: 4px;
  background: var(--v-win); border: 1px solid var(--v-ink); border-radius: 2px; font: 400 12px/1 var(--v-mono); color: var(--v-ink-soft);
}
.v-status > * { display: flex; align-items: center; min-width: 0; }
.v-status .v-st-l { justify-self: start; background: var(--v-navy); color: #fff; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; text-decoration: none; }
.v-status .v-st-l::before { content: '● '; margin-right: 6px; }
.v-status .v-st-r { justify-self: end; padding: 0 12px; white-space: nowrap; }
.v-links { display: flex; gap: 6px; justify-content: center; }
.v-links a { display: flex; align-items: center; padding: 0 10px; border-radius: 5px; color: var(--v-ink-soft); text-decoration: none; font-weight: 500; text-transform: lowercase; transition: background 120ms, color 120ms; }
.v-links a:hover { background: var(--v-navy); color: #fff; }
.v-links span { display: none; }
@media (max-width: 900px) {
  .v-status { grid-template-columns: 1fr; height: auto; padding: 6px; }
  .v-status .v-st-r { display: none; }
  .v-links { flex-wrap: wrap; }
  .v-links a { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .v-links a { transition: none; } }

/* ---- small shared bits ---- */
.v-pixel { font-family: var(--v-pixel); font-weight: 400; }
.v-btn { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--v-mono); color: #fff; background: var(--v-navy); padding: 8px 10px; text-decoration: none; border: 0; }
.v-btn:hover { background: var(--v-navy-dark); }
.v-page a:focus-visible, .v-page button:focus-visible, .v-page summary:focus-visible { outline: 2px solid var(--v-navy); outline-offset: 2px; }

/* ---- the navy pixel mouse pointer, site-wide. Mouse and trackpad only: touch devices never show a cursor. ---- */
@media (hover: hover) and (pointer: fine) {
  html, body { cursor: url('/v32/cursor-arrow.svg') 1 1, auto; }
  a[href], button:not(:disabled), summary, label[for], select, [role='button'], [role='tab'], [role='link'] {
    cursor: url('/v32/cursor-hand.svg') 9 1, pointer !important;
  }
  textarea, input:not([type='checkbox']):not([type='radio']):not([type='submit']):not([type='button']):not([type='range']), [contenteditable='true'] {
    cursor: text !important;
  }
}
