/* =========================================================
   Cinematic intro — laptop opens, VS Code, `npm run dev`,
   browser opens, camera dives into the screen.
   Screen UI is laid out on a virtual 1280×800 canvas (.vsc)
   and scaled to fit the laptop screen by js/intro.js.
   ========================================================= */

.intro {
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 15%, #0c111d 0%, #05070c 55%, #020305 100%);
  --w: min(780px, 76vw, 86vh);
  font-family: var(--font);
  color: #ccc;
}
@media (max-width: 600px) { .intro { --w: 94vw; } }

/* ---------- room ---------- */
.intro__amb {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 45% at 50% 0%, rgba(140, 160, 255, .10), transparent 70%);
}
.intro__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 0, .75) 100%);
}
.intro__zoom, .intro__cam { position: absolute; inset: 0; }
.intro__cam { perspective: 2400px; perspective-origin: 50% 20%; display: grid; place-items: center; }
.intro__desk {
  position: absolute; left: -10%; right: -10%; top: calc(50% + var(--w) * .1); bottom: -10%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 30%),
    linear-gradient(180deg, #0d111a 0%, #07090f 60%, #040507 100%);
  border-top: 1px solid rgba(255, 255, 255, .04);
}
.intro__spill {
  position: absolute; left: 50%; top: 0; width: calc(var(--w) * 1.6); height: calc(var(--w) * .7);
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 0%, rgba(110, 160, 255, .22), rgba(94, 242, 194, .05) 50%, transparent 75%);
  opacity: 0;
}

/* ---------- laptop (3D) ---------- */
.laptop-pos { transform-style: preserve-3d; transform: translateY(calc(var(--w) * -.2)); }
.laptop {
  position: relative; width: var(--w); height: calc(var(--w) * .65);
  transform-style: preserve-3d; transform: rotateX(-22deg);
}
.lid { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%; transform: rotateX(-89.5deg); }
.lid__front, .lid__back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: calc(var(--w) * .022) calc(var(--w) * .022) calc(var(--w) * .008) calc(var(--w) * .008);
}
.lid__back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #474c56 0%, #2b2f36 45%, #1d2025 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  display: grid; place-items: center;
}
.lid__back span {
  transform: rotate(180deg);
  font: 700 calc(var(--w) * .05) / 1 var(--mono); color: rgba(255, 255, 255, .18);
  text-shadow: 0 0 calc(var(--w) * .02) rgba(94, 242, 194, .25);
}
.lid__front {
  background: #08090b;
  padding: calc(var(--w) * .02) calc(var(--w) * .02) calc(var(--w) * .03);
  box-shadow: inset 0 0 0 1px #2c3038, inset 0 0 0 3px #111317, 0 0 0 1px #3b4049;
}
.lid__cam {
  position: absolute; left: 50%; top: calc(var(--w) * .008); width: calc(var(--w) * .006); height: calc(var(--w) * .006);
  margin-left: calc(var(--w) * -.003); border-radius: 50%; background: #1d2a33; box-shadow: 0 0 0 1px #000;
}
.screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 3px;
  background: #000;
}
.screen__glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 20;
  background: linear-gradient(112deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .02) 30%, transparent 46%);
}

