/* ==========================================================
   MKDZ studio — styles
   ========================================================== */
:root {
  --mat: #1f3a2b;
  --mat-deep: #172d21;
  --mat-line: rgba(236, 229, 210, .07);
  --mat-line-strong: rgba(236, 229, 210, .16);
  --paper: #f4eee2;
  --paper-2: #ebe3d3;
  --ink: #151413;
  --ink-2: #4a4640;
  --cream: #ece5d2;
  --red: #ff4d2e;
  --yellow: #ffd23f;
  --pink: #ff9ec7;
  --blue: #7fb2ff;
  --green: #b8e07a;
  --boot-bg: #0f0f0e;

  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --shadow-1: 0 1px 1px rgba(0,0,0,.18), 0 6px 14px rgba(0,0,0,.22);
  --shadow-2: 0 2px 2px rgba(0,0,0,.2), 0 22px 40px rgba(0,0,0,.35);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--mat);
  color: var(--ink);
  font-family: var(--display);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); vertical-align: middle; margin-right: 6px; animation: blink 2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--boot-bg);
  color: #d8d3c7;
  font-family: var(--mono); font-size: 12.5px;
  display: grid; place-items: center;
  transition: opacity .7s ease, visibility .7s;
}
#boot::after { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
}
#boot.gone { opacity: 0; visibility: hidden; }
.boot-inner { width: min(600px, calc(100vw - 32px)); }
.boot-cmd { margin: 0 0 22px; }
.dim { color: #6d6a63; }
.hl { color: var(--red); }
.pen svg { width: 100%; height: 110px; overflow: visible; display: block; }
.pen-guide { stroke: #3a3833; stroke-width: 1; fill: none; }
.pen-path { stroke: var(--red); stroke-width: 2; fill: none; stroke-dasharray: 900; stroke-dashoffset: 900; }
.pen-anchors rect { fill: var(--boot-bg); stroke: #d8d3c7; stroke-width: 1.2; opacity: 0; transition: opacity .3s; }
.pen-anchors rect.on { opacity: 1; }
.pen-meta { display: flex; justify-content: space-between; color: #6d6a63; margin: 8px 0 22px; }
.pen-meta span:last-child { color: #d8d3c7; }
.boot-log { list-style: none; margin: 0 0 18px; padding: 0; min-height: 120px; }
.boot-log li { line-height: 1.75; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.boot-log .ok { color: var(--green); }
.boot-log li:last-child::after { content: "▌"; color: var(--red); animation: blink 1s steps(1) infinite; }
.boot-stat { color: #8f8a80; margin: 0 0 22px; }
.boot-bar-head { display: flex; justify-content: space-between; color: var(--red); letter-spacing: .12em; font-size: 11px; margin-bottom: 8px; }
.boot-cells { display: grid; grid-template-columns: repeat(48, 1fr); gap: 3px; }
.boot-cells i { height: 6px; background: #2a2926; border-radius: 1px; }
.boot-cells i.on { background: var(--red); }
.boot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; opacity: 0; transform: translateY(8px); transition: .5s ease; pointer-events: none; }
.boot-actions.show { opacity: 1; transform: none; pointer-events: auto; }
.btn-solid, .btn-ghost {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 15px 10px; border-radius: 8px; border: 1px solid #3a3833; background: transparent;
  transition: transform .15s, background .2s, color .2s;
}
.btn-solid { background: var(--red); border-color: var(--red); color: #160b08; }
.btn-solid:hover { background: #ff6a50; }
.btn-ghost:hover { background: #1d1c1a; }
.btn-solid:active, .btn-ghost:active { transform: scale(.97); }
.boot-skip { text-align: center; color: #4f4c46; font-size: 10.5px; margin-top: 18px; letter-spacing: .08em; }

/* ---------- Studio / desk ---------- */
#studio { position: fixed; inset: 0; }
#viewport {
  position: absolute; inset: 0; overflow: hidden;
  cursor: grab; touch-action: none; outline: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.35) 100%),
    var(--mat-deep);
}
#viewport.dragging { cursor: grabbing; }
#desk {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--mat-line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line-strong) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 40px 120px rgba(0,0,0,.5);
}
.ruler { position: absolute; font-family: var(--mono); font-size: 10px; color: rgba(236,229,210,.35); pointer-events: none; }
.ruler span { position: absolute; }
.diag { position: absolute; pointer-events: none; border-top: 1px dashed rgba(236,229,210,.1); transform-origin: 0 0; }

.item { position: absolute; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); transition: transform .35s cubic-bezier(.2,.9,.3,1.3), box-shadow .3s, filter .3s; }
.item.drop { animation: drop .7s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: var(--d, 0s); }
@keyframes drop {
  from { opacity: 0; transform: translate(-50%, -62%) rotate(calc(var(--r, 0deg) * -2.5)) scale(1.25); }
  to { opacity: 1; }
}
.item:hover, .item:focus-visible { z-index: 20; }
.shuffling .item { transition: left .8s cubic-bezier(.2,.9,.3,1.1), top .8s cubic-bezier(.2,.9,.3,1.1), transform .8s cubic-bezier(.2,.9,.3,1.3); }

/* posters */
.poster {
  width: 214px; padding: 7px; background: #fbf8f1; border: 0;
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.poster.wide { width: 290px; }
.poster.square { width: 240px; }
.poster img { width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; background: var(--paper-2); }
.poster::before { /* tape */
  content: ""; position: absolute; left: 50%; top: -11px; width: 70px; height: 22px;
  transform: translateX(-50%) rotate(var(--tr, -3deg));
  background: rgba(255, 233, 160, .62);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  mix-blend-mode: multiply;
}
.poster .cap {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); text-align: center;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--cream);
  opacity: 0; transform: translateY(-4px); transition: .25s; pointer-events: none; white-space: nowrap;
}
.poster .cap b { color: var(--yellow); font-weight: 500; }
.poster:hover { transform: translate(-50%, -52%) rotate(0deg) scale(1.08); box-shadow: var(--shadow-2); }
.poster:hover .cap { opacity: 1; transform: none; }

/* brand folders */
.folder { width: 262px; height: 300px; background: none; border: 0; padding: 0; cursor: pointer; }
.folder .back { position: absolute; inset: 22px 0 0; background: var(--fc, #d8b679); border-radius: 4px 10px 10px 10px; box-shadow: var(--shadow-1); }
.folder .back::before { content: ""; position: absolute; left: 0; top: -20px; width: 110px; height: 22px; background: var(--fc, #d8b679); border-radius: 8px 8px 0 0; }
.folder .peek {
  position: absolute; left: 16px; right: 16px; top: 34px; height: 190px; overflow: hidden;
  background: #fff; padding: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transform: rotate(-2deg); transition: transform .45s cubic-bezier(.2,.9,.3,1.3);
}
.folder .peek img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.folder .front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 130px;
  background: var(--fc2, #e8c98b); border-radius: 6px 6px 10px 10px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.18) inset, 0 -1px 0 rgba(255,255,255,.25) inset;
  padding: 16px 16px 14px; text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  color: var(--ink);
}
.folder .front .fname { font-weight: 800; font-size: 22px; line-height: 1; font-stretch: 85%; text-transform: uppercase; letter-spacing: -.01em; }
.folder .front .fkind { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-top: 6px; }
.folder .chips { display: flex; gap: 4px; }
.folder .chips i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,.18); }
.folder:hover { transform: translate(-50%, -52%) rotate(0deg) scale(1.04); }
.folder:hover .peek { transform: translateY(-64px) rotate(3deg); }

/* sticky notes */
.sticky {
  width: 206px; min-height: 196px; padding: 18px 18px 16px; border: 0; text-align: left;
  background: var(--sc, var(--yellow)); color: var(--ink);
  box-shadow: 0 1px 1px rgba(0,0,0,.15), 0 14px 18px -8px rgba(0,0,0,.4);
  border-radius: 2px 2px 26px 2px / 2px 2px 14px 2px;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px;
}
.sticky .sn { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; opacity: .6; }
.sticky .st { font-family: var(--hand); font-weight: 700; font-size: 30px; line-height: .95; }
.sticky .sd { font-family: var(--hand); font-size: 19px; line-height: 1.05; opacity: .8; }
.sticky .star { position: absolute; right: 12px; top: 8px; font-size: 26px; color: var(--red); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sticky:hover { transform: translate(-50%, -53%) rotate(calc(var(--r) * -.6)) scale(1.06); }

/* hand-written labels & doodles on the mat */
.label {
  position: absolute; font-family: var(--hand); font-size: 30px; color: var(--cream);
  transform: translate(-50%, -50%) rotate(var(--r, -3deg)); pointer-events: none; white-space: nowrap;
}
.label small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; margin-top: 4px; }
.doodle { position: absolute; pointer-events: none; color: var(--cream); opacity: .75; }

/* hero sheet */
.hero {
  width: 1000px; padding: 46px 54px 44px; background: var(--paper);
  box-shadow: var(--shadow-2);
  cursor: default;
  background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px);
  background-size: 4px 4px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; width: 110px; height: 26px; background: rgba(255, 233, 160, .7); mix-blend-mode: multiply;
}
.hero::before { left: -30px; top: 18px; transform: rotate(-38deg); }
.hero::after { right: -30px; bottom: 22px; transform: rotate(-38deg); }
.hero-top { display: flex; justify-content: space-between; gap: 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 18px; border-bottom: 1.5px solid var(--ink); }
.hero-top .avail { color: var(--ink); }
.hero h1 {
  margin: 26px 0 0; font-weight: 850; line-height: .84; letter-spacing: -.02em; text-transform: uppercase;
  font-size: 132px; white-space: nowrap; user-select: none;
}
.hero h1 .ln { display: block; }
.hero h1 .ch { display: inline-block; font-variation-settings: "wdth" var(--w, 75); transition: font-variation-settings .25s ease-out; }
.hero h1 .loud { color: var(--red); position: relative; }
.hero h1 .scrib { position: absolute; left: -2%; right: -2%; bottom: -16px; height: 26px; width: 104%; }
.hero h1 .scrib path { stroke: var(--ink); stroke-width: 5; fill: none; stroke-linecap: round; stroke-dasharray: 800; stroke-dashoffset: 800; }
.hero.inked h1 .scrib path { animation: ink 1.1s .6s ease forwards; }
@keyframes ink { to { stroke-dashoffset: 0; } }
.hero-bottom { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; margin-top: 40px; align-items: end; }
.hero p { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink-2); max-width: 46ch; font-stretch: 95%; }
.hero p b { color: var(--ink); }
.hero-ctas { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.pill {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 14px 18px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  transition: transform .2s cubic-bezier(.2,.9,.3,1.4), background .2s, color .2s;
}
.pill:hover { transform: translateY(-2px) rotate(-2deg); }
.pill.solid { background: var(--ink); color: var(--paper); }
.pill.solid:hover { background: var(--red); border-color: var(--red); color: var(--ink); }
.stamp { position: absolute; right: -54px; top: -64px; width: 150px; height: 150px; pointer-events: none; }
.stamp svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.stamp text { font-family: var(--mono); font-size: 10.6px; letter-spacing: .32em; fill: var(--ink); font-weight: 700; }
.stamp .core { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: var(--red); }
.stamp .disc { fill: var(--yellow); }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 30; font-family: var(--mono); color: var(--cream); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; pointer-events: none; }
.clock { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.hud-tools { display: flex; gap: 10px; align-items: center; }
.zoom { display: flex; background: rgba(20,20,18,.55); backdrop-filter: blur(8px); border: 1px solid rgba(236,229,210,.14); border-radius: 10px; overflow: hidden; }
.zoom button { width: 38px; height: 38px; background: none; border: 0; font-size: 18px; color: var(--cream); }
.zoom button + button { border-left: 1px solid rgba(236,229,210,.14); }
.zoom button:hover { background: rgba(236,229,210,.08); }
.menu-wrap { position: relative; }
.menu-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(236,229,210,.14); background: rgba(20,20,18,.55); backdrop-filter: blur(8px); display: grid; grid-template-columns: repeat(2, 4px); gap: 4px; place-content: center; }
.menu-btn i { width: 4px; height: 4px; border-radius: 50%; background: var(--cream); transition: transform .3s; }
.menu-btn[aria-expanded="true"] i:nth-child(1) { transform: translate(4px, 4px); }
.menu-btn[aria-expanded="true"] i:nth-child(4) { transform: translate(-4px, -4px); }
.menu { position: absolute; right: 0; top: 48px; min-width: 210px; padding: 6px; border-radius: 12px; background: rgba(20,20,18,.92); backdrop-filter: blur(10px); border: 1px solid rgba(236,229,210,.14); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--cream); padding: 11px 12px; border-radius: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.menu button:hover { background: rgba(236,229,210,.08); }
.menu b { color: var(--yellow); font-weight: 500; }

.hud-id { left: 22px; bottom: 22px; }
.hud-id strong { display: block; font-family: var(--display); font-weight: 850; font-size: 17px; letter-spacing: .01em; font-stretch: 90%; }
.hud-id strong span { opacity: .5; font-weight: 500; }
.hud-id small { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); margin-top: 5px; }

.dock {
  position: fixed; z-index: 30; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 5px; border-radius: 14px;
  background: rgba(20,20,18,.7); backdrop-filter: blur(10px); border: 1px solid rgba(236,229,210,.14);
}
.dock button {
  background: none; border: 0; color: var(--cream); font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 11px 14px; border-radius: 10px; white-space: nowrap; transition: background .2s, transform .2s cubic-bezier(.2,.9,.3,1.5);
}
.dock button em { font-style: normal; color: var(--red); margin-right: 6px; font-size: 10px; }
.dock button:hover { background: rgba(236,229,210,.08); transform: translateY(-3px); }
.dock button.on { background: rgba(236,229,210,.12); }

.hint {
  position: fixed; z-index: 29; left: 50%; bottom: 84px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream);
  background: rgba(20,20,18,.6); backdrop-filter: blur(8px); border: 1px solid rgba(236,229,210,.14);
  padding: 12px 18px; border-radius: 12px; text-align: center; transition: opacity .5s, transform .5s; pointer-events: none;
}
.hint.gone { opacity: 0; transform: translate(-50%, 10px); }
.hint-arrows { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; font-size: 13px; opacity: .7; }
.mouse { width: 14px; height: 21px; border: 1.5px solid var(--cream); border-radius: 8px; position: relative; animation: sway 1.8s ease-in-out infinite; }
.mouse i { position: absolute; left: 50%; top: 4px; width: 2px; height: 5px; margin-left: -1px; background: var(--red); border-radius: 2px; }
@keyframes sway { 0%,100% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }

.minimap {
  position: fixed; z-index: 30; right: 22px; bottom: 22px; width: 170px;
  border-radius: 10px; overflow: hidden; cursor: pointer;
  background: rgba(20,20,18,.6); backdrop-filter: blur(8px); border: 1px solid rgba(236,229,210,.14);
}
.minimap .mm-z { position: absolute; border-radius: 2px; }
.mm-view { position: absolute; border: 1.5px solid var(--yellow); border-radius: 3px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; }

.cursor-tag {
  position: fixed; z-index: 90; left: 0; top: 0; pointer-events: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--yellow); color: var(--ink); padding: 6px 9px; border-radius: 999px;
  opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .2s, transform .2s;
}
.cursor-tag.on { opacity: 1; transform: translate(14px, 14px) scale(1); }

.toast {
  position: fixed; z-index: 95; left: 50%; top: 20px; transform: translate(-50%, -80px);
  font-family: var(--mono); font-size: 12px; background: var(--yellow); color: var(--ink); padding: 10px 16px; border-radius: 999px;
  transition: transform .4s cubic-bezier(.2,.9,.3,1.3); box-shadow: var(--shadow-1);
}
.toast.on { transform: translate(-50%, 0); }

/* ---------- Windows ---------- */
#windows { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.win {
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 8px 8px 0 rgba(0,0,0,.45), 0 30px 80px rgba(0,0,0,.35);
  max-width: calc(100vw - 24px); max-height: calc(100vh - 110px);
  animation: winIn .35s cubic-bezier(.2,.9,.3,1.25) both;
  overflow: hidden;
}
.win.closing { animation: winOut .22s ease both; }
@keyframes winIn { from { opacity: 0; transform: scale(.92) translateY(14px); } }
@keyframes winOut { to { opacity: 0; transform: scale(.95) translateY(8px); } }
.win.max { left: 12px !important; top: 12px !important; width: calc(100vw - 24px) !important; height: calc(100vh - 100px) !important; }
.win.min .win-body { display: none; }
.win.min { height: auto !important; }
.win-bar {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 0 6px 0 14px; height: 40px; border-bottom: 1.5px solid var(--ink);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  cursor: grab; user-select: none; touch-action: none;
  background: var(--paper);
}
.win.inactive .win-bar { background: var(--paper-2); color: var(--ink-2); }
.win-bar .wt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-bar .wt span { opacity: .5; text-transform: none; letter-spacing: 0; }
.win-bar button { width: 30px; height: 28px; border: 0; background: none; border-radius: 6px; font-size: 15px; line-height: 1; font-family: var(--mono); }
.win-bar button:hover { background: rgba(0,0,0,.08); }
.win-bar button[data-w="close"]:hover { background: var(--red); }
.win-body { flex: 1; overflow: auto; overscroll-behavior: contain; }
.win-body::-webkit-scrollbar { width: 10px; }
.win-body::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 10px; border: 3px solid var(--paper); }

