:root {
  --ink: #2a1d14;
  --card: #fbf6ea;
  --cardboard: #d9b98a;
  --red: #e2333f;
  --blue: #2a6fdb;
  --font: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #2a1d14; color: var(--ink); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; overflow: hidden; }
#app::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(20, 10, 4, .38)); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#gl.pointy { cursor: pointer; }
#gl.dragging { cursor: grabbing; }
button { font-family: var(--font); }
.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; }
.sr-only:focus-visible { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); width: auto; height: auto; padding: 10px 18px; margin: 0; clip: auto; transform: translateX(-50%); background: var(--card); border-radius: 999px; font-weight: 700; z-index: 30; outline: 3px solid var(--blue); }
[hidden] { display: none !important; }

/* ---------- the fork: two plastic road signs */
.fork { position: absolute; left: 0; right: 0; bottom: calc(14px + var(--safe-b)); display: flex; justify-content: center; align-items: flex-end; gap: clamp(18px, 6vw, 64px); pointer-events: none; z-index: 6; animation: rise .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.sign { all: unset; pointer-events: auto; display: grid; justify-items: center; cursor: pointer; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.sign:hover { transform: translateY(-4px) rotate(-1deg); }
.sign:focus-visible { outline: 3px solid #fff; outline-offset: 6px; border-radius: 8px; }
.sign.dim { opacity: .55; }
.sign .post { display: block; width: 10px; height: 34px; background: linear-gradient(90deg, #cfcabd, #fff 40%, #bdb7aa); border-radius: 0 0 3px 3px; }
.finger { display: block; position: relative; font: 700 clamp(18px, 4.6vw, 26px)/1 var(--font); letter-spacing: .06em; color: #fff; padding: 12px 34px 12px 18px; background: linear-gradient(#ff5a46, var(--red) 55%, #b9202c); border: 3px solid #fff; border-radius: 6px; clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
.finger-r { border-right: 0; }
.fingers { display: grid; grid-template-columns: auto auto; gap: 3px 0; justify-items: end; max-width: min(58vw, 420px); position: relative; }
.fingers::before { content: ''; position: absolute; left: 50%; top: -6px; bottom: -2px; width: 10px; margin-left: -5px; background: linear-gradient(90deg, #cfcabd, #fff 40%, #bdb7aa); border-radius: 4px 4px 0 0; z-index: -1; }
.fingers span { display: block; font: 700 clamp(9px, 2.5vw, 12px)/1 var(--font); letter-spacing: .05em; color: #fff; padding: 5px 20px 5px 10px; background: linear-gradient(#4a8cf0, var(--blue) 55%, #1f4fa8); clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); white-space: nowrap; }
.fingers span:nth-child(odd) { clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%); padding: 5px 10px 5px 20px; justify-self: end; transform: rotate(-1.5deg); }
.fingers span:nth-child(even) { justify-self: start; transform: rotate(1.5deg); }
.fingers span:nth-child(4n) { transform: rotate(-1deg); }
.sign-a { align-self: flex-end; }
.sign-a .finger { transform: rotate(-3deg); }

/* ---------- career card drawn from the stack */
.draw { position: absolute; inset: 0; display: grid; place-items: center; z-index: 12; perspective: 1200px; background: rgba(20, 12, 6, .35); cursor: pointer; }
.cc { width: min(78vw, 360px); aspect-ratio: 5 / 7; position: relative; transform-style: preserve-3d; animation: flip 0.9s cubic-bezier(.3, 1.3, .5, 1) both; }
.draw.leave .cc { animation: away .55s cubic-bezier(.6, 0, .8, .4) both; }
@keyframes flip { 0% { transform: translateY(70vh) rotateY(180deg) rotateZ(-14deg) scale(.4); } 55% { transform: translateY(-4vh) rotateY(180deg) rotateZ(4deg) scale(1); } 100% { transform: none; } }
@keyframes away { to { transform: translate(-42vw, 46vh) rotateZ(-14deg) scale(.18); opacity: .2; } }
.cc-face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cc-back { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #2a6fdb 0 14px, #3d82ec 14px 28px); border: 10px solid #fbf6ea; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.cc-front { background: var(--card); border: 10px solid #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 3px #2a6fdb; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 26px 22px; text-align: center; background-image: radial-gradient(circle at 50% 120%, #ffe7a8 0 30%, transparent 31%), linear-gradient(#fbf6ea, #f4ead2); }
.cc-role { margin: 0; font: 700 clamp(24px, 6.4vw, 32px)/1.1 var(--font); color: var(--ink); text-wrap: balance; }
.cc-rule { display: block; width: 60%; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--red) 0 12px, #f5b700 12px 24px, #1fa35b 24px 36px, var(--blue) 36px 48px); }
.cc-co { margin: 0; font: 600 clamp(15px, 4vw, 19px)/1.2 var(--font); letter-spacing: .12em; color: #2a6fdb; }

.hand { position: absolute; left: calc(12px + env(safe-area-inset-left, 0px)); bottom: calc(12px + var(--safe-b)); width: 74px; aspect-ratio: 5 / 7; z-index: 5; border: 4px solid #fff; border-radius: 8px; background: var(--card); box-shadow: 0 6px 14px rgba(0, 0, 0, .4), inset 0 0 0 1.5px #2a6fdb; padding: 6px 4px; display: grid; align-content: center; justify-items: center; gap: 5px; text-align: center; cursor: pointer; transform: rotate(-6deg); transition: transform .15s; }
.hand:hover { transform: rotate(-2deg) translateY(-3px); }
.hand:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mini-role { font: 700 9px/1.1 var(--font); color: var(--ink); }
.mini-co { font: 600 7px/1.1 var(--font); letter-spacing: .08em; color: #2a6fdb; }

/* ---------- the box lid and the plain list under it */
.lid-tab { position: absolute; top: calc(10px + var(--safe-t)); right: calc(10px + env(safe-area-inset-right, 0px)); width: 64px; height: 50px; z-index: 7; border: 0; padding: 0; background: none; cursor: pointer; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .45)); transition: transform .18s; }
.lid-tab i { position: absolute; inset: 0; border-radius: 6px 6px 4px 4px; background: linear-gradient(160deg, #f2e2c4, #d9b98a 70%, #c9a46f); box-shadow: inset 0 -7px 0 #b88d55, inset 0 2px 0 rgba(255, 255, 255, .6); overflow: hidden; }
.lid-tab i::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 13px; background: repeating-linear-gradient(90deg, #e2333f 0 10px, #f5b700 10px 20px, #1fa35b 20px 30px, #2a6fdb 30px 40px); }
.lid-tab i::after { content: ''; position: absolute; left: 8px; right: 8px; top: 27px; height: 3px; border-radius: 2px; background: rgba(90, 60, 30, .35); box-shadow: 0 6px 0 rgba(90, 60, 30, .25); }
.lid-tab:hover { transform: translateY(-3px) rotate(-3deg); }
.lid-tab:focus-visible { outline: 3px solid #fff; outline-offset: 4px; border-radius: 6px; }
.lid { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(20, 12, 6, .55); perspective: 1400px; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); }
.lid-box { position: relative; width: min(100%, 560px); height: min(100%, 760px); transform-style: preserve-3d; }
.lid-cover { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(160deg, #f2e2c4, #d9b98a 70%, #c9a46f); box-shadow: inset 0 -14px 0 #b88d55; transform-origin: 50% 0; animation: lift .7s cubic-bezier(.5, 0, .3, 1) forwards; z-index: 2; overflow: hidden; }
.lid-cover::before { content: ''; position: absolute; left: 0; right: 0; top: 18%; height: 18%; background: repeating-linear-gradient(90deg, #e2333f 0 40px, #f5b700 40px 80px, #1fa35b 80px 120px, #2a6fdb 120px 160px); }
@keyframes lift { 0% { transform: none; } 100% { transform: translateY(-8%) rotateX(78deg); opacity: 0; visibility: hidden; } }
.lid-inside { position: absolute; inset: 0; border-radius: 14px; background: #e9d3ab; background-image: linear-gradient(rgba(255, 255, 255, .25), rgba(0, 0, 0, .06)); box-shadow: inset 0 0 0 10px #c9a46f, inset 0 0 0 12px #b88d55, 0 30px 60px rgba(0, 0, 0, .5); overflow: auto; overscroll-behavior: contain; padding: 22px 22px 26px; -webkit-overflow-scrolling: touch; }
.lid-close { position: sticky; top: 0; float: right; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--red); color: #fff; font: 700 28px/44px var(--font); cursor: pointer; box-shadow: inset 0 -4px 0 #a91d29, 0 3px 6px rgba(0, 0, 0, .3); z-index: 2; }
.lid-close:focus-visible, .lid-list button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.lid-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; clear: none; }
.lid-list button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 16px 1fr; gap: 0 12px; align-items: center; width: 100%; padding: 9px 8px; border-radius: 6px; cursor: pointer; }
.lid-list button:hover { background: rgba(255, 255, 255, .45); }
.lid-list .dot { width: 16px; height: 16px; border-radius: 4px; grid-row: span 2; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.lid-list .t { font: 600 17px/1.15 var(--font); color: var(--ink); }
.lid-list .c { font: 500 11px/1.2 var(--font); letter-spacing: .1em; color: #7a5a35; }
.lid-list li.about { margin-top: 10px; border-top: 2px dashed rgba(120, 85, 45, .4); padding-top: 8px; }

/* ---------- sound */
.mute { position: absolute; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + var(--safe-b)); width: 44px; height: 44px; z-index: 5; border-radius: 22px; border: 0; background: #fbf6ea; box-shadow: inset 0 -4px 0 #d8ccb2, 0 4px 10px rgba(0, 0, 0, .35); cursor: pointer; display: grid; place-items: center; }
.mute svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mute .spk { fill: var(--ink); }
.mute[aria-pressed="true"] .wave { display: none; }
.mute[aria-pressed="false"] .x { display: none; }
.mute:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- a space, opened: the case study */
.case { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: calc(10px + var(--safe-t)) 10px calc(10px + var(--safe-b)); background: rgba(20, 12, 6, .62); animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.case-card { --tile: #2a6fdb; --tile-ink: #fff; position: relative; width: min(100%, 1060px); max-height: 100%; height: 100%; display: flex; flex-direction: column; background: var(--card); border-radius: 18px; border: 8px solid var(--tile); box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(0, 0, 0, .06); animation: pop .45s cubic-bezier(.2, 1.3, .4, 1) both; min-height: 0; }
@keyframes pop { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.case-head { flex: none; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 22px; background: var(--tile); color: var(--tile-ink); border-radius: 8px 8px 0 0; }
.case-words { flex: 1; min-width: 0; }
.case-head h2 { margin: 0; font: 700 clamp(24px, 4.2vw, 40px)/1.05 var(--font); }
.case-client { margin: 4px 0 0; font: 600 clamp(11px, 1.6vw, 14px)/1.2 var(--font); letter-spacing: .14em; opacity: .9; }
.case-close { flex: none; width: 48px; height: 48px; border-radius: 24px; border: 3px solid rgba(255, 255, 255, .9); background: var(--red); color: #fff; font: 700 30px/42px var(--font); cursor: pointer; box-shadow: inset 0 -4px 0 #a91d29, 0 3px 8px rgba(0, 0, 0, .3); }
.case-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.case-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px clamp(14px, 3vw, 34px) 36px; }
.case-body.ab-media { --ab-fg: var(--ink); --ab-muted: #6b5a48; --ab-accent: var(--blue); --ab-chrome: 150px; font: 400 17px/1.5 var(--font); }
.case-body .ab-lede { font: 500 clamp(18px, 2.2vw, 22px)/1.4 var(--font); }
.case-body .ab-heading { font: 700 20px/1.2 var(--font); color: var(--tile-text, var(--ink)); }
.case-body .ab-credits { font-size: 13px; }
.case-body .ab-section + .ab-section { padding-top: 10px; border-top: 2px dashed rgba(42, 29, 20, .15); }

/* About: the last space */
.about { display: grid; gap: 18px; font: 400 17px/1.5 var(--font); }
.about .bio { margin: 0; font: 500 clamp(18px, 2.4vw, 23px)/1.4 var(--font); }
.about .title { margin: 0; font: 600 14px/1.2 var(--font); letter-spacing: .14em; color: #6b5a48; }
.about .contact { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; font-weight: 600; }
.about .contact a { color: var(--blue); }
.about .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 6px 0 0; padding: 0; list-style: none; }
.about .cards li { aspect-ratio: 5 / 6; border-radius: 10px; border: 5px solid #fff; background: linear-gradient(#fbf6ea, #f4ead2); box-shadow: 0 6px 14px rgba(0, 0, 0, .18), inset 0 0 0 2px #2a6fdb; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 12px; text-align: center; }
.about .cards li:nth-child(odd) { transform: rotate(-1.5deg); }
.about .cards li:nth-child(3n) { transform: rotate(1.2deg); }
.about .cards b { font: 700 17px/1.15 var(--font); }
.about .cards span { font: 600 11px/1.2 var(--font); letter-spacing: .1em; color: #2a6fdb; }

/* ---------- loading: the spinner fills in, then the lid comes off */
.loader { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #f2e2c4, #d9b98a 60%, #b88d55); transition: transform .9s cubic-bezier(.6, 0, .3, 1), opacity .9s; }
.loader::before { content: ''; position: absolute; left: 0; right: 0; top: 14%; height: 12%; background: repeating-linear-gradient(90deg, #e2333f 0 60px, #f5b700 60px 120px, #1fa35b 120px 180px, #2a6fdb 180px 240px); opacity: .9; }
.loader.gone { transform: translateY(-104%) rotate(-2deg); opacity: 0; pointer-events: none; }
.load-wheel { width: min(56vw, 300px); height: auto; filter: drop-shadow(0 12px 14px rgba(70, 40, 10, .35)); }
.load-wheel .seg { transition: opacity .25s; opacity: .22; }
.load-wheel .seg.on { opacity: 1; }
.loader.done .load-wheel g.rot { animation: whirl 1s cubic-bezier(.2, .6, .3, 1) both; transform-origin: 0 0; }
@keyframes whirl { to { transform: rotate(540deg); } }

.nogl .lid-tab { display: none; }

@media (max-width: 600px) {
  .fork { gap: 10px; padding: 0 8px; bottom: calc(8px + var(--safe-b)); }
  .fingers { grid-template-columns: auto auto; max-width: 66vw; gap: 2px 0; }
  .fingers span { font-size: 8px; line-height: 1.02; padding: 3px 13px 3px 7px; max-width: 30vw; white-space: normal; text-align: left; }
  .fingers span:nth-child(odd) { padding: 3px 7px 3px 13px; text-align: right; }
  .fingers::before { width: 7px; margin-left: -3.5px; }
  .finger { font-size: 14px; padding: 8px 22px 8px 11px; border-width: 2px; }
  .sign .post { height: 18px; width: 7px; }
  .hand { top: calc(10px + var(--safe-t)); bottom: auto; left: calc(10px + env(safe-area-inset-left, 0px)); }
  .case { padding: calc(4px + var(--safe-t)) 4px calc(4px + var(--safe-b)); }
  .case-card { border-width: 5px; border-radius: 14px; }
  .case-head { padding: 10px 10px 10px 14px; }
  .case-body { padding: 16px 12px 28px; }
  .case-body.ab-media { --ab-chrome: 120px; }
  .hand { width: 60px; }
  .mini-role { font-size: 7.5px; }
  .mini-co { font-size: 6px; }
  .lid-inside { padding: 16px 12px 22px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .fork { bottom: calc(6px + var(--safe-b)); gap: 14px; }
  .fingers { grid-template-columns: repeat(4, auto); max-width: 72vw; gap: 2px 0; }
  .fingers span, .fingers span:nth-child(odd), .fingers span:nth-child(even) { font-size: 8.5px; padding: 3px 13px 3px 7px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); justify-self: stretch; text-align: left; transform: none; }
  .fingers::before { display: none; }
  .finger { font-size: 14px; padding: 7px 22px 7px 11px; border-width: 2px; }
  .sign .post { height: 14px; width: 7px; }
  .hand { width: 52px; top: calc(8px + var(--safe-t)); bottom: auto; }
  .mini-role { font-size: 7px; } .mini-co { font-size: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cc, .draw.leave .cc, .lid-cover, .fork, .case-card { animation-duration: .01s; }
}
