/* Layout: one page on a faint grid "net". A short about-me header with floating qualification
   tabs, then three 3D viewers stacked: Turntable, Workspace, Flythrough. */
:root {
  --bg: #222326; --net: rgba(255,255,255,.035); --net-major: rgba(255,255,255,.06);
  --panel: rgba(36,37,41,.94); --panel-solid: #2a2b2f; --panel-hi: #35363b; --field: #1c1d20;
  --view-a: #3c3d41; --view-b: #2a2b2e; --tab: rgba(40,41,45,.95); --tab-head: #3b3c41; --tab-head-on: #4a4b51;
  --text: #ebebed; --dim: #a7a9af; --faint: #7a7c82; --edge: rgba(255,255,255,.08);
  --sel: #f07a28; --active: #ffae52; --key: #e6e6e6; --key-on: #ffb341; --blue: #5585d1; --ok: #5aa83c;
  --x: #ff3e5a; --y: #8bdc00; --z: #2b8ff0;
  --check-a: #2b2c30; --check-b: #35363b;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gut: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font: 15px/1.55 var(--ui); -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--net-major) 1px, transparent 1px), linear-gradient(90deg, var(--net-major) 1px, transparent 1px),
    linear-gradient(var(--net) 1px, transparent 1px), linear-gradient(90deg, var(--net) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: center 0;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
svg.i { width: 16px; height: 16px; flex: none; }
.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--gut); }
kbd { font: 500 11.5px var(--mono); padding: 1px 6px; border-radius: 4px; background: var(--panel-hi); box-shadow: inset 0 -1px 0 rgba(0,0,0,.35); color: var(--text); }

/* ---------- about me ---------- */
.hero { padding-block: clamp(48px, 9vh, 110px) clamp(48px, 8vh, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr); gap: clamp(36px, 5vw, 80px); align-items: center; }
.intro { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font: 500 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--dim); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(90,168,60,.22); }
.name { margin: 0; font-family: var(--display); font-weight: 780; font-stretch: 75%; font-size: clamp(40px, 5.9vw, 92px); line-height: .9; letter-spacing: -.02em; overflow-wrap: anywhere; }
.role { margin: 14px 0 0; font-family: var(--display); font-weight: 600; font-stretch: 85%; font-size: clamp(20px, 2.2vw, 28px); color: var(--dim); }
.bio { margin: 18px 0 0; max-width: 56ch; color: var(--dim); font-size: 16.5px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; padding: 0; list-style: none; }
.tools li { font-size: 13px; padding: 4px 11px; border-radius: 14px; background: var(--panel-solid); box-shadow: 0 0 0 1px var(--edge); }
.dm { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; max-width: 100%; margin-top: 22px; padding: 5px 5px 5px 12px; border-radius: 12px; background: var(--panel-solid); box-shadow: 0 0 0 1px var(--edge); }
.dm svg { color: var(--blue); }
.dm-l { font-size: 13.5px; color: var(--dim); }
.dm code { font: 500 14px var(--mono); color: var(--text); user-select: all; overflow-wrap: anywhere; }
.btn { height: 32px; padding: 0 13px; border: 0; border-radius: 7px; background: var(--panel-hi); color: var(--text); font: 500 13.5px var(--ui); cursor: pointer; }
.btn:hover { background: #414248; }
.cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 30px; height: 42px; padding: 0 18px; border-radius: 21px; background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none; }
.cta:hover { background: #fff; }

.quals { min-width: 0; perspective: 1100px; }
.quals h2 { margin: 0 0 14px; font: 500 11px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.qstack { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; transform: rotateY(-12deg) rotateX(4deg); transform-style: preserve-3d; }
.qstack li { max-width: calc(100% - 72px); transform: translateX(var(--dx, 0)) translateZ(var(--dz, 0)); }
.qstack li:nth-child(1) { --dx: 0px;  --dz: 30px;  --dl: 0s; }
.qstack li:nth-child(2) { --dx: 46px; --dz: 0px;   --dl: -1.2s; }
.qstack li:nth-child(3) { --dx: 14px; --dz: -30px; --dl: -2.6s; }
.qstack li:nth-child(4) { --dx: 58px; --dz: -10px; --dl: -3.4s; }
.qstack li:nth-child(5) { --dx: 22px; --dz: -50px; --dl: -4.4s; }
.qstack li:nth-child(6) { --dx: 66px; --dz: -24px; --dl: -5.1s; }
.qn { display: flex; align-items: center; gap: 11px; padding: 11px 14px 11px 11px; background: var(--panel); border-radius: 14px; box-shadow: 0 0 0 1px var(--edge), 0 16px 34px rgba(0,0,0,.4); animation: float 6s ease-in-out infinite; animation-delay: var(--dl, 0s); }
@keyframes float { 50% { transform: translateY(-7px); } }
.q-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue); }
.q-ico.skill { background: var(--ok); }
.q-ico.award { background: var(--sel); }
.q-txt { display: grid; min-width: 0; }
.q-txt b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.q-txt small { font-size: 12.5px; color: var(--dim); }

