/* Manuel Restrepo — sober palette, two themes, one page per world. */
:root {
  --bg: #0c0c0c; --ink: #f4f4f2;
  --ink-2: rgba(247, 247, 247, .74); --ink-3: rgba(247, 247, 247, .46);
  --line: rgba(247, 247, 247, .1); --chip: rgba(247, 247, 247, .08);
  --pill: rgba(14, 14, 14, .76); --pill-line: rgba(255, 255, 255, .08);
  --btn: #f7f7f7; --btn-ink: #161616;
  --card: #151515; --card-2: #1a1a1a; --paper-2: #181818;
  --grain-op: .09; --shadow: 0 30px 80px rgba(0, 0, 0, .45);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --sig: "Mrs Saint Delafield", "Segoe Script", cursive;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e3e3e1; --ink: #161616;
  --ink-2: rgba(22, 22, 22, .74); --ink-3: rgba(22, 22, 22, .5);
  --line: rgba(22, 22, 22, .1); --chip: rgba(22, 22, 22, .07);
  --pill: rgba(250, 250, 248, .82); --pill-line: rgba(0, 0, 0, .08);
  --btn: #161616; --btn-ink: #f7f7f7;
  --card: #efefed; --card-2: #e8e8e6; --paper-2: #f4f4f2;
  --grain-op: .14; --shadow: 0 30px 70px rgba(0, 0, 0, .16);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; letter-spacing: -.01em;
  overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
input, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

.paper {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .28)),
    linear-gradient(transparent 49.6%, var(--line) 49.6%, var(--line) 50%, transparent 50%) 0 0 / 100% 33.333vh;
}
:root[data-theme="light"] .paper { background: radial-gradient(120% 90% at 50% 45%, transparent 60%, rgba(0, 0, 0, .07)),
    linear-gradient(transparent 49.6%, var(--line) 49.6%, var(--line) 50%, transparent 50%) 0 0 / 100% 33.333vh; }
.paper::after {
  content: ""; position: absolute; inset: -50%; opacity: var(--grain-op);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: none; } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -2%); } 60% { transform: translate(-2%, -4%); } 80% { transform: translate(4%, 2%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px) rotate(var(--r, 0deg)); filter: blur(6px); } }

.stage { position: fixed; inset: 0; z-index: 1; display: block; touch-action: none; transition: opacity .5s var(--ease); }
.stage.is-hover { cursor: pointer; } .stage.is-drag { cursor: grabbing; }
body:not([data-page="world"]) .stage, body[data-page="world"]:not([data-view="wheel"]) .stage { opacity: 0; pointer-events: none; }

/* Loader */
.loader { position: fixed; inset: 0; z-index: 90; background: var(--bg); transition: opacity .8s var(--ease) .1s, visibility 0s linear .9s; }
.loader.is-done { opacity: 0; visibility: hidden; }
.mark--loader { position: absolute; left: 20px; bottom: 20px; }
.loader__count { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; font-size: clamp(48px, 7vw, 96px); font-weight: 600; letter-spacing: -.05em; line-height: .9; }
.loader__t { color: var(--ink-3); }

