/* eviesgarden studio site. Boot Disk desktop + garden.exe.
   Rules: one 8 px grid. Signal blue means focus only (primary action, focus, player).
   The desktop is grey; colour lives only inside garden.exe. */

:root {
  --desk: #5F5D59;
  --desk-dither: #646260;
  --chrome: #D6D3CD;
  --paper: #F4F3F0;
  --ink: #121212;
  --shade: #8C8984;
  --signal: #2D4BFF;
  --on-signal: #FFFFFF;

  --f-display: "Pixelify Sans", ui-monospace, monospace;
  --f-chrome: "Silkscreen", ui-monospace, monospace;
  --f-game: "Tiny5", ui-monospace, monospace;
  --f-text: "Atkinson Hyperlegible Next", system-ui, sans-serif;

  --u: 8px;
  --bar: 32px;
  --line: 2px solid var(--ink);
  --lift: 6px 6px 0 var(--ink);

  /* garden.exe map: 21 x 9 tiles of 16 px */
  --map-w: 336;
  --map-h: 144;
  --map-scale: 2;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 17px/1.5 var(--f-text);
  color: var(--ink);
  background-color: var(--desk);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23646260'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23646260'/%3E%3C/svg%3E");
  background-size: 4px 4px;
  image-rendering: pixelated;
  cursor: url("../img/cursor.svg") 0 0, default;
}
/* pixel cursors: the arrow everywhere, the hand over anything you can click */
a, button, select, .map, .vs-toggle, .btn { cursor: url("../img/hand.svg") 15 0, pointer; }
input, textarea { cursor: text; }
svg { display: block; }
svg[shape-rendering] { image-rendering: pixelated; }

::selection { background: var(--signal); color: var(--on-signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

* { scrollbar-color: var(--ink) var(--chrome); scrollbar-width: auto; }
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--chrome); border-left: var(--line); }
::-webkit-scrollbar-thumb { background: var(--paper); border: var(--line); box-shadow: inset -2px -2px 0 var(--shade); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -64px; z-index: 3000;
  font: 400 13px/1 var(--f-chrome); color: var(--on-signal); background: var(--signal);
  border: var(--line); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ------------------------------------------------------------- menu bar */
.menubar {
  position: sticky; top: 0; z-index: 1000;
  height: calc(var(--bar) + 2px);
  display: flex; align-items: center; gap: calc(var(--u) * 3);
  padding: 0 calc(var(--u) * 2);
  background: var(--chrome);
  border-bottom: var(--line);
  font: 400 13px/1 var(--f-chrome);
}
.menubar a { color: var(--ink); text-decoration: none; }
.brand { display: flex; align-items: center; gap: var(--u); font-weight: 700; }
.brand svg { width: 16px; height: 16px; }
.menubar-nav ul { display: flex; gap: calc(var(--u) * 3); margin: 0; padding: 0; list-style: none; }
.menubar-nav a, .vs-toggle { padding: 4px 8px; }
.menubar-nav a:hover, .menubar-nav a[aria-current="page"] { background: var(--ink); color: var(--chrome); }
.vs-toggle {
  margin-left: auto; font: inherit; color: var(--ink); background: none; border: 0;
}
.vs-toggle[aria-pressed="true"] { background: var(--ink); color: var(--chrome); }
.vs-toggle:hover { background: var(--ink); color: var(--chrome); }
.clock { font-variant-numeric: tabular-nums; }
.vs-toggle[hidden] + .clock { margin-left: auto; }

/* --------------------------------------------------------------- desktop */
.desktop {
  position: relative;
  height: calc(100dvh - var(--bar) - 2px);
  min-height: 720px;
  overflow: hidden;
}

.icons { position: absolute; left: calc(var(--u) * 2); top: calc(var(--u) * 2); bottom: calc(var(--u) * 2); }
.icons ul { margin: 0; padding: 0; list-style: none; height: 100%; display: flex; flex-direction: column; gap: calc(var(--u) * 1.5); }
/* the bin sits apart at the foot of the column, as on old desktops */
.icons li:last-child { margin-top: auto; }
.icon {
  width: 104px; padding: var(--u) 4px;
  display: flex; flex-direction: column; align-items: center; gap: var(--u);
  color: var(--paper); text-decoration: none;
  outline-offset: 0;
}
.icon svg { width: 48px; height: 48px; }
.icon-label {
  font: 400 12px/1.2 var(--f-chrome); text-align: center;
  padding: 2px 4px;
}
.icon:hover .icon-label, .icon[aria-current="page"] .icon-label, .icon:active .icon-label { background: var(--ink); }
.icon[aria-current="page"] svg, .icon:active svg { filter: brightness(0.45); }
.icon:focus-visible { outline: 2px dashed var(--paper); }
.icon:focus-visible .icon-label { background: var(--signal); color: var(--on-signal); }

/* --------------------------------------------------------------- windows */
.win {
  --w: min(720px, 100% - 176px);
  --x: calc((100% - var(--w)) / 2 + 64px);
  --y: 40px;
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w);
  max-height: calc(100% - var(--y) - 24px);
  z-index: var(--z, 1);
  display: flex; flex-direction: column;
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--lift);
}
.win[hidden] { display: none; }
/* welcome.txt and garden.exe are composed as a pair, centred in the desk beside the icons;
   welcome overlaps the garden's lower-left corner by 120px. */