/* ---------- works ---------- */
.work { padding-block: 16px 72px; display: grid; gap: clamp(64px, 10vh, 112px); }
.work-head h2 { margin: 0; font-family: var(--display); font-weight: 760; font-stretch: 80%; font-size: clamp(42px, 6vw, 76px); line-height: .95; letter-spacing: -.02em; }
.work-head p { margin: 12px 0 0; max-width: 62ch; color: var(--dim); }
.show { display: grid; gap: 12px; min-width: 0; }
.show-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.show-id { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-width: 0; }
.show-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-hi); color: var(--active); }
.show-id h3 { margin: 0; font-family: var(--display); font-weight: 760; font-stretch: 80%; font-size: clamp(26px, 3vw, 38px); line-height: 1; letter-spacing: .01em; }
.show-sub { margin: 0; color: var(--dim); }
.show-count { margin: 0; font: 500 13px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }

.view {
  position: relative; height: clamp(460px, 74vh, 780px); border-radius: 14px; overflow: hidden;
  background: radial-gradient(115% 95% at 50% 42%, var(--view-a), var(--view-b));
  box-shadow: 0 0 0 1px var(--edge), 0 30px 70px rgba(0,0,0,.4);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; outline: none;
}
.view:focus-visible { box-shadow: 0 0 0 2px var(--blue), 0 30px 70px rgba(0,0,0,.4); }
.view.dragging, .view.dragging .wtab { cursor: grabbing; }
.view > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.layer { position: absolute; inset: 0; pointer-events: none; }
.wtab { position: absolute; left: 0; top: 0; transform-origin: 0 0; visibility: hidden; pointer-events: auto; cursor: pointer; will-change: transform; }
.vp-ov { position: absolute; z-index: 40; left: 16px; top: 14px; margin: 0; font-size: 12.5px; color: var(--dim); pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.vp-ov b { display: block; font-weight: 500; color: var(--text); }
.nav { position: absolute; z-index: 50; top: 50%; width: 46px; height: 46px; margin-top: -23px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(22,23,26,.84); color: var(--text); box-shadow: 0 0 0 1px var(--edge), 0 8px 20px rgba(0,0,0,.35); cursor: pointer; }
.nav:hover { background: rgba(44,45,50,.96); }
.nav:disabled { opacity: .28; cursor: default; }
.nav.prev { left: 14px; }
.nav.next { right: 14px; }
.nav svg { width: 20px; height: 20px; }
.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; }

/* render slot: checkered placeholder, or the real image */
.slot { display: grid; place-items: end start; width: 100%; max-width: 100%; padding: 6px; border-radius: 7px; overflow: hidden;
  background-color: var(--check-a);
  background-image: linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%), linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; }