/* Status */
.status { position: fixed; left: 24px; top: 6px; z-index: 40; display: flex; gap: 6px; font-size: 10px; font-weight: 600; letter-spacing: -.04em; pointer-events: none; }
.status span { background: var(--chip); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.status i { font-style: normal; color: var(--ink-3); } .status b { font-weight: 600; color: var(--ink-2); }

/* Header */
.top { position: fixed; left: 0; right: 0; top: 30px; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; pointer-events: none; }
.top > * { pointer-events: auto; }
.mark { display: inline-flex; gap: 2px; text-decoration: none; font-size: 19px; font-weight: 500; line-height: 1; }
.mark > span { display: grid; place-items: center; height: 26px; border: 1.6px solid currentColor; }
.mark__a { width: 26px; border-radius: 50%; }
.mark__b { min-width: 26px; padding: 0 5px; border-radius: 3px; overflow: hidden; transition: width .5s var(--ease); }
.mark__label { display: block; white-space: nowrap; font-size: 17px; letter-spacing: -.03em; transition: transform .45s var(--ease), opacity .3s; }
.mark__label.is-out { transform: translateY(-110%); opacity: 0; }
.pillrow { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.pill, .kbd, .theme { display: flex; align-items: center; height: 36px; padding: 3px; background: var(--pill); border: 1px solid var(--pill-line); border-radius: 8px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pill a { display: grid; place-items: center; height: 28px; padding: 0 10px; border-radius: 5px; font-size: 15px; text-decoration: none; transition: background-color .3s; }
.pill a:hover { background: var(--chip); }
.pill a.is-active { background: var(--chip); box-shadow: inset 0 0 0 1px var(--pill-line); }
.kbd { padding: 0 10px; font-size: 15px; } .kbd:hover { background: var(--chip); }
.theme { gap: 2px; }
.theme button { width: 30px; height: 28px; display: grid; place-items: center; border-radius: 5px; color: var(--ink-3); }
.theme button[aria-pressed="true"] { background: var(--chip); color: var(--ink); }

/* Pages */
.page { position: fixed; inset: 0; z-index: 10; visibility: hidden; opacity: 0; transition: opacity .55s var(--ease), visibility 0s linear .55s; }
body[data-page="about"] .page--about, body[data-page="world"] .page--world, body[data-page="detail"] .page--detail, body[data-page="contact"] .page--contact { visibility: visible; opacity: 1; transition: opacity .55s var(--ease) .1s, visibility 0s; }
.page--world { pointer-events: none; } .page--world > * { pointer-events: auto; }
.page--world .meta { pointer-events: none; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 5px; background: var(--btn); color: var(--btn-ink); font-size: 14px; font-weight: 500; text-decoration: none; transition: transform .3s var(--ease), opacity .3s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); opacity: .9; }
.btn--sm { height: 26px; font-size: 13px; padding: 0 9px; }
.btn--ghost { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.chips { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: -.03em; padding: 3px 7px; border-radius: 3px; background: var(--chip); color: var(--ink-2); }
.role { font-family: var(--mono); font-size: 9.5px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }

/* ── ABOUT scene ─────────────────────────────────────── */
.page--about { overflow: hidden; }
.scene { position: absolute; inset: 0; }
.card {
  --r: -1.2deg; position: absolute; left: 50%; top: 46%; translate: -50% -50%;
  width: min(680px, 92vw); display: grid; grid-template-columns: 200px 1fr; gap: 22px; padding: 16px; border-radius: 6px;
  background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transform: rotate(var(--r));
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(127, 127, 127, .025) 3px 4px);
}
body[data-page="about"] .card { animation: rise .9s var(--ease) .1s both; }
.clip { position: absolute; top: -18px; left: 30px; width: 22px; height: 48px; border: 2px solid var(--ink-3); border-radius: 11px; }
.clip::after { content: ""; position: absolute; left: 4px; right: 4px; top: 6px; bottom: 12px; border: 2px solid var(--ink-3); border-top: 0; border-radius: 0 0 8px 8px; }
.stamp { margin: 0; padding: 9px 9px 6px; background: #f2f2ef; color: #1a1a1a; position: relative; align-self: start; }
.stamp::before {
  --h: radial-gradient(circle 3.6px, var(--card) 95%, transparent 100%);
  content: ""; position: absolute; inset: -3.5px; pointer-events: none;
  background: var(--h) left top / 12px 7px repeat-x, var(--h) left bottom / 12px 7px repeat-x, var(--h) left top / 7px 12px repeat-y, var(--h) right top / 7px 12px repeat-y;
}
.stamp img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%; background: #cfcfcb; filter: grayscale(1) contrast(1.08); }
.stamp figcaption { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9px; font-weight: 600; text-transform: uppercase; padding: 6px 1px 2px; }
.card__right { display: flex; flex-direction: column; min-width: 0; gap: 8px; }
.card__top { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-3); }
.card__air { display: flex; flex-direction: column; font-size: 9px; line-height: 1.3; border: 1px solid var(--line); padding: 4px 6px; border-radius: 2px; }
.card__air b { color: var(--ink-2); }
.post--wave { width: 140px; opacity: .65; transform: rotate(-5deg); }
.card__icons { margin-left: auto; display: flex; gap: 4px; }
.ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.ico:hover { color: var(--ink); background: var(--chip); }
.ico--plain { box-shadow: none; }
.card__note { margin: 2px 0 0; font-family: var(--hand); font-size: 22px; line-height: 1.1; color: var(--ink); transform: rotate(-1deg); }
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.world {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; aspect-ratio: 1;
  border-radius: 50%; border: 1.3px solid var(--ink-3); text-decoration: none; color: var(--ink-2); text-align: center;
  transform: rotate(var(--t, -6deg)); transition: transform .4s var(--ease), color .3s, border-color .3s, background-color .3s;
}
.world::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed var(--line); }
.world b { font-size: clamp(16px, 1.8vw, 21px); font-weight: 600; letter-spacing: -.04em; color: var(--ink); }
.world span { font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.world:hover, .world:focus-visible { transform: rotate(0) scale(1.06); border-color: var(--ink); background: var(--chip); outline: none; }
.card__links { display: flex; gap: 2px; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 8px 0; }
.card__foot .mono { font-size: 11px; font-weight: 600; color: var(--ink-2); }

.tele {
  --r: 1.5deg; position: absolute; left: max(24px, 4vw); bottom: 9vh; width: 300px; padding: 14px 16px; z-index: 2;
  background: var(--card-2); border-radius: 6px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); font-size: 11px; transform: rotate(var(--r));
}
body[data-page="about"] .tele { animation: rise .9s var(--ease) .3s both; }
.tele header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 10px; }
.tele header i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.tele dl { margin: 0 0 10px; display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; }
.tele dt { color: var(--ink-3); } .tele dd { margin: 0; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 2px; }
.heat i { display: block; aspect-ratio: 1; border-radius: 1px; background: var(--ink); opacity: .07; }