.desktop { --pair-x: calc(136px + max(0px, (100% - 1148px) / 2)); }
.win--welcome { --w: 456px; --x: var(--pair-x); --y: clamp(96px, 100% - 448px, 304px); max-height: none; }
.win--garden {
  --w: calc(var(--map-w) * var(--map-scale) * 1px + 4px);
  --x: min(var(--pair-x) + 336px, 100% - var(--w) - 24px);
  --y: 40px;
}

.win-bar {
  position: relative; flex: none;
  height: var(--bar);
  display: flex; align-items: center; justify-content: center;
  padding: 0 40px;
  background: var(--chrome);
  border-bottom: var(--line);
  user-select: none;
}
.win.is-active .win-bar {
  background: repeating-linear-gradient(180deg, var(--ink) 0 2px, var(--chrome) 2px 4px);
  background-clip: content-box;
  padding-top: 8px; padding-bottom: 8px;
  background-color: var(--chrome);
}
.win-title {
  font: 400 13px/1 var(--f-chrome);
  background: var(--chrome);
  padding: 4px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win-close {
  position: absolute; left: 8px; top: 50%; translate: 0 -50%;
  width: 20px; height: 20px;
  background: var(--chrome);
  border: var(--line);
}
.win-close::after {
  content: ""; position: absolute; inset: 3px;
  background: var(--ink); opacity: 0; transition: opacity 0ms;
}
.win-close:hover::after, .win-close:active::after { opacity: 1; }

.win-body {
  overflow: auto;
  padding: calc(var(--u) * 3) calc(var(--u) * 4) calc(var(--u) * 4);
  overscroll-behavior: contain;
}

/* Large desks: the garden is the focal object, drawn at 3x; welcome overlaps its soil beds. */
@media (min-width: 1400px) and (min-height: 844px) {
  .desktop { --pair-x: calc(136px + max(0px, (100% - 1392px) / 2)); }
  .win--garden { --map-scale: 3; --x: min(var(--pair-x) + 244px, 100% - var(--w) - 16px); }
  .win--welcome { --w: 600px; --x: calc(var(--pair-x) + 24px); --y: clamp(96px, 100% - 448px, 420px); }
  .win--welcome .display { font-size: 60px; }
  .win--welcome .lede { font-size: 18px; }
}
/* Narrow desks: a slimmer welcome keeps the garden's Go to list clear. */
@media (min-width: 900px) and (max-width: 1180px) {
  .win--welcome { --y: clamp(96px, 100% - 470px, 304px); }
  .win--welcome .win-body { padding-left: 24px; padding-right: 24px; }
  .win--welcome .display { font-size: 40px; }
}

/* ------------------------------------------------------------ typography */
.display {
  font: 700 clamp(32px, 2.8vw, 44px)/1 var(--f-display);
  letter-spacing: 0;
  margin: 0 0 calc(var(--u) * 2);
  text-wrap: balance;
}
.win--welcome .display { font-size: clamp(40px, 3.6vw, 52px); }
.win-body :is(h2, h3):not(.display) {
  font: 700 22px/1.1 var(--f-display);
  margin: calc(var(--u) * 4) 0 var(--u);
}
.win-body p { margin: 0 0 calc(var(--u) * 2); max-width: 62ch; text-wrap: pretty; }
.win-body .lede { font-size: 17px; }
.win-body a:where(:not(.btn, .file, .door)) {
  color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.win-body a:where(:not(.btn, .file, .door)):hover { background: var(--chrome); }

.actions { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 3) !important; }

.status {
  margin: calc(var(--u) * 3) 0 0 !important;
  padding-top: calc(var(--u) * 2);
  border-top: 2px dotted var(--shade);
  font-size: 15px; color: var(--desk);
}
.status-k { font: 400 12px/1 var(--f-chrome); color: var(--ink); margin-right: var(--u); }

.placeholder {
  font: 400 13px/1.5 var(--f-chrome);
  background: var(--chrome);
  border: 2px dashed var(--desk);
  padding: var(--u) calc(var(--u) * 1.5);
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  font: 400 14px/1 var(--f-chrome);
  color: var(--ink); background: var(--chrome);
  border: var(--line);
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
}
.btn--primary { color: var(--on-signal); background: var(--signal); }
.btn:hover { translate: 1px 1px; box-shadow: 2px 2px 0 var(--ink); }
.btn:active { translate: 3px 3px; box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ------------------------------------------------------------------ work */
.files { list-style: none; margin: calc(var(--u) * 3) 0 0; padding: 0; display: grid; gap: var(--u); }
.file {
  display: grid; grid-template-columns: 48px 1fr; column-gap: calc(var(--u) * 2); row-gap: 4px;
  align-items: center;
  padding: calc(var(--u) * 1.5);
  color: var(--ink); text-decoration: none;
  border: 2px solid transparent;
}
.file svg, .file .slot { grid-row: span 2; width: 48px; height: 48px; }
.file-name { font: 400 14px/1.2 var(--f-chrome); }
.file-line { font-size: 16px; }
.file:hover { background: var(--chrome); border-color: var(--ink); }
.slot { border: 2px dashed var(--shade); }
.file--empty .file-line { color: var(--desk); }

.meta { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: calc(var(--u) * 3); margin: 0 0 var(--u); justify-content: start; }
.meta dt { font: 400 12px/1.2 var(--f-chrome); color: var(--desk); margin-bottom: 4px; }
.meta dd { margin: 0; font-size: 16px; }

/* -------------------------------------------------------------- services */
.services { margin: calc(var(--u) * 3) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 calc(var(--u) * 4); }
.services div { border-top: var(--line); padding: calc(var(--u) * 1.5) 0 calc(var(--u) * 2); }
.services dt { font: 700 20px/1.15 var(--f-display); margin-bottom: 4px; }
.services dd { margin: 0; font-size: 16px; }

/* --------------------------------------------------------------- process */
.steps { list-style: none; margin: calc(var(--u) * 3) 0 0; padding: 0; counter-reset: step; max-width: 62ch; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 40px 1fr; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 1.5) 0;
  border-top: var(--line);
}
.steps li::before {
  content: counter(step);
  width: 32px; height: 32px; display: grid; place-items: center;
  font: 400 14px/1 var(--f-chrome);
  background: var(--chrome); border: var(--line);
}
.steps strong { font-weight: 700; }

/* ------------------------------------------------------------------ form */
.form { margin-top: calc(var(--u) * 3); max-width: 56ch; }
.field { margin-bottom: calc(var(--u) * 2.5); }
.field label { display: block; font: 400 13px/1.3 var(--f-chrome); margin-bottom: var(--u); }
.opt { color: var(--desk); }
.field input, .field textarea, .field select {
  width: 100%;
  font: 400 17px/1.4 var(--f-text); color: var(--ink);
  background: #FFFFFF;
  border: var(--line);
  box-shadow: inset 2px 2px 0 var(--chrome);
  padding: 10px 12px;
  border-radius: 0;
  caret-color: var(--signal);
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 7 4' shape-rendering='crispEdges'%3E%3Cpath fill='%23121212' d='M0 0h7v1H0zM1 1h5v1H1zM2 2h3v1H2zM3 3h1v1H3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline-offset: 0; }
.field [aria-invalid="true"] { border-style: dashed; }
.hint { font-size: 15px; color: var(--desk); margin: var(--u) 0 0 !important; }
.error { font-size: 15px; font-weight: 700; margin: var(--u) 0 0 !important; display: flex; gap: var(--u); align-items: flex-start; }
.error::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Crect width='10' height='10' fill='%23121212'/%3E%3Crect x='4' y='2' width='2' height='4' fill='%23F4F3F0'/%3E%3Crect x='4' y='7' width='2' height='1' fill='%23F4F3F0'/%3E%3C/svg%3E") no-repeat;
}
/* spam trap: off-screen for people, visible to bots */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ph { font: 400 13px/1 var(--f-chrome); background: var(--chrome); border: 2px dashed var(--desk); padding: 2px 6px; }
.form-msg.is-ok { background: var(--paper); }
.form-msg:empty { display: none; }
.form-msg { font-weight: 700; background: var(--chrome); border: var(--line); padding: var(--u) calc(var(--u) * 1.5); }

