/* =====================================================================
   SCENE: the desk is a plane inside the same 3D space as the book, so the
   book rests on it and casts a real shadow. Also: the five chosen projects,
   and lighter rendering for smooth page turns. Loaded last.
   ===================================================================== */
.room { background: #050504; }
.fx { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.stage { z-index: 1; }

.scaler { perspective: 2300px; perspective-origin: 50% 38%; }
.tilt { transform-style: preserve-3d; }

/* the desk surface, with its own pool of lamp light and vignette */
.desk3d {
  position: absolute; left: 50%; top: 50%; width: 3000px; height: 2200px; margin: -1100px 0 0 -1500px;
  transform: translateZ(var(--dz, -20px)); transform-style: flat;
  background: var(--grain1), var(--grain2), linear-gradient(180deg, #100f0d, #070706);
  background-size: 900px 900px, 600px 600px, auto;
}
.pool {
  position: absolute; inset: 0; opacity: var(--po, 1);
  background:
    radial-gradient(ellipse 30% 29% at var(--lx, 50%) var(--ly, 50%), rgba(255, 244, 228, 0.3), rgba(255, 226, 190, 0.1) 52%, transparent 80%),
    radial-gradient(ellipse 46% 44% at 50% 50%, transparent 38%, rgba(0, 0, 0, 0.7) 100%);
}

/* things on the desk */
.prop { position: absolute; right: auto; bottom: auto; filter: drop-shadow(12px 20px 14px rgba(0, 0, 0, 0.65)); pointer-events: none; }
.coffee { left: calc(50% + 655px); top: calc(50% - 270px); width: 200px; }
.plant { left: calc(50% - 800px); top: calc(50% - 60px); width: 140px; }
.pencil { left: calc(50% - 830px); top: calc(50% + 250px); width: 270px; height: 8px; }
.card { left: calc(50% + 700px); top: calc(50% + 150px); width: 92px; height: 58px; aspect-ratio: auto; }

/* book: boards, slab edges, contact shadows */
.board { transform: translateZ(var(--bz, -12px)); transform-style: preserve-3d; box-shadow: none; }
.board .bf { position: absolute; left: 0; right: 0; top: 100%; height: 7px; background: #070707; transform-origin: 50% 0; transform: rotateX(-90deg); }
.board .bsd { position: absolute; top: 0; bottom: 0; width: 7px; background: #0b0b0a; }
.board-r .bsd { left: 100%; transform-origin: 0 50%; transform: rotateY(90deg); }
.board-l .bsd { right: 100%; transform-origin: 100% 50%; transform: rotateY(-90deg); }
.shadow-pool { left: calc(50% * (1 - var(--a0, 0)) - 4%); right: -9%; top: 12%; bottom: -26%; transform: translateZ(calc(var(--dz, -20px) + 1px)); filter: blur(28px); background: radial-gradient(ellipse, rgba(0, 0, 0, 0.92), transparent 68%); opacity: var(--sp, 1); }
.shadow-tight { position: absolute; left: calc(50% * (1 - var(--a0, 0)) - 14px); right: -18px; top: -2px; bottom: -28px; border-radius: 10px; background: rgba(0, 0, 0, 0.88); filter: blur(8px); transform: translateZ(calc(var(--dz, -20px) + 2px)); opacity: var(--sp, 1); pointer-events: none; }
.ribbon { translate: 0 0 calc(var(--bz, -12px) + 1px); }

/* lighter lamp beam (no blur, no blending) */
.beam { left: 50%; top: -8%; width: 80vw; height: 100vh; filter: none; mix-blend-mode: normal; animation: none; background: conic-gradient(from 180deg at 50% 0%, transparent 152deg, rgba(255, 238, 214, 0.05) 168deg, rgba(255, 238, 214, 0.11) 180deg, rgba(255, 238, 214, 0.05) 192deg, transparent 208deg); }
#dust { position: absolute; inset: 0; width: 100%; height: 100%; }

/* cheaper pages: no blend modes on 22 sheets */
.pg::after { mix-blend-mode: normal; opacity: 0.3; }
.pg.light::after { display: none; }
.face { contain: layout paint; }

/* ---------- contents ---------- */
.ctoc { top: 112px; }
.ctoc button { padding: 9px 0; font-size: 14px; }

/* ---------- SGTE ---------- */
.pg.sgte { background: radial-gradient(circle at 76% 44%, rgba(255, 150, 120, 0.2), transparent 56%), linear-gradient(150deg, #19202e, #0b0f18 62%, #050608); }
.pg.sgte-d { background: radial-gradient(circle at 18% 92%, rgba(255, 150, 120, 0.12), transparent 55%), linear-gradient(150deg, #151b27, #080b12 70%); }
.sgteart { right: -6px; top: 30px; width: 340px; }
.sgteart .rl { stroke: rgba(255, 214, 190, 0.35); stroke-width: 1; fill: none; }
.sgteart .nd2 circle { fill: rgba(255, 255, 255, 0.1); stroke: rgba(255, 214, 190, 0.7); stroke-width: 1.2; }
.sgteart .nd2 text { text-anchor: middle; font: 500 10px var(--mono); fill: #ffe3d6; }
.sgteart .hubt { text-anchor: middle; font: 700 17px var(--sans); fill: #fff4ee; letter-spacing: -0.03em; }
.sgteart .nd2.core circle { fill: rgba(255, 150, 120, 0.5); stroke: #ffb8a2; }
.pg.in .sgteart .nd2 { animation: nodeIn 0.6s both; animation-delay: calc(var(--k) * 70ms + 0.3s); transform-box: fill-box; transform-origin: center; }
@keyframes nodeIn { from { transform: scale(0); opacity: 0; } }
.pg.in .sgteart .hub { transform-box: fill-box; transform-origin: center; animation: hubPulse 3.6s ease-in-out infinite; }
@keyframes hubPulse { 50% { transform: scale(1.06); } }

/* ---------- skills matrix ---------- */
.pg.skills { background: linear-gradient(150deg, #f8f6f2, #e3dfd7); }
.mxwrap { right: 26px; top: 74px; width: 300px; }
.mxgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.7); box-shadow: 0 18px 36px -18px rgba(20, 24, 26, 0.45); }
.mxgrid i { display: block; aspect-ratio: 1; border-radius: 6px; background: var(--c); }
.mxkey { display: flex; align-items: center; gap: 5px; margin: 12px 4px 0; font: 500 10px var(--mono); color: rgba(20, 24, 26, 0.65); }
.mxkey i { width: 14px; height: 14px; border-radius: 4px; }
.mxkey i:nth-of-type(1) { background: #cfe9e4; } .mxkey i:nth-of-type(2) { background: #7fd3c6; } .mxkey i:nth-of-type(3) { background: #2fb5a3; } .mxkey i:nth-of-type(4) { background: #0b5f58; }
.pg.in .mxgrid i { animation: popIn 0.5s cubic-bezier(0.2, 0.9, 0.2, 1.2) both; animation-delay: calc(var(--k) * 14ms + 0.25s); }
@keyframes popIn { from { transform: scale(0); opacity: 0; } }
.pg.skills-d { background: linear-gradient(150deg, #f8f6f2, #e3dfd7); }
.skills-d h3.wide { color: #14181a; width: 560px; font-size: 32px; }
.skills-d h3.wide em { color: #0b766d; }
.skills-d .lead { color: rgba(20, 24, 26, 0.76); top: 132px; width: 72%; }
.quad { list-style: none; margin: 0; padding: 0; position: absolute; left: 26px; right: 26px; top: 216px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; z-index: 4; }
.quad li { display: grid; gap: 2px; align-content: start; padding: 12px 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.7); box-shadow: 0 10px 22px -12px rgba(20, 24, 26, 0.4); }
.quad i { font: italic 400 30px/1 var(--serif); color: #0b766d; }
.quad b { font-size: 14px; letter-spacing: -0.03em; }
.quad span { font-size: 11px; color: rgba(20, 24, 26, 0.72); }

/* ---------- contact form page ---------- */
.contact-f .cform { position: absolute; left: 26px; right: 26px; top: 68px; align-self: auto; }
.contact .hc { width: 62%; bottom: 40px; }
.contact .hc h2 { font-size: 44px; }
.links2 { display: grid; gap: 2px; font-weight: 600; margin-top: 8px; }

/* warm-up: slices are rendered invisibly once so the first turn is smooth */
.leaf.warm > .bend { display: block; opacity: 0.01; }

/* ---------- things that say who sits at this desk ---------- */
.card { left: calc(50% + 628px); top: calc(50% + 118px); width: 128px; height: 80px; padding: 8px; display: grid; grid-template-columns: 30px 1fr; gap: 7px; background: linear-gradient(135deg, #f7f5f0, #dcd8cf); border-radius: 6px; transform: rotate(12deg); }
.card .ph { display: grid; place-items: center; border-radius: 4px; background: linear-gradient(135deg, #40e0d0, #14b8a6); font-style: normal; }
.card .ph b { font: 700 11px var(--sans); color: #03100f; letter-spacing: -0.04em; }
.card span { display: grid; align-content: center; gap: 1px; color: #14181a; font-family: var(--sans); }
.card small { font-size: 5.5px; color: #0b766d; font-weight: 600; }
.card span b { font-size: 8px; letter-spacing: -0.02em; line-height: 1.1; }
.card em { font: italic 400 6.5px var(--serif); color: #3a4a4a; }

.bag { left: calc(50% - 720px); top: calc(50% - 400px); width: 150px; height: 190px; border-radius: 8px 8px 12px 12px; background: linear-gradient(160deg, #cfae80, #a4814f); transform: rotate(-7deg); }
.bag .fold { position: absolute; left: 0; right: 0; top: 0; height: 26px; border-radius: 8px 8px 0 0; background: linear-gradient(#8f6f43, #b08c5a); box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3); }
.bag .lbl { position: absolute; left: 18px; right: 18px; top: 62px; padding: 12px 8px 10px; text-align: center; background: #f3ecdd; border-radius: 4px; color: #3a2a18; display: grid; gap: 1px; }
.bag small { font: italic 400 11px var(--serif); }
.bag b { font: 700 15px var(--sans); letter-spacing: -0.04em; }
.bag .flag { display: block; height: 10px; margin-top: 6px; border-radius: 2px; background: linear-gradient(#1c3f94 0 20%, #fff 20% 40%, #d1202f 40% 60%, #fff 60% 80%, #1c3f94 80%); }

.notes { left: calc(50% - 470px); top: calc(50% - 420px); width: 230px; height: 150px; filter: none; }
.note { position: absolute; margin: 0; width: 92px; height: 92px; padding: 12px 10px; font: italic 400 15px/1.1 var(--serif); color: #2a2a22; box-shadow: 8px 14px 12px rgba(0, 0, 0, 0.45); }
.n1 { left: 0; top: 18px; background: #ffe27a; transform: rotate(-8deg); }
.n2 { left: 66px; top: 0; background: #9ff0e2; transform: rotate(5deg); font-size: 13px; }
.n3 { left: 130px; top: 30px; background: #ffb5a0; transform: rotate(-3deg); }

.notebook { left: calc(50% + 250px); top: calc(50% - 410px); width: 220px; transform: rotate(5deg); }
.duck { left: calc(50% + 520px); top: calc(50% - 420px); width: 64px; transform: rotate(-12deg); }

.kb { left: calc(50% - 215px); top: calc(50% + 232px); width: 440px; height: 118px; padding: 10px; border-radius: 10px; background: linear-gradient(#26272a, #17181a); display: grid; gap: 4px; transform: rotate(-1.5deg); box-shadow: inset 0 0 0 1px #313336; }
.kb { grid-template-rows: repeat(5, 1fr); overflow: hidden; }
.kb .row { display: flex; gap: 4px; min-height: 0; }
.kb .k { display: block; }
.kb .k { flex: 1; border-radius: 4px; background: linear-gradient(#34363a, #2a2c2f); box-shadow: 0 2px 0 #0e0f10; }
.kb .k.acc { background: linear-gradient(#40e0d0, #14b8a6); box-shadow: 0 2px 0 #0b766d; }
.kb .k.w15 { flex: 1.5; } .kb .k.w2 { flex: 2; } .kb .k.sp { flex: 6; }

.phones { left: calc(50% - 700px); top: calc(50% + 250px); width: 210px; transform: rotate(-14deg); }
.phone { left: calc(50% + 450px); top: calc(50% + 236px); width: 72px; height: 148px; border-radius: 14px; background: linear-gradient(160deg, #1d2a2c, #0a0f10); border: 3px solid #2b2d30; display: grid; place-items: center; transform: rotate(10deg); }
.phone b { font: 700 18px var(--sans); color: #40e0d0; letter-spacing: -0.05em; text-shadow: 0 0 14px rgba(64, 224, 208, 0.7); }