/* tabs & chips */
.tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--ink); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.tabs button { flex: 1; background: none; border: 0; padding: 14px 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.tabs button + button { border-left: 1.5px solid var(--ink); }
.tabs button.on { background: var(--ink); color: var(--paper); }
.tabs button sup { color: var(--red); margin-left: 4px; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 16px 18px 4px; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip:hover { transform: rotate(-2deg); }

/* work grid */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; padding: 18px; }
.pcard { background: none; border: 0; padding: 0; text-align: left; }
.pcard .pimg { position: relative; aspect-ratio: 3 / 4; background: var(--paper-2); overflow: hidden; border: 1.5px solid var(--ink); }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.9,.3,1); }
.pcard:hover img { transform: scale(1.06) rotate(-1deg); }
.pcard .pt { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; }
.pcard .pt span:last-child { opacity: .5; }
.pcard .vdots { position: absolute; left: 6px; bottom: 6px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; font-family: var(--mono); font-size: 9.5px; padding: 3px 7px; }

.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 18px; }
.bcard { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; text-align: left; padding: 0; transition: transform .25s cubic-bezier(.2,.9,.3,1.4), box-shadow .25s; }
.bcard:hover { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: 6px 6px 0 var(--ink); }
.bcard .bimg { aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1.5px solid var(--ink); }
.bcard .bimg img { width: 100%; height: 100%; object-fit: cover; }
.bcard .binfo { padding: 14px 14px 16px; }
.bcard h3 { margin: 0; font-size: 22px; font-weight: 850; text-transform: uppercase; font-stretch: 85%; line-height: 1; }
.bcard p { margin: 6px 0 12px; font-size: 14px; color: var(--ink-2); }
.swatches { display: flex; gap: 5px; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink); }