/* -------------------------------------------------------- templates, map */
.trash { display: flex; gap: calc(var(--u) * 3); align-items: center; }
.trash svg { width: 96px; height: 96px; flex: none; }
.sitemap { margin: calc(var(--u) * 2) 0 0; padding-left: 20px; display: grid; gap: var(--u); }
.sitemap ul { margin: var(--u) 0 0; padding-left: 20px; }

/* ------------------------------------------------------------ garden.exe */
.win--garden .win-body { padding: 0; overflow: visible; }
.map {
  position: relative;
  width: calc(var(--map-w) * var(--map-scale) * 1px);
  aspect-ratio: 336 / 144;
  outline-offset: -4px;
}
.map:focus-visible { outline: 2px solid var(--signal); }
.map-art { width: 100%; height: auto; }
.door {
  position: absolute;
  left: calc(var(--tx) * 16 / 336 * 100%);
  top: calc(32 / 144 * 100%);
  width: calc(16 / 336 * 100%);
  height: calc(16 / 144 * 100%);
}
.door-label {
  position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0;
  font: 400 13px/1 var(--f-game);
  color: var(--paper); background: var(--ink);
  padding: 4px 7px; white-space: nowrap; text-transform: uppercase;
}
.door:hover .door-label, .door.is-here .door-label { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.player {
  --px: 7; --py: 4;
  position: absolute;
  left: calc(var(--px) * 16 / 336 * 100%);
  top: calc((var(--py) * 16 - 6) / 144 * 100%);
  width: calc(16 / 336 * 100%);
  pointer-events: none;
}
.player svg { width: 100%; height: auto; }
.player.is-left svg { scale: -1 1; }

.goto {
  display: flex; align-items: center; justify-content: flex-end; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 1.5) calc(var(--u) * 2);
  background: var(--ink); color: var(--paper);
  font: 400 15px/1 var(--f-game); text-transform: uppercase;
}
.goto-k { color: var(--chrome); }
.goto ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.goto a {
  display: flex; align-items: center; gap: var(--u);
  min-height: 32px; padding: 4px 8px;
  color: var(--paper); text-decoration: none;
}
.goto a svg:not(.sel) { display: none; }
.goto .sel { width: 10px; height: 14px; visibility: hidden; }
.goto a:hover, .goto a.is-here { background: var(--paper); color: var(--ink); }
.goto a:hover .sel, .goto a.is-here .sel, .goto a:focus-visible .sel { visibility: visible; }
.goto a:focus-visible { outline: 2px solid var(--paper); outline-offset: 0; }