.base {
  position: absolute; left: -2%; width: 104%; top: 100%; height: calc(var(--w) * .66);
  transform-origin: 50% 0; transform: rotateX(90deg); transform-style: preserve-3d;
}
.base__top {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(180deg, #2a2e35 0%, #353a42 55%, #2b2f36 100%);
  border-radius: 4px 4px calc(var(--w) * .03) calc(var(--w) * .03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.base__shadow {
  position: absolute; inset: -6% -7% -16%; transform: translateZ(-4px);
  background: radial-gradient(closest-side, rgba(0, 0, 0, .9), rgba(0, 0, 0, .5) 60%, transparent);
  filter: blur(10px);
}
.base__front {
  position: absolute; left: 1.5%; right: 1.5%; top: 100%; height: calc(var(--w) * .018);
  transform-origin: 50% 0; transform: rotateX(-90deg);
  background: linear-gradient(180deg, #3a3f48, #15171b);
  border-radius: 0 0 calc(var(--w) * .02) calc(var(--w) * .02);
}
.base__glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(80% 70% at 50% 0%, rgba(140, 180, 255, .22), transparent 70%);
}

/* keyboard */
.kbd {
  position: absolute; left: 8%; right: 8%; top: 6%; height: 50%;
  display: flex; flex-direction: column; gap: 1.4%;
  padding: .8%; border-radius: 6px; background: #101215;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8);
}
.kbd__row { display: flex; gap: .55%; flex: 1; }
.kbd__row--f { flex: .6; }
.key {
  flex: var(--u, 1); min-width: 0; border-radius: 3px;
  background: linear-gradient(180deg, #23262c, #1a1c21);
  box-shadow: inset 0 -2px 0 #0b0c0e, inset 0 0 0 1px rgba(255, 255, 255, .03);
  display: grid; place-items: center; overflow: hidden;
  font: 500 calc(var(--w) * .0105) / 1 var(--mono); color: #6c717b;
  transition: background .12s, color .12s, box-shadow .12s;
}
.kbd.is-lit .key { color: rgba(140, 240, 210, .65); text-shadow: 0 0 4px rgba(94, 242, 194, .45); }
.key.is-down {
  background: linear-gradient(180deg, #1d3a33, #17302a); color: #c8fff0 !important;
  box-shadow: 0 0 calc(var(--w) * .018) rgba(94, 242, 194, .75), inset 0 0 0 1px rgba(94, 242, 194, .85);
}
.pad {
  position: absolute; left: 32%; right: 32%; top: 62%; bottom: 7%; border-radius: 8px;
  background: linear-gradient(180deg, #30343c, #2a2e35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- caption + skip ---------- */
.intro__caption {
  position: absolute; left: 16px; right: 16px; bottom: clamp(24px, 6vh, 56px); margin: 0;
  text-align: center; font: 500 clamp(13px, 1.6vw, 16px) / 1.5 var(--mono); letter-spacing: .04em;
  color: #9aa3b8; min-height: 1.5em;
}
.intro__caption b { color: var(--mint); font-weight: 600; }
.intro__skip {
  position: absolute; top: 18px; right: 18px; z-index: 5;
  font: 500 13px / 1 var(--mono); color: #9aa3b8; letter-spacing: .04em;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12);
  padding: 10px 16px; border-radius: 99px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.intro__skip:hover, .intro__skip:focus-visible { color: var(--mint); border-color: var(--mint); outline: none; }

/* =========================================================
   Virtual screen — 1280 × 800 px
   ========================================================= */
.vsc {
  position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0;
  font: 13px/1.4 "Segoe UI", system-ui, sans-serif; color: #cccccc; overflow: hidden;
  background: #000;
}
.vsc * { box-sizing: border-box; }

/* boot */
.boot { position: absolute; inset: 0; background: #000; display: grid; place-content: center; justify-items: center; gap: 34px; z-index: 30; }
.boot b {
  font: 700 84px/1 var(--mono); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(94, 242, 194, .35));
}
.boot i {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15); border-top-color: #fff; animation: spin .8s linear infinite;
}

/* desktop */
.os {
  position: absolute; inset: 0;
  background:
    radial-gradient(55% 70% at 22% 28%, rgba(94, 242, 194, .38), transparent 62%),
    radial-gradient(60% 75% at 82% 72%, rgba(139, 123, 255, .5), transparent 62%),
    radial-gradient(40% 50% at 60% 20%, rgba(255, 122, 182, .18), transparent 60%),
    linear-gradient(135deg, #0a1020, #161236);
}
.os__icons { position: absolute; left: 14px; top: 14px; display: grid; gap: 18px; }
.os__icon { width: 76px; display: grid; justify-items: center; gap: 6px; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; }
.ic { width: 42px; height: 36px; border-radius: 6px; display: grid; place-items: center; font: 700 11px/1 var(--mono); }
.ic--pc { background: linear-gradient(#5fa8ff, #2e6fd8); box-shadow: inset 0 -8px 0 #1c4a96; }
.ic--folder { background: linear-gradient(#ffd56b, #f0b232); border-radius: 3px 8px 6px 6px; }
.ic--pdf { background: #fff; color: #e5352b; width: 34px; height: 42px; border-radius: 3px 10px 3px 3px; }
.os__bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: rgba(24, 26, 36, .82); backdrop-filter: blur(20px); border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; justify-content: center;
}
.os__apps { display: flex; gap: 6px; }
.tb {
  position: relative; width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center;
  font: 700 13px/1 var(--mono); color: #fff;
}
.tb.is-active { background: rgba(255, 255, 255, .1); }
.tb.is-active::after {
  content: ""; position: absolute; bottom: 2px; left: 50%; width: 16px; height: 3px; margin-left: -8px;
  border-radius: 3px; background: #6cb8ff;
}
.tb.is-hover { background: rgba(255, 255, 255, .08); }
.tb--start { grid-template-columns: 10px 10px; gap: 2px; place-content: center; }
.tb--start i { width: 10px; height: 10px; background: linear-gradient(135deg, #6ad0ff, #2f8bea); border-radius: 1px; }
.tb--search::before { content: ""; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; }
.tb--folder::before { content: ""; width: 24px; height: 18px; background: linear-gradient(#ffd56b, #f0b232); border-radius: 2px 5px 3px 3px; }
.tb--web::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(from 30deg, #5ef2c2, #8b7bff, #ff7ab6, #5ef2c2); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .25); }
.tb--code { color: #fff; font-size: 12px; background: linear-gradient(135deg, #2a9cf0, #0d64c8); width: 30px; height: 30px; margin: 5px; border-radius: 7px; }
.tb--code.is-active { box-shadow: 0 0 0 5px rgba(255, 255, 255, .1); }
.tb--term { font-size: 12px; background: #101317; width: 30px; height: 30px; margin: 5px; border-radius: 6px; border: 1px solid #3a3f48; }
.os__clock {
  position: absolute; right: 14px; top: 0; bottom: 0; display: grid; align-content: center; justify-items: end;
  font-size: 12px; line-height: 1.35; color: #fff;
}

/* VS Code window */
.win {
  position: absolute; left: 0; top: 0; width: 1280px; height: 752px; display: flex; flex-direction: column;
  background: #1f1f1f; opacity: 0; transform-origin: 50% 100%;
  box-shadow: 0 0 0 1px #2b2b2b;
}
.win__title {
  height: 34px; flex: none; display: flex; align-items: center; gap: 14px; padding-left: 12px;
  background: #181818; border-bottom: 1px solid #2b2b2b; font-size: 13px; color: #cccccc;
}
.win__logo { font: 700 11px/1 var(--mono); color: #3aa0ff; }
.win__menu { white-space: nowrap; }
.win__search {
  position: absolute; left: 50%; width: 420px; margin-left: -210px; height: 24px; border-radius: 6px;
  background: #242424; border: 1px solid #333; display: grid; place-items: center; color: #9d9d9d; font-size: 12px;
}
.win__ctrl { margin-left: auto; display: flex; height: 100%; }
.win__ctrl i { font-style: normal; width: 46px; display: grid; place-items: center; color: #ccc; font-size: 12px; }
.win__main { flex: 1; display: flex; min-height: 0; }
.win__act {
  width: 48px; flex: none; background: #181818; border-right: 1px solid #2b2b2b;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px;
}
.win__act i { font-style: normal; width: 48px; height: 44px; display: grid; place-items: center; font-size: 20px; color: #868686; }
.win__act i.on { color: #fff; box-shadow: inset 2px 0 0 #0078d4; }
.win__side { width: 250px; flex: none; background: #181818; border-right: 1px solid #2b2b2b; font-size: 13px; }
.side__head { height: 35px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .04em; }
.side__proj { padding: 3px 8px; font-weight: 700; font-size: 11px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { color: #cccccc; height: 22px; display: flex; align-items: center; gap: 6px; padding-left: 20px; white-space: nowrap; }
.tree li.in { padding-left: 36px; }
.tree li.is-hover { background: #2a2d2e; }
.tree li.is-sel { background: #04395e; box-shadow: inset 0 0 0 1px #0078d4; }
.fi { width: 16px; font: 700 9px/1 var(--mono); text-align: center; }
.fi--js { color: #f1dd3f; }
.fi--css { color: #42a5f5; font-size: 12px; }
.fi--pdf { color: #f44336; font-size: 12px; }
.fi--html { color: #e44d26; }
.fi--json { color: #f1dd3f; }
.fi--md { color: #42a5f5; }
.win__ed { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed__tabs { height: 35px; flex: none; background: #181818; border-bottom: 1px solid #2b2b2b; display: flex; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 0 12px 0 10px; background: #1f1f1f; color: #fff;
  border-right: 1px solid #2b2b2b; box-shadow: inset 0 1px 0 #0078d4; font-size: 13px;
}
.tab i { font-style: normal; font-size: 11px; color: #ccc; margin-left: 10px; }
.ed__tabs .tab, .ed__crumbs { visibility: hidden; }
.ed__tabs.is-open .tab, .ed__crumbs.is-open { visibility: visible; }
.ed__crumbs { height: 22px; flex: none; padding-left: 16px; font-size: 12px; color: #a9a9a9; display: flex; align-items: center; }
.ed__body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ed__empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px;
  font: 700 120px/1 var(--mono); color: #262626;
}
.ed__empty small { font: 13px/2 "Segoe UI", system-ui, sans-serif; color: #6e6e6e; text-align: center; }
.ed__code { position: absolute; inset: 0; padding-top: 4px; font: 14px/21px var(--mono); color: #d4d4d4; }
.ln { display: flex; white-space: pre; }
.ln.is-cur { background: #222; box-shadow: inset 0 0 0 1px #282828; }
.ln u { text-decoration: none; width: 64px; flex: none; text-align: right; padding-right: 26px; color: #6e7681; }
.ln.is-cur u { color: #cccccc; }
.ln .cur { display: inline-block; width: 2px; height: 19px; background: #aeafad; vertical-align: -4px; animation: blink 1.05s steps(1) infinite; }
.tk { color: #569cd6; } .tc { color: #c586c0; } .ts { color: #ce9178; } .tm { color: #6a9955; }
.tf { color: #dcdcaa; } .tv { color: #9cdcfe; } .tt { color: #4ec9b0; } .tn { color: #b5cea8; } .tb2 { color: #ffd700; }

/* terminal panel */
.term { height: 0; flex: none; overflow: hidden; background: #181818; border-top: 1px solid #2b2b2b; display: flex; flex-direction: column; }
.term__tabs { height: 35px; flex: none; display: flex; align-items: center; gap: 22px; padding: 0 14px; font-size: 11px; color: #9d9d9d; letter-spacing: .02em; }
.term__tabs .on { color: #e7e7e7; box-shadow: inset 0 -1px 0 #e7e7e7; padding: 9px 0; }
.term__tabs .term__tools { margin-left: auto; font-size: 12px; }
.term__body { flex: 1; padding: 4px 18px; font: 14px/20px var(--mono); color: #cccccc; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.term__line { white-space: pre; min-height: 20px; }
.term__caret { display: inline-block; width: 8px; height: 17px; background: #cccccc; vertical-align: -3px; margin-left: 1px; animation: blink 1.05s steps(1) infinite; }
.term__caret.is-typing { animation: none; }
.t-ps { color: #cccccc; } .t-dim { color: #8b8b8b; } .t-g { color: #23d18b; } .t-gb { color: #23d18b; font-weight: 700; }
.t-c { color: #29b8db; } .t-y { color: #f5f543; } .t-w { color: #fff; font-weight: 700; }
.t-link { color: #29b8db; }
.t-link.is-hover { text-decoration: underline; }

.win__status {
  height: 22px; flex: none; display: flex; align-items: center; gap: 14px; padding-right: 12px;
  background: #181818; border-top: 1px solid #2b2b2b; font-size: 12px; color: #cccccc;
}
.st__remote { background: #0078d4; color: #fff; height: 100%; padding: 0 10px; display: grid; place-items: center; font: 700 11px/1 var(--mono); }
.st__r { margin-left: auto; white-space: nowrap; }

/* browser */
.brw {
  position: absolute; left: 0; top: 0; width: 1280px; height: 752px; display: flex; flex-direction: column;
  background: #202124; opacity: 0; transform-origin: 50% 100%; box-shadow: 0 0 0 1px #3c4043;
}
.brw__tabs { height: 40px; flex: none; display: flex; align-items: flex-end; gap: 4px; padding-left: 8px; background: #202124; }
.brw__tab {
  height: 32px; width: 250px; border-radius: 9px 9px 0 0; background: #35363a; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; font-size: 12px; color: #e8eaed; white-space: nowrap; overflow: hidden;
}
.brw__tab i { font-style: normal; margin-left: auto; font-size: 11px; }
.brw__tab b { width: 16px; height: 16px; flex: none; border-radius: 4px; background: #07090f; box-shadow: inset 0 0 0 1px #5ef2c2; }
.brw__tab b.is-spin { background: none; border-radius: 50%; box-shadow: none; border: 2px solid rgba(138, 180, 248, .25); border-top-color: #8ab4f8; animation: spin .7s linear infinite; }
.brw__plus { height: 32px; display: grid; place-items: center; padding: 0 10px; color: #e8eaed; }
.brw__tabs .win__ctrl { height: 40px; align-self: flex-start; }
.brw__bar { height: 42px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #35363a; color: #e8eaed; font-size: 14px; }
.brw__url { flex: 1; height: 30px; border-radius: 15px; background: #202124; display: flex; align-items: center; padding: 0 16px; font-size: 14px; color: #e8eaed; }
.brw__page { position: relative; flex: 1; background: #07090f; overflow: hidden; }
.brw__load { position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); z-index: 2; }
.mini { position: absolute; inset: 0; padding: 0 70px; opacity: 0;
  background: radial-gradient(60% 60% at 70% 30%, rgba(139, 123, 255, .16), transparent 70%), radial-gradient(50% 50% at 20% 80%, rgba(94, 242, 194, .10), transparent 70%), #07090f; }
.mini__nav { height: 70px; display: flex; align-items: center; gap: 40px; font-size: 14px; color: #8b93a7; }
.mini__nav b { font: 700 20px/1 var(--mono); color: #e9edf6; }
.mini__nav b span { color: var(--mint); }
.mini__nav span { margin-left: auto; }
.mini__nav i { font-style: normal; border: 1px solid rgba(255, 255, 255, .14); border-radius: 99px; padding: 8px 16px; color: #e9edf6; }
.mini__eyebrow { margin: 110px 0 14px; font: 14px/1 var(--mono); color: #8b93a7; display: flex; align-items: center; gap: 10px; }
.mini__eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.mini__name { margin: 0; font: 700 128px/.95 var(--font); letter-spacing: -.04em; color: #e9edf6; display: grid; }
.mini__name .o { color: transparent; -webkit-text-stroke: 2px rgba(233, 237, 246, .6); }
.mini__role { margin: 26px 0 0; font-size: 26px; color: #8b93a7; }

/* screencast key overlay */
.keys { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 25; pointer-events: none; }
.keys kbd {
  font: 600 20px/1 var(--mono); color: #fff; background: rgba(20, 22, 28, .88); padding: 12px 18px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.keys span { align-self: center; color: #fff; font: 600 18px/1 var(--mono); text-shadow: 0 2px 6px #000; }

/* mouse pointer */
.ptr { position: absolute; left: 0; top: 0; width: 20px; height: 28px; z-index: 26; opacity: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); transform-origin: 2px 2px; }
.ripple { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); opacity: 0; z-index: 25; pointer-events: none; }