/* brand case study */
.case { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; min-height: 100%; }
.readme {
  background: #161513; color: #d8d3c7; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  padding: 22px 24px 28px; border-right: 1.5px solid var(--ink);
  position: sticky; top: 0; align-self: start; max-height: 100%;
}
.readme .path { color: #6d6a63; margin-bottom: 18px; }
.readme .path b { color: var(--green); font-weight: 400; }
.readme h2 { font-family: var(--display); font-size: 40px; line-height: .9; font-weight: 850; font-stretch: 80%; text-transform: uppercase; color: var(--paper); margin: 0 0 10px; }
.readme .kicker { color: var(--yellow); margin: 0 0 18px; }
.readme h4 { color: var(--red); font-weight: 500; margin: 22px 0 8px; font-size: 12.5px; }
.readme h4::before { content: "## "; color: #6d6a63; }
.readme p { margin: 0; color: #bdb7aa; }
.readme ul { list-style: none; margin: 0; padding: 0; }
.readme li::before { content: "→ "; color: #6d6a63; }
.readme .pal { display: flex; flex-wrap: wrap; gap: 6px; }
.readme .pal button { display: flex; align-items: center; gap: 6px; background: #22211e; border: 1px solid #34322e; border-radius: 6px; padding: 5px 8px 5px 5px; color: #d8d3c7; font-family: var(--mono); font-size: 11px; }
.readme .pal button i { width: 16px; height: 16px; border-radius: 4px; }
.readme .pal button:hover { border-color: var(--yellow); }
.readme .nav2 { display: flex; justify-content: space-between; gap: 8px; margin-top: 26px; }
.readme .nav2 button { background: none; border: 1px solid #34322e; color: #d8d3c7; border-radius: 6px; padding: 8px 10px; font-family: var(--mono); font-size: 11px; }
.readme .nav2 button:hover { border-color: var(--red); color: var(--red); }
.gallery { columns: 2 260px; column-gap: 12px; padding: 14px; }
.gallery button { display: block; width: 100%; padding: 0; border: 1.5px solid var(--ink); background: var(--paper-2); margin: 0 0 12px; break-inside: avoid; overflow: hidden; border-radius: 6px; }
.gallery img { width: 100%; height: auto; transition: transform .5s cubic-bezier(.2,.9,.3,1); }
.gallery button:hover img { transform: scale(1.04); }

/* services */
.sides { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1.5px solid var(--ink); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.sides button { background: none; border: 0; padding: 16px 18px; text-align: left; }
.sides button + button { border-left: 1.5px solid var(--ink); }
.sides button small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.sides button span { display: block; font-weight: 850; font-size: 22px; text-transform: uppercase; font-stretch: 80%; margin-top: 4px; }
.sides button.on { background: var(--ink); color: var(--paper); }
.slist { list-style: none; margin: 0; padding: 0; }
.srow { border-bottom: 1.5px solid var(--ink); }
.srow > button {
  width: 100%; display: grid; grid-template-columns: 54px 1fr 34px; align-items: center; gap: 8px;
  background: none; border: 0; padding: 18px 18px; text-align: left; position: relative; overflow: hidden; isolation: isolate;
}
.srow > button::before { content: ""; position: absolute; inset: 0; background: var(--sc, var(--yellow)); transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.2,.9,.3,1); z-index: -1; }
.srow > button:hover::before, .srow.open > button::before { transform: scaleX(1); }
.srow .num { font-family: var(--mono); font-size: 11px; opacity: .6; }
.srow .stt { font-weight: 850; font-size: 30px; line-height: .95; text-transform: uppercase; font-variation-settings: "wdth" 70; transition: font-variation-settings .4s; }
.srow > button:hover .stt { font-variation-settings: "wdth" 100; }
.srow .plus { font-family: var(--mono); font-size: 22px; transition: transform .3s; text-align: center; }
.srow.open .plus { transform: rotate(45deg); }
.srow .sbody { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s ease; }
.srow.open .sbody { grid-template-rows: 1fr; }
.srow .sbody > div { overflow: hidden; }
.srow .sbody .in { padding: 4px 18px 22px 80px; }
.srow .sbody p { margin: 0 0 12px; font-size: 17px; color: var(--ink-2); max-width: 52ch; }
.srow .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.srow .tags span { font-family: var(--mono); font-size: 10.5px; padding: 5px 10px; border: 1.5px solid var(--ink); border-radius: 999px; }
.link-btn { background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.link-btn:hover { color: var(--red); }
.star-mark { color: var(--red); }

/* about (terminal) */
.term { background: #161513; color: #d8d3c7; font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 22px 24px 30px; min-height: 100%; }
.term .p { color: #6d6a63; }
.term .p b { color: var(--green); font-weight: 400; }
.term .out { margin: 4px 0 18px; color: #d8d3c7; }
.term .out.big { font-family: var(--display); font-size: 44px; line-height: .9; font-weight: 850; font-stretch: 80%; text-transform: uppercase; color: var(--paper); margin: 8px 0 14px; }
.term .out.big em { font-style: normal; color: var(--red); }
.term p.out { color: #bdb7aa; max-width: 60ch; }
.term table { border-collapse: collapse; margin: 4px 0 18px; }
.term td { padding: 1px 18px 1px 0; }
.term td:first-child { color: var(--yellow); }
.term .cursor::after { content: "▌"; color: var(--red); animation: blink 1s steps(1) infinite; }

/* contact */
.contact { padding: 22px 22px 26px; }
.contact h2 { margin: 0; font-weight: 850; font-size: 54px; line-height: .86; text-transform: uppercase; font-stretch: 75%; }
.contact h2 em { font-style: normal; color: var(--red); }
.contact .sub { margin: 12px 0 20px; color: var(--ink-2); font-size: 16px; }
.contact fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.contact legend, .contact label > span { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; color: var(--ink-2); }
.contact .chips-row { padding: 0; }
.contact .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact label { display: block; margin-bottom: 12px; }
.contact input, .contact textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fffdf8; color: var(--ink);
}
.contact textarea { min-height: 96px; resize: vertical; }
.contact input:focus, .contact textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--ink); }
.contact .send { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 6px; }
.contact .direct { font-family: var(--mono); font-size: 11.5px; }
.contact .direct a { color: var(--ink); }
.socials { display: flex; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--ink); font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.socials a { color: var(--ink); }
.socials a:hover { color: var(--red); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(12,12,11,.92); backdrop-filter: blur(6px);
  display: grid; grid-template-columns: 70px 1fr 70px; align-items: center;
  animation: fade .25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 0 18px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.6); background: #222; transition: opacity .2s; }
.lightbox img.loading { opacity: .35; }
.lightbox figcaption { width: 100%; max-width: 900px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; color: var(--cream); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.lb-title { font-family: var(--display); font-size: 22px; font-weight: 850; text-transform: uppercase; font-stretch: 85%; letter-spacing: 0; }
.lb-sub { opacity: .55; text-transform: uppercase; margin-left: 8px; }
.lb-count { opacity: .55; white-space: nowrap; }
.lb-variants { display: flex; gap: 6px; align-items: center; }
.lb-variants:not(:empty)::before { content: "colourways"; opacity: .55; text-transform: uppercase; font-size: 10.5px; margin-right: 4px; }
.lb-variants button { width: 34px; height: 44px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: #222; transition: transform .2s; }
.lb-variants button img { width: 100%; height: 100%; object-fit: cover; max-height: none; box-shadow: none; }
.lb-variants button.on { border-color: var(--yellow); transform: translateY(-3px); }
.lb-nav, .lb-close { background: none; border: 1px solid rgba(236,229,210,.2); color: var(--cream); width: 48px; height: 48px; border-radius: 50%; font-size: 18px; justify-self: center; transition: background .2s, transform .2s; }
.lb-nav:hover, .lb-close:hover { background: var(--red); border-color: var(--red); color: var(--ink); }
.lb-close { position: absolute; right: 18px; top: 18px; font-size: 24px; z-index: 2; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hud-top { padding: 14px 16px; }
  .clock { font-size: 10px; }
  .hud-id { display: none; }
  .minimap { display: none; }
  .zoom { display: none; }
  /* bigger type on the hero sheet so it reads at phone zoom */
  .hero { width: 620px; padding: 34px 34px 36px; }
  .hero-top { font-size: 15px; flex-direction: column; gap: 8px; }
  .hero p { font-size: 27px; max-width: none; }
  .hero-bottom { grid-template-columns: 1fr; gap: 26px; margin-top: 34px; }
  .hero-ctas { justify-content: flex-start; }
  .hero .pill { font-size: 17px; padding: 20px 24px; }
  .stamp { right: -30px; top: -50px; }
  .dock { left: 8px; right: 8px; transform: none; bottom: 10px; justify-content: space-between; overflow-x: auto; }
  .dock button { padding: 11px 9px; font-size: 10.5px; flex: 1; }
  .dock button em { display: none; }
  .hint { bottom: 132px; }
  .win { left: 0 !important; top: 0 !important; width: 100vw !important; height: calc(100dvh - 70px) !important; max-width: none; max-height: none; border-radius: 0 0 14px 14px; border-width: 0 0 1.5px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
  .win-bar { cursor: default; }
  .win-bar [data-w="max"] { display: none; }
  .case { grid-template-columns: 1fr; }
  .readme { position: static; border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .gallery { columns: 1; }
  .srow .stt { font-size: 24px; }
  .srow .sbody .in { padding-left: 18px; }
  .srow > button { grid-template-columns: 38px 1fr 28px; }
  .contact h2 { font-size: 42px; }
  .contact .row2 { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; }
  .lb-nav { position: absolute; bottom: 18px; z-index: 2; }
  .lb-prev { left: 18px; } .lb-next { right: 18px; }
  .lightbox figure { padding: 70px 12px 84px; }
  .lightbox figcaption { flex-direction: column; align-items: flex-start; gap: 10px; }
  .lightbox img { max-height: calc(100dvh - 260px); }
  .boot-cells { grid-template-columns: repeat(32, 1fr); }
  .boot-cells i:nth-child(n+33) { display: none; }
}

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