/* ----------------------------------------------------- boot, zoom, vsrc */
.boot {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  background: var(--desk);
  cursor: pointer;
}
.boot-card { display: grid; justify-items: center; gap: calc(var(--u) * 2); }
.boot-card svg { width: 64px; height: 64px; }
.boot-name { font: 700 28px/1 var(--f-display); color: var(--paper); }
.boot-bar { display: flex; gap: 4px; padding: 4px; border: 2px solid var(--paper); }
.boot-bar i { width: 12px; height: 12px; background: transparent; }
.boot-bar i.on { background: var(--paper); }
.boot-skip { font: 400 12px/1 var(--f-chrome); color: var(--chrome); }

.zoom-rect {
  position: fixed; z-index: 1500; pointer-events: none;
  border: 2px dotted var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
}

.vs .desktop {
  background-image:
    repeating-linear-gradient(90deg, rgb(244 243 240 / 0.14) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(180deg, rgb(244 243 240 / 0.14) 0 1px, transparent 1px 8px);
}
.vs .win[data-note]::after {
  content: attr(data-note);
  position: absolute; left: -2px; top: calc(100% + 12px);
  max-width: calc(100% + 4px);
  font: 400 12px/1.4 var(--f-chrome);
  background: var(--chrome); color: var(--ink);
  border: var(--line); padding: 4px 8px;
}

/* ----------------------------------------------------------------- phone */
@media (max-width: 899px) {
  :root { --map-scale: 1; }
  body { font-size: 17px; }
  .menubar { gap: var(--u); padding: 0 calc(var(--u) * 1.5); }
  .menubar-nav li:not(:last-child), .clock, .vs-toggle { display: none; }
  .menubar-nav { margin-left: auto; }

  .desktop {
    height: auto; min-height: 0; overflow: visible;
    display: flex; flex-direction: column; gap: calc(var(--u) * 2);
    padding: calc(var(--u) * 1.5) calc(var(--u) * 1.5) calc(var(--u) * 4);
  }
  .icons { display: none; }

  .win, .win--welcome, .win--garden {
    position: relative; left: auto; top: auto; width: auto; max-height: none;
    box-shadow: 4px 4px 0 var(--ink);
  }
  .win--welcome { order: 1; }
  .win--garden { order: 2; }
  .win-body { padding: calc(var(--u) * 2) calc(var(--u) * 2) calc(var(--u) * 3); }
  .win--welcome .display { font-size: 36px; }

  /* section windows become full-screen sheets */
  .win:not(.win--welcome):not(.win--garden) {
    position: fixed; inset: calc(var(--bar) + 2px) 0 0 0; z-index: calc(100 + var(--z, 1));
    border: 0; box-shadow: none;
    max-height: none;
  }
  .win:not(.win--welcome):not(.win--garden) .win-body { flex: 1; }

  .win--garden .win-body { background: var(--ink); }
  .win--garden .win-body { overflow-x: auto; }
  .map { margin: 0 auto; flex: none; }
  .hide-phone { display: none !important; }
  .door-label { display: none; }
  .goto { flex-direction: column; align-items: stretch; gap: var(--u); padding: calc(var(--u) * 1.5); }
  .goto-k { font-size: 12px; }
  .goto ul { flex-direction: column; }
  .goto a { min-height: 48px; gap: var(--u); font-size: 16px; }
  .goto a svg:not(.sel) { display: block; width: 32px; height: 32px; }

  .services { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr 1fr; }
  .trash { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { translate: none; }
}