/* live preview: a white-background render of the work's model */
.pv-slot { position: relative; display: block; padding: 0; background: #fff; }
.pv { display: block; width: 100%; height: 100%; }
.pv-badge { position: absolute; left: 7px; bottom: 7px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(24,25,28,.8); color: #fff; transition: background .2s; }
.pv-badge svg { width: 15px; height: 15px; }
.wtab:hover .pv-badge { background: var(--sel); }

/* turntable tabs */
.tt { width: 200px; }
.tt-in { display: grid; gap: 8px; padding: 7px 7px 9px; border-radius: 11px; background: var(--tab); box-shadow: 0 0 0 1px var(--edge), 0 14px 30px rgba(0,0,0,.45); transition: box-shadow .25s; }
.tt-cap { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 3px; }
.tt-cap b { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.tt-cap small { font: 10.5px var(--mono); color: var(--faint); white-space: nowrap; }
.tt.on .tt-in { box-shadow: 0 0 0 1.5px var(--active), 0 18px 40px rgba(0,0,0,.5); }
.tt.on .tt-cap b { color: var(--active); }

/* workspace tabs, gizmo and status bar */
.ws { width: 270px; }
.ws-in { display: block; border-radius: 9px; background: var(--tab); box-shadow: 0 0 0 1px var(--edge), 0 14px 32px rgba(0,0,0,.45); overflow: hidden; transition: box-shadow .25s; }
.ws-head { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 11px; background: var(--tab-head); font-size: 13px; line-height: 1.2; }
.ws-head svg { width: 14px; height: 14px; color: var(--sel); }
.ws-head b { font-weight: 600; }
.ws-body { display: grid; gap: 7px; padding: 7px 7px 9px; }
.ws-body small { padding: 0 3px; font-size: 12px; color: var(--dim); }
.ws.on .ws-in { box-shadow: 0 0 0 1.5px var(--active), 0 18px 40px rgba(0,0,0,.5); }
.ws.on .ws-head { background: var(--tab-head-on); }
.gizmo { position: absolute; z-index: 40; top: 10px; right: 10px; width: 90px; height: 90px; overflow: visible; pointer-events: none; }
.gz-l { stroke-width: 2; }
.gz-l.gz-x { stroke: var(--x); } .gz-l.gz-y { stroke: var(--y); } .gz-l.gz-z { stroke: var(--z); }
.gz-p.gz-x { fill: var(--x); } .gz-p.gz-y { fill: var(--y); } .gz-p.gz-z { fill: var(--z); }
.gz-n { fill-opacity: .3; stroke-opacity: .7; }
.gz-n.gz-x { fill: var(--x); stroke: var(--x); } .gz-n.gz-y { fill: var(--y); stroke: var(--y); } .gz-n.gz-z { fill: var(--z); stroke: var(--z); }
.gizmo text { font: 700 10px var(--ui); fill: #141416; }
.vp-status { position: absolute; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 28px; padding: 0 14px; background: rgba(26,27,30,.88); border-top: 1px solid rgba(0,0,0,.3); font-size: 12px; color: var(--dim); pointer-events: none; font-variant-numeric: tabular-nums; }

/* flythrough tabs and timeline */
.ft { width: 340px; }
.ft-ear { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px 0 12px; border-radius: 10px 10px 0 0; background: #303136; font-size: 12.5px; font-weight: 500; color: var(--dim); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.ft-ear i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--key); border-radius: 1px; }
.ft-card { display: grid; gap: 10px; padding: 10px; background: var(--panel); border-radius: 0 12px 12px 12px; box-shadow: 0 0 0 1px var(--edge), 0 22px 50px rgba(0,0,0,.45); }
.ft-ttl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
.ft-ttl b { font-family: var(--display); font-weight: 700; font-stretch: 85%; font-size: 22px; line-height: 1.05; }
.ft-ttl small { font: 10.5px var(--mono); color: var(--faint); white-space: nowrap; }
.ft.on .ft-card { box-shadow: 0 0 0 1.5px rgba(255,179,65,.75), 0 26px 60px rgba(0,0,0,.5); }
.ft.on .ft-ear { background: #3a3b40; color: var(--text); }
.ft.on .ft-ear i { background: var(--key-on); }
.ft-tl { position: absolute; z-index: 40; left: 12px; right: 12px; bottom: 12px; background: rgba(30,31,34,.92); border-radius: 9px; box-shadow: 0 0 0 1px var(--edge); pointer-events: none; }
.ft-tl-head { display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px 3px; font: 500 11px var(--mono); color: var(--dim); border-bottom: 1px solid rgba(0,0,0,.25); }
.ft-tl-head b { color: var(--text); font-weight: 500; }
.ft-bar { position: relative; height: 34px; margin: 0 16px; }
.ft-bar .tk { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.055); }
.ft-bar .tk span { position: absolute; top: 2px; left: 4px; font: 9.5px var(--mono); color: var(--faint); font-style: normal; }
.ft-bar .kf { position: absolute; top: 17px; width: 10px; height: 10px; margin-left: -5px; border: 1px solid #121214; border-radius: 2px; background: var(--key); transform: rotate(45deg); }
.ft-bar .kf.on { background: var(--key-on); }
.ft-bar .ph { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--blue); }
.ft-bar .ph span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); min-width: 30px; padding: 0 4px; border-radius: 4px; background: var(--blue); color: #fff; font: 500 10px/15px var(--mono); font-style: normal; text-align: center; }

/* 3D viewer: grows out of the clicked preview to fill the display */
.insp { position: absolute; inset: 0; z-index: 60; background: #fff; touch-action: none; cursor: grab; clip-path: inset(0px 0px 0px 0px round 0px); }
.insp.grabbing { cursor: grabbing; }
.insp-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: auto; }
.insp-bar { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.insp-name, .insp-tools { pointer-events: auto; display: flex; align-items: center; gap: 6px; border-radius: 11px; background: rgba(28,29,32,.92); color: var(--text); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.insp-name { margin: 0; gap: 9px; padding: 9px 14px 9px 12px; font-size: 14px; min-width: 0; }
.insp-name svg { color: var(--sel); }
.insp-name b { font-weight: 600; }
.insp-name small { font: 11px var(--mono); color: var(--dim); white-space: nowrap; }
.insp-tools { padding: 5px; }
.ib { height: 32px; min-width: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: 500 13px var(--ui); cursor: pointer; }
.ib:hover { background: rgba(255,255,255,.1); }
.ib[aria-pressed="true"] { background: var(--blue); }
.ib-x:hover { background: #c94545; }
.ib svg { width: 16px; height: 16px; flex: none; }
.insp-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: 18px; background: rgba(28,29,32,.84); color: var(--dim); font-size: 12.5px; white-space: nowrap; pointer-events: none; }

.foot { padding-block: 28px 44px; color: var(--faint); font-size: 13px; }
.foot p { margin: 0; border-top: 1px solid var(--edge); padding-top: 24px; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .qstack { transform: none; }
  .qstack li { transform: none; max-width: none; }
  .view { height: 72vh; min-height: 440px; }
  .nav { width: 38px; height: 38px; margin-top: -19px; }
  .nav.prev { left: 8px; }
  .nav.next { right: 8px; }
  .gizmo { width: 70px; height: 70px; }
  .ft-range { display: none; }
  .ib span, .insp-k, .insp-name small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .qn { animation: none; }
}