.deck { --r: -2deg; position: absolute; right: max(56px, 6vw); bottom: 12vh; width: 300px; transform: rotate(var(--r)); z-index: 2; }
body[data-page="about"] .deck { animation: rise .9s var(--ease) .45s both; }
.deck__plate { position: relative; height: 190px; border-radius: 8px 8px 0 0; background: linear-gradient(145deg, #3a3a3a, #161616); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08); }
.deck__disc {
  position: absolute; left: 18px; top: 14px; width: 162px; height: 162px; border-radius: 50%;
  background: repeating-radial-gradient(circle, #121212 0 2px, #1e1e1e 2px 3px); box-shadow: 0 0 0 3px #0c0c0c, 0 8px 20px rgba(0,0,0,.5);
  display: grid; place-items: center;
}
.deck__disc.is-on { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.deck__label { width: 58px; height: 58px; border-radius: 50%; background: #eee center / cover no-repeat; box-shadow: 0 0 0 2px #0c0c0c; }
.deck__arm { position: absolute; right: 34px; top: 16px; width: 6px; height: 128px; background: linear-gradient(#ccc, #888); border-radius: 3px; transform-origin: 50% 6px; transform: rotate(8deg); transition: transform .8s var(--ease); }
.deck__arm::before { content: ""; position: absolute; top: -6px; left: -7px; width: 20px; height: 20px; border-radius: 50%; background: #d9d9d9; }
.deck__arm i { position: absolute; bottom: -8px; left: -4px; width: 14px; height: 18px; background: #bbb; border-radius: 2px; }
.deck__arm.is-on { transform: rotate(26deg); }
.deck__knob { position: absolute; right: 14px; bottom: 14px; width: 26px; height: 26px; border-radius: 50%; background: #d0d0d0; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.deck__knob::after { content: "▶"; display: grid; place-items: center; height: 100%; font-size: 10px; color: #111; }
.deck__knob.is-on::after { content: "❚❚"; font-size: 8px; }
.deck__screen { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #101010; color: #eee; border-radius: 0 0 8px 8px; }
.deck__screen .mono { font-size: 10px; margin: 0 0 4px; color: #999; } .deck__screen b { color: #eee; }
.deck__now { margin: 0; font-weight: 600; font-size: 14px; letter-spacing: -.02em; }
.deck__go { font-size: 10px; color: #bbb; text-decoration: none; white-space: nowrap; } .deck__go:hover { color: #fff; }

.files { position: absolute; right: 0; top: 50%; translate: 0 -50%; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.files a {
  writing-mode: vertical-rl; padding: 14px 7px; font-size: 10px; font-weight: 600; text-decoration: none; color: var(--ink-2);
  background: var(--card-2); border-radius: 6px 0 0 6px; box-shadow: inset 0 0 0 1px var(--line); transition: padding .3s var(--ease), color .3s;
}
.files a:hover { padding-right: 14px; color: var(--ink); }
.next { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; font-size: 10px; font-weight: 600; color: var(--ink-3); text-decoration: none; animation: bob 2.2s var(--ease) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .4s var(--ease) both; }
.x { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; background: var(--pill); border: 1px solid var(--pill-line); }
.x:hover { background: var(--chip); }
.x--bottom { position: absolute; left: 50%; bottom: 24px; translate: -50% 0; }
.letter { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 48px); overflow: auto; padding: 22px 26px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); animation: rise .55s var(--ease) both; }
.letter header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.letter header .mono { font-size: 11px; font-weight: 600; margin: 0; }
.letter p { line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; text-wrap: pretty; }
.letter .letter__hello { color: var(--ink-3); }
.letter #letterBody p { color: var(--ink); }
.letter a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.letter__sign { font-family: var(--sig); font-size: 44px !important; line-height: 1 !important; color: var(--ink) !important; margin: 10px 0 0 !important; }
.letter__role { font-size: 10px !important; color: var(--ink-3) !important; }
.record { position: relative; width: min(620px, 100%); padding: 22px; border-radius: 8px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); animation: rise .55s var(--ease) both; }
.record > .mono { font-size: 11px; font-weight: 600; color: var(--ink-3); margin: 0 0 10px; }
.record a { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.record a b { font-size: 26px; font-weight: 600; letter-spacing: -.04em; }
.record a span { color: var(--ink-2); font-size: 14px; }
.record a em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.record a:hover b { text-decoration: underline; text-underline-offset: 4px; }

/* ── WORLD: meta (wheel) ─────────────────────────────── */
.meta { position: fixed; z-index: 12; left: 50%; top: 50%; width: min(26vw, 360px); height: 180px; transform: translate(-50%, -50%); transition: opacity .4s; }
body:not([data-view="wheel"]) .meta { opacity: 0; visibility: hidden; }
.meta__item { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: transform .8s var(--ease), opacity .55s var(--ease), filter .6s var(--ease); }
.meta__item.is-enter { transform: translateY(38px); opacity: 0; filter: blur(6px); }
.meta__item.is-leave { transform: translateY(-38px); opacity: 0; filter: blur(6px); }
.meta__n { font-size: 12px; font-weight: 500; color: var(--ink-3); margin: 0 0 6px; }
.meta__title { font-size: clamp(28px, 2.6vw, 40px); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; margin: 0 0 12px; text-wrap: balance; }
.meta .role { margin-top: 8px; }
.meta__cta { margin-top: 16px; pointer-events: auto; }
.meta .btn { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--pill-line); }
.meta .btn:hover { background: var(--btn); color: var(--btn-ink); opacity: 1; }

/* view switcher */
.views { position: fixed; z-index: 30; left: 50%; bottom: 22px; translate: -50% 0; display: flex; gap: 2px; padding: 3px; background: var(--pill); border: 1px solid var(--pill-line); border-radius: 7px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.views button { height: 26px; padding: 0 10px; border-radius: 4px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--ink-3); }
.views button[aria-selected="true"] { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--pill-line); }
.rail { position: fixed; right: 24px; bottom: 30px; z-index: 20; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-3); }
.rail i { width: 90px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.rail i b { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease); }
.rail #railNow { color: var(--ink); }

/* LIST */
.list { position: fixed; inset: 0; z-index: 11; overflow: hidden; touch-action: none; }
body:not([data-view="list"]) .list { visibility: hidden; opacity: 0; }
.list { transition: opacity .45s var(--ease); }
.list__rows { position: absolute; inset: 0; }
.lrow {
  position: absolute; left: 24px; top: 0; display: flex; align-items: center; gap: 10px; height: var(--rh, 60px);
  font-size: clamp(32px, 4vw, 58px); font-weight: 500; letter-spacing: -.045em; line-height: 1; color: var(--ink-3);
  text-decoration: none; white-space: nowrap; will-change: transform; transition: color .25s;
}
.lrow.is-on { color: var(--ink); }
.lrow .chips { opacity: 0; transition: opacity .25s; align-self: center; }
.lrow.is-on .chips { opacity: 1; }
.lrow .role { align-self: flex-end; margin-bottom: 8px; }
.list__preview { position: absolute; right: 24px; top: 50%; translate: 0 -50%; width: min(34vw, 520px); aspect-ratio: 16 / 10; margin: 0; border-radius: 8px; overflow: hidden; background: #111; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.list__preview img, .list__preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s; }
.list__preview .mk { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 40%, #2a2a2a, #0f0f0f); font-size: 120px; font-weight: 600; letter-spacing: -.06em; color: #eee; }

/* GRID */
.grid { position: fixed; inset: 0; z-index: 11; overflow: hidden; perspective: 1400px; touch-action: none; cursor: grab; transition: opacity .45s var(--ease); }
.grid.is-drag { cursor: grabbing; }
body:not([data-view="grid"]) .grid { visibility: hidden; opacity: 0; }
.grid__plane { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }
.gcell { position: absolute; left: 0; top: 0; width: var(--cw); transform-style: preserve-3d; will-change: transform; text-decoration: none; }
.gcell__img { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.gcell__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.gcell__img .mk { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 40%, #2a2a2a, #0f0f0f); font-size: 64px; font-weight: 600; color: #eee; letter-spacing: -.05em; }
.gcell:hover .gcell__img img { transform: scale(1.04); }
.gcell__cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 2px 0; }
.gcell__cap b { font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcell__cap .chip { font-size: 9.5px; white-space: nowrap; }

/* ── PROJECT PAGE (frame) ─────────────────────────────── */
.frame { position: absolute; inset: 76px 16px 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: color-mix(in srgb, var(--bg) 70%, #000 6%); overflow: hidden; }
.frame__tabs { position: absolute; top: 14px; left: 50%; translate: -50% 0; z-index: 3; display: flex; gap: 2px; padding: 3px; background: var(--pill); border: 1px solid var(--pill-line); border-radius: 7px; }
.frame__tabs { max-width: calc(100% - 220px); overflow-x: auto; scrollbar-width: none; }
.frame__tabs::-webkit-scrollbar { display: none; }
.frame__tabs button { flex: none; }
.frame__tabs:empty { display: none; }
.frame__tabs button { height: 24px; padding: 0 10px; border-radius: 4px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--ink-3); }
.frame__tabs button[aria-selected="true"] { background: var(--chip); color: var(--ink); }
.frame__media { position: absolute; left: 3%; right: calc(3% + 330px); top: 60px; bottom: 64px; display: grid; place-items: center; }
.frame__media .box { position: relative; width: 100%; max-height: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0d0d0d; box-shadow: var(--shadow); animation: rise .6s var(--ease) both; }
.frame__media .box--v { width: auto; height: 100%; aspect-ratio: 9 / 16; }
.frame__media .box--img { aspect-ratio: 16 / 10; }
.frame__media iframe, .frame__media video, .frame__media img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.frame__media .box--img img { object-fit: contain; background: #0d0d0d; }
.frame__media .mk { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 40%, #2a2a2a, #0f0f0f); font-size: clamp(80px, 12vw, 180px); font-weight: 600; letter-spacing: -.06em; color: #eee; }
.frame__info { position: absolute; right: 16px; bottom: 16px; width: 310px; max-height: calc(100% - 32px); overflow: auto; padding: 16px; border-radius: 8px; background: var(--pill); border: 1px solid var(--pill-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise .6s var(--ease) .1s both; }
.frame__n { font-size: 11px; color: var(--ink-3); margin: 0 0 6px; }
.frame__info h2 { font-size: 30px; font-weight: 600; letter-spacing: -.05em; line-height: 1; margin: 0 0 10px; }
.frame__info .chips { justify-content: flex-start; }
.frame__info .role { display: block; margin-top: 8px; }
.frame__brief { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin: 14px 0; text-wrap: pretty; }
.frame__facts { list-style: none; padding: 0; margin: 0 0 14px; font-size: 11px; }
.frame__facts li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.frame__facts li span:first-child { color: var(--ink-3); }
.frame__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.frame__pager { position: absolute; left: calc(50% - 165px); bottom: 16px; translate: -50% 0; display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--ink-2); }
.frame__pager button { width: 28px; height: 28px; border-radius: 6px; background: var(--chip); }
.frame__pager button:hover { background: var(--btn); color: var(--btn-ink); }
.frame__back { position: absolute; left: 16px; top: 18px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); text-decoration: none; z-index: 3; }
.frame__back:hover { color: var(--ink); }

/* ── CONTACT (letter + receipt) ───────────────────────── */
.page--contact { overflow: auto; }
.desk { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 96px 24px 40px; }
.paperletter { --r: -.8deg; width: min(560px, 100%); padding: 26px 28px; border-radius: 4px; background: var(--paper-2); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transform: rotate(var(--r)); }
body[data-page="contact"] .paperletter { animation: rise .8s var(--ease) both; }
.paperletter__head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.paperletter__head p { margin: 0; } .paperletter__head .mono { font-size: 10px; color: var(--ink-3); margin-top: 3px; }
.paperletter__name { font-weight: 600; font-size: 18px; letter-spacing: -.03em; }
.paperletter__dear { font-family: var(--hand); font-size: 26px; margin: 0 0 12px; }
.row { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row legend { float: left; font-size: 10.5px; font-weight: 600; color: var(--ink-3); margin-right: 6px; }
.row label { cursor: pointer; } .row input { position: absolute; opacity: 0; pointer-events: none; }
.row span { display: inline-block; padding: 4px 9px; border-radius: 4px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); }
.row input:checked + span { background: var(--btn); color: var(--btn-ink); }
.row input:focus-visible + span { outline: 2px solid var(--ink); }
.line { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px dashed var(--line); padding: 8px 0; }
.line span { font-size: 10.5px; font-weight: 600; color: var(--ink-3); flex: none; width: 56px; }
.line input, .body textarea, .sign input { flex: 1; background: none; border: 0; outline: 0; font-size: 15px; }
.body { display: block; padding: 12px 0 4px; }
.body span { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.body textarea { width: 100%; resize: vertical; line-height: 1.5; font-family: var(--hand); font-size: 22px; background-image: repeating-linear-gradient(transparent 0 32px, var(--line) 32px 33px); }
.paperletter__sinc { font-family: var(--hand); font-size: 22px; margin: 10px 0 0; }
.sign { display: block; border-bottom: 1px solid var(--ink-3); width: 60%; }
.sign input { width: 100%; font-family: var(--sig); font-size: 38px; line-height: 1.3; }
.paperletter__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.paperletter__foot .mono { font-size: 10px; color: var(--ink-3); }
.paperletter__send { display: flex; gap: 6px; }
.ticket { --r: 2deg; position: relative; width: 230px; padding: 18px 16px; background: #f1f0ea; color: #1a1a1a; font-size: 10.5px; transform: rotate(var(--r)); box-shadow: var(--shadow); }
body[data-page="contact"] .ticket { animation: rise .8s var(--ease) .2s both; }
.ticket::before, .ticket::after { --h: radial-gradient(circle 5px, var(--bg) 95%, transparent 100%); content: ""; position: absolute; left: 0; right: 0; height: 10px; background: var(--h) 0 0 / 14px 10px repeat-x; }
.ticket::before { top: -5px; } .ticket::after { bottom: -5px; }
.ticket p { margin: 0 0 4px; } .ticket__brand { font-weight: 700; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 14px 0; padding: 12px 0; border-top: 1px dashed #999; border-bottom: 1px dashed #999; }
.ticket dt { color: #777; } .ticket dd { margin: 0; text-align: right; font-weight: 600; }
.ticket__keep { text-align: center; color: #777; letter-spacing: .1em; }

/* Command menu */
.cmd { place-items: start center; padding-top: 92px; }
.cmd__box { position: relative; width: min(520px, 100%); border-radius: 10px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); overflow: hidden; animation: rise .45s var(--ease) both; }
.cmd__search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.cmd__search input { flex: 1; background: none; border: 0; outline: 0; color: var(--ink); font-size: 15px; }
.cmd__list { max-height: min(52vh, 380px); overflow: auto; padding: 6px; }
.cmd__group { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; padding: 10px 8px 4px; }
.cmd__row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 6px; text-align: left; font-size: 14px; }
.cmd__row svg { color: var(--ink-3); flex: none; }
.cmd__row em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.cmd__row.is-sel { background: var(--chip); }
.cmd__foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-3); }
.cmd__foot kbd { font-family: inherit; background: var(--chip); border-radius: 3px; padding: 1px 4px; margin-right: 3px; }

/* Toast */
.toast { position: fixed; left: 24px; bottom: 24px; z-index: 35; width: 270px; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; background: var(--pill); border: 1px solid var(--pill-line); border-radius: 8px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transform: translateY(14px); opacity: 0; transition: transform .6s var(--ease), opacity .5s; pointer-events: none; }
.toast.is-on { transform: none; opacity: 1; }
.toast__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); margin-top: 6px; flex: none; }
.toast b { display: block; font-size: 13px; font-weight: 600; } .toast .mono { font-size: 11px; color: var(--ink-3); }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .status { left: 16px; top: max(6px, env(safe-area-inset-top)); }
  .hide-sm { display: none; }
  .top { top: calc(max(6px, env(safe-area-inset-top)) + 26px); padding: 0 16px; }
  .pillrow { left: 16px; right: 16px; transform: none; top: 46px; position: absolute; justify-content: center; }
  .pill a { padding: 0 8px; font-size: 14px; }
  .kbd { display: none; }
  .theme button { width: 28px; }
  .mark__label { font-size: 15px; }

  .page--about { overflow: auto; -webkit-overflow-scrolling: touch; }
  .scene { position: relative; inset: auto; display: flex; flex-direction: column; gap: 22px; padding: 128px 16px 90px; }
  .card { position: relative; left: auto; top: auto; translate: none; width: 100%; grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .stamp { width: 150px; padding: 6px 6px 4px; justify-self: center; transform: rotate(2deg); }
  .card__top { flex-wrap: nowrap; }
  .post--wave { width: 110px; }
  .card__note { font-size: 22px; }
  .worlds { gap: 10px; }
  .tele, .deck { position: relative; left: auto; right: auto; bottom: auto; width: 100%; }
  .deck { max-width: 340px; align-self: center; }
  .files { position: relative; top: auto; right: auto; translate: none; flex-direction: row; justify-content: center; }
  .files a { writing-mode: initial; border-radius: 6px; padding: 9px 12px; }
  .next { display: none; }

  .meta { width: calc(100vw - 32px); height: 160px; }
  .meta__title { font-size: 28px; }
  .meta .btn { height: 36px; padding: 0 16px; font-size: 15px; }
  .rail { display: none; }
  .toast { display: none; }
  .views { bottom: calc(14px + env(safe-area-inset-bottom)); }

  .lrow { left: 16px; font-size: 30px; }
  .lrow .chips { display: none; }
  .list__preview { left: 16px; right: 16px; top: 128px; translate: none; width: auto; aspect-ratio: 16 / 9; }
  .gcell__cap .chip { display: none; }

  /* Back on its own line, the tabs below it as a strip that scrolls sideways (Fitsquad has 19): they never overlap. */
  .frame { inset: 128px 8px 8px; overflow: auto; display: flex; flex-direction: column; }
  .frame > * { flex: none; }
  .frame__back { order: -1; position: static; padding: 14px 14px 0; align-self: flex-start; }
  .frame__tabs { position: sticky; top: 8px; margin: 10px 12px 0; width: auto; max-width: none; translate: none; left: auto; align-self: stretch; justify-content: flex-start; }
  .frame__tabs button { height: 30px; padding: 0 12px; }
  .frame__media { position: relative; inset: auto; padding: 12px; display: block; }
  .frame__media .box { width: 100%; }
  .frame__media .box--v { width: min(70vw, 300px); height: auto; margin: 0 auto; }
  .frame__info { position: relative; right: auto; bottom: auto; width: auto; margin: 0 12px 70px; max-height: none; }
  .frame__pager { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); background: var(--pill); padding: 4px 6px; border-radius: 8px; border: 1px solid var(--pill-line); z-index: 4; }

  .desk { flex-direction: column; padding: 128px 16px 40px; }
  .paperletter { padding: 20px 18px; transform: none; }
  .ticket { width: 100%; max-width: 300px; }
  .sign { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .paper::after, .deck__disc.is-on, .next { animation: none; }
  .card, .tele, .deck, .letter, .record, .paperletter, .ticket, .frame__info, .frame__media .box { animation-duration: .01s !important; }
}

/* Nolo's telemetry: every piece as a contact sheet */
.heat--strip { grid-template-rows: repeat(4, 1fr); gap: 2px; }
.heat--strip i { aspect-ratio: 16 / 10; background-size: cover; background-position: center; border-radius: 1px; filter: grayscale(.35); }

/* On file: where I learned */
.path { display: grid; grid-template-columns: 96px 1fr; gap: 2px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.path em { grid-row: span 2; font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 6px; }
.path b { font-size: 22px; font-weight: 600; letter-spacing: -.04em; }
.path span { color: var(--ink-2); font-size: 14px; }

/* grid: no native image drag, no text selection while panning */
.grid, .grid * { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.gcell { contain: layout paint; }
.gcell__img img { pointer-events: none; }

/* Ground: the paper sheet (ground.js). Without WebGL the flat colour + .paper grain stay. */
.ground { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
html:not([data-ground]) .ground { display: none; }
html[data-ground] .paper::after { display: none; }
html[data-ground] .paper { background: linear-gradient(transparent 49.6%, var(--line) 49.6%, var(--line) 50%, transparent 50%) 0 0 / 100% 33.333vh; opacity: .6; }

/* Veil: between sections a sheet rises from below with a halftone edge, then leaves through the top. */
.veil { position: fixed; inset: -12vh 0; z-index: 80; pointer-events: none; background: var(--bg); transform: translateY(112%); display: grid; place-items: center; visibility: hidden; }
.veil::before, .veil::after { content: ""; position: absolute; left: 0; right: 0; height: 12vh;
  background: radial-gradient(circle at center, var(--ink) 0 1.6px, transparent 2px) 0 0 / 9px 9px;
  opacity: .5; }
.veil::before { top: 0; -webkit-mask: linear-gradient(to bottom, transparent, #000); mask: linear-gradient(to bottom, transparent, #000); }
.veil::after { bottom: 0; -webkit-mask: linear-gradient(to top, transparent, #000); mask: linear-gradient(to top, transparent, #000); }
.veil__label { font-size: 12px; letter-spacing: .14em; color: var(--ink-3); opacity: 0; transition: opacity .25s; }
.veil.is-in { visibility: visible; transform: translateY(0); transition: transform .52s cubic-bezier(.76, 0, .24, 1); }
.veil.is-in .veil__label { opacity: 1; transition-delay: .25s; }
.veil.is-out { visibility: visible; transform: translateY(-112%); transition: transform .7s cubic-bezier(.76, 0, .24, 1); }
