/* PRABIN KANDEL / DIGITAL LAB — FINAL MANAGED SYSTEM
   One visual language for portfolio, archive, projects and lab. */
:root {
  --bg: #070812;
  --bg2: #0b0f1d;
  --surface: #101629;
  --surface2: #151c31;
  --ink: #f5f7ff;
  --muted: #98a4bb;
  --dim: #647089;
  --line: rgba(166,185,230,.15);
  --line2: rgba(166,185,230,.28);
  --accent: #62e9ff;
  --accent2: #315cff;
  --paper: #f5f7ff;
  --paperink: #070812;
  --glow: rgba(98,233,255,.16);
  --max: 1320px;
}

html[data-theme="light"] {
  --bg: #f4f7fc; --bg2: #eaf0fa; --surface: #fff; --surface2: #edf2f9;
  --ink: #0a1020; --muted: #66728a; --dim: #7c879c;
  --line: rgba(24,36,64,.12); --line2: rgba(24,36,64,.24);
  --accent: #315cff; --accent2: #2546d6; --paper: #0a1020; --paperink: #f4f7fc;
  --glow: rgba(49,92,255,.14);
}

body {
  background:
    radial-gradient(circle at 78% -8%, rgba(127,108,255,.10), transparent 25%),
    radial-gradient(circle at 2% 34%, rgba(98,233,255,.07), transparent 24%),
    var(--bg);
  color: var(--ink);
}

/* Restore the cinematic V4 circular entry, recoloured to the original blue system. */
.boot-screen {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  overflow: hidden; isolation: isolate; background: #070812; color: var(--ink);
  transition: opacity .9s cubic-bezier(.2,.75,.2,1), visibility .9s;
}
.boot-screen::before {
  content: ""; position: absolute; inset: 0; z-index: -3;
  background: radial-gradient(circle at 50% 46%, rgba(98,233,255,.12), transparent 25%),
              radial-gradient(circle at 50% 50%, rgba(127,108,255,.06), transparent 48%);
}
.boot-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none; opacity: .11;
  background: linear-gradient(transparent 49.9%, rgba(245,247,255,.045) 50%, transparent 50.1%);
  background-size: 100% 7px; mix-blend-mode: screen;
}
.boot-screen.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* Hard fail-safe: even if JavaScript is blocked, the entry overlay cannot trap the portfolio. */
.boot-screen { animation: bootFailsafe 3.8s ease forwards; }
@keyframes bootFailsafe {
  0%, 84% { opacity: 1; visibility: visible; pointer-events: auto; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.boot-grid {
  position: absolute; inset: -20%; opacity: .48;
  background-image: linear-gradient(rgba(245,247,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(245,247,255,.035) 1px, transparent 1px);
  background-size: 76px 76px; transform: perspective(700px) rotateX(62deg) translateY(25%);
  transform-origin: center bottom; animation: bootGrid 2.8s cubic-bezier(.2,.7,.2,1) both;
}
.boot-orbit { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(98,233,255,.18); border-radius: 50%; pointer-events: none; }
.boot-orbit--one { width: min(62vw,720px); height: min(62vw,720px); transform: translate(-50%,-50%) rotate(-18deg); animation: bootOrbit 4.5s linear infinite; }
.boot-orbit--two { width: min(40vw,470px); height: min(40vw,470px); transform: translate(-50%,-50%) rotate(28deg); border-color: rgba(127,108,255,.18); animation: bootOrbitReverse 7s linear infinite; }
.boot-orbit::after { content:""; position:absolute; width:6px; height:6px; border-radius:50%; background:var(--accent); left:17%; top:-3px; box-shadow:0 0 0 7px rgba(98,233,255,.07),0 0 28px rgba(98,233,255,.28); }
.boot-corner { position:absolute; z-index:5; font:500 8px "DM Mono",monospace; letter-spacing:.14em; color:var(--dim); text-transform:uppercase; opacity:0; animation:bootCorner .6s .2s forwards; }
.boot-corner--tl{top:26px;left:28px}.boot-corner--tr{top:26px;right:28px}.boot-corner--bl{bottom:26px;left:28px}.boot-corner--br{bottom:26px;right:28px}
.boot-inner { position:relative; z-index:10; width:min(780px,calc(100% - 42px)); font-family:"DM Mono",monospace; text-align:center; }
.boot-symbol { position:relative; width:62px; height:62px; margin:0 auto 30px; border:1px solid rgba(245,247,255,.22); display:grid; place-items:center; opacity:0; transform:scale(.7) rotate(-12deg); animation:bootSymbol .9s .08s cubic-bezier(.2,.9,.2,1) forwards; }
.boot-symbol::before,.boot-symbol::after{content:"";position:absolute;background:var(--accent)}.boot-symbol::before{width:20px;height:1px;left:-10px;top:50%}.boot-symbol::after{width:1px;height:20px;top:-10px;left:50%}.boot-symbol span{font:600 12px "Space Grotesk",sans-serif;letter-spacing:.05em}.boot-symbol i{position:absolute;inset:7px;border:1px dashed rgba(98,233,255,.4);animation:bootSpin 6s linear infinite}
.boot-kicker{font:500 8px "DM Mono",monospace;letter-spacing:.22em;color:var(--muted);opacity:0;animation:bootUp .7s .25s forwards}.boot-kicker b{color:var(--accent);font-weight:500;margin:0 6px}
.boot-title{margin:24px 0 10px;font:600 clamp(56px,11vw,142px)/.76 "Space Grotesk",sans-serif;letter-spacing:-.09em;display:flex;flex-direction:column;align-items:center;overflow:hidden}.boot-title span,.boot-title em{display:block;font-style:normal;opacity:0;transform:translateY(110%);animation:bootWord .95s cubic-bezier(.15,.8,.2,1) forwards}.boot-title span{animation-delay:.38s}.boot-title em{color:var(--accent);animation-delay:.52s}
.boot-subtitle{font:500 9px "DM Mono",monospace;letter-spacing:.15em;color:var(--dim);opacity:0;animation:bootUp .7s .8s forwards}
.boot-log{display:grid;grid-template-columns:repeat(2,1fr);gap:7px 28px;max-width:560px;margin:34px auto 0;text-align:left;font-size:9px;line-height:1.7;color:var(--muted);text-transform:uppercase;letter-spacing:.055em}.boot-log span{display:flex;gap:9px;opacity:0;transform:translateX(-10px);animation:bootLog .45s forwards}.boot-log span:nth-child(1){animation-delay:.88s}.boot-log span:nth-child(2){animation-delay:1.02s}.boot-log span:nth-child(3){animation-delay:1.16s}.boot-log span:nth-child(4){animation-delay:1.3s}.boot-log b{color:var(--accent);font-weight:500}
.boot-progress-wrap{margin:34px auto 0;max-width:560px;opacity:0;animation:bootUp .6s 1.15s forwards}.boot-progress{height:2px;background:rgba(245,247,255,.09);margin:0;overflow:hidden;position:relative}.boot-progress span{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--accent),#b9f7ff);box-shadow:0 0 18px rgba(98,233,255,.32);animation:bootProgress 2.25s cubic-bezier(.2,.75,.2,1) forwards}.boot-progress-meta{display:flex;justify-content:space-between;margin-top:10px;font:500 7px "DM Mono",monospace;letter-spacing:.14em;color:var(--dim)}.boot-progress-meta span:last-child{color:var(--accent)}
.boot-enter{display:flex;justify-content:center;align-items:center;gap:13px;margin-top:24px;font:500 8px "DM Mono",monospace;letter-spacing:.15em;color:var(--dim);opacity:0;animation:bootUp .6s 1.45s forwards}.boot-enter i{width:40px;height:1px;background:var(--line2)}.boot-enter b{color:var(--accent);font-weight:500}
@keyframes bootGrid{from{opacity:0;transform:perspective(700px) rotateX(62deg) translateY(35%)}to{opacity:.48;transform:perspective(700px) rotateX(62deg) translateY(25%)}}
@keyframes bootOrbit{to{transform:translate(-50%,-50%) rotate(342deg)}}@keyframes bootOrbitReverse{to{transform:translate(-50%,-50%) rotate(-332deg)}}@keyframes bootSymbol{to{opacity:1;transform:scale(1) rotate(0)}}@keyframes bootUp{to{opacity:1;transform:none}}@keyframes bootWord{to{opacity:1;transform:none}}@keyframes bootLog{to{opacity:1;transform:none}}@keyframes bootProgress{to{width:100%}}@keyframes bootSpin{to{transform:rotate(360deg)}}@keyframes bootCorner{to{opacity:1}}

/* Typography and rhythm */
.section-intro h2,.hero-copy h1,.project-card h3,.gateway h2,.record-copy h3,.contact-copy h2{font-family:"Space Grotesk",ui-sans-serif,sans-serif; text-wrap:balance;}
.section-intro h2 em,.hero-copy h1 em,.project-card h3 em,.gateway h2 em,.record-copy h3 em,.contact-copy h2 em{color:var(--accent);}
.section-summary,.hero-intro,.project-card p,.record-copy>p:not(.record-label),.capability p,.timeline-body p{max-width:62ch; line-height:1.75;}
.kicker,.eyebrow,.hero-role span,.project-card-top,.project-tags span,.record-status,.status-badge,.record-label,.archive-tools,.recognition-strip span,.gateway-meta,.contact-link,.field label{font-family:"DM Mono",monospace; letter-spacing:.12em; text-transform:uppercase;}

/* Header */
.site-header{background:rgba(7,8,18,.72)!important;border-color:transparent!important;backdrop-filter:blur(18px) saturate(120%);}
.site-header.scrolled{background:rgba(7,8,18,.94)!important;border-color:var(--line)!important;}
.brand-mark{background:linear-gradient(135deg,var(--accent),#315cff)!important;color:#06101b!important;box-shadow:0 0 30px var(--glow)!important;}
.desktop-nav a:hover,.desktop-nav a.active,.text-link:hover,.hero-role,.hero-kicker,.kicker,.hero-overline,.hero-note span,.hero-side-index,.cap-head span,.record-status,.status-badge,.map-live,.map-foot a{color:var(--accent)!important;}

/* Hero */
.hero{background:radial-gradient(circle at 76% 24%,rgba(98,233,255,.10),transparent 25%),radial-gradient(circle at 50% 88%,rgba(127,108,255,.08),transparent 30%),var(--bg)!important;}
.hero-orbit{border-color:rgba(98,233,255,.13)!important}.orbit-b{border-color:rgba(127,108,255,.15)!important}.hero-copy h1 em{color:transparent!important;-webkit-text-stroke:1px var(--accent);text-shadow:0 0 42px var(--glow);}
.button-solid{background:linear-gradient(135deg,var(--accent),#b9f7ff)!important;color:#06101b!important;border:0!important;box-shadow:0 16px 45px var(--glow)!important;}.button-solid:hover{transform:translateY(-3px);box-shadow:0 22px 65px var(--glow)!important;}

/* Cards / surfaces */
.manifesto,.fact-stack>div,.capability,.timeline-body,.archive-item,.gallery-item,.contact-form,.contact-map-wrap,.hero-live-panel,.hero-note{background:color-mix(in srgb,var(--surface) 94%,transparent)!important;border-color:var(--line)!important;}
.capability--interactive:hover,.capability--interactive:focus-visible{border-color:rgba(98,233,255,.35)!important;box-shadow:0 24px 70px rgba(0,0,0,.25);transform:translateY(-6px);}
.capability--interactive::after{background:radial-gradient(260px circle at var(--mx,50%) var(--my,50%),var(--glow),transparent 72%)!important;}

/* Work */
.project-showcase{background:var(--bg)!important;}
.project-card{border-color:var(--line)!important;background:linear-gradient(145deg,#0b1120,#101629)!important;}
.project-card:hover{border-color:rgba(98,233,255,.35)!important;box-shadow:0 35px 100px rgba(0,0,0,.35);}
.project-card-feature{background:linear-gradient(145deg,#090e1a,#11182b)!important;}
.project-tags span{border-color:var(--line2)!important;color:var(--muted)!important;}
.status-badge{background:rgba(98,233,255,.04)!important;border-color:rgba(98,233,255,.30)!important;}
.status-badge span{background:var(--accent)!important;box-shadow:0 0 12px var(--accent)!important;}
.project-image{border-color:var(--line2)!important}.project-image-overlay{background:linear-gradient(180deg,rgba(5,7,18,.18),rgba(5,7,18,.84))!important}.project-image-overlay span{color:var(--accent)!important;}

/* Recognition + archive: full evidence stays visible */
.recognition-feature{background:var(--line)!important}.record-copy,.certificate{background:var(--surface)!important}.certificate{min-height:520px;padding:clamp(18px,3vw,34px);}.certificate img{width:100%;height:100%;min-height:450px;object-fit:contain!important;object-position:center!important;background:#eef3fa!important;padding:14px!important;box-shadow:0 25px 70px rgba(0,0,0,.18)!important;transform:none!important;}.certificate:hover img{transform:scale(1.015)!important}.archive-item figure{background:var(--surface2)!important}.archive-item figure img{object-fit:contain!important;object-position:center!important;padding:12px!important;}.archive-item:hover{border-color:rgba(98,233,255,.35)!important;}

/* Gallery */
.gallery-item{border-color:var(--line)!important}.gallery-item:hover{border-color:rgba(98,233,255,.35)!important;box-shadow:0 22px 70px rgba(0,0,0,.22)!important}.gallery-caption{background:linear-gradient(transparent,rgba(5,7,18,.9))!important;}

/* Lab gateway */
.experiment-gateway{background:radial-gradient(circle at 80% 18%,rgba(98,233,255,.16),transparent 28%),linear-gradient(135deg,#0b1020,#101b30)!important;border-block:1px solid var(--line);}
.gateway{border:1px solid var(--line2)!important;background:rgba(255,255,255,.035)!important;box-shadow:0 30px 100px rgba(0,0,0,.25)!important;}
.button-dark{background:var(--ink)!important;color:var(--bg)!important;border-color:var(--ink)!important;}
.gateway-meta{border-color:var(--line)!important;}

/* Contact */
.contact-form input,.contact-form textarea{border-color:var(--line2)!important;background:var(--bg2)!important;color:var(--ink)!important}.contact-form input:focus,.contact-form textarea:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px rgba(98,233,255,.08)!important;}

/* Managed mobile typography and spacing */
@media(max-width:900px){.certificate{min-height:440px}.certificate img{min-height:390px}.project-card-content{padding-top:40px}.section-intro{gap:30px}.boot-orbit--one{width:92vw;height:92vw}.boot-orbit--two{width:64vw;height:64vw}}
@media(max-width:600px){.container{width:calc(100% - 28px)}.section{padding:88px 0}.section-intro h2{font-size:clamp(48px,15vw,78px)}.hero-copy h1{font-size:clamp(64px,18vw,108px)}.boot-corner--bl,.boot-corner--br{display:none}.boot-log{grid-template-columns:1fr;gap:6px}.boot-title{font-size:clamp(48px,15vw,92px)}.boot-subtitle{font-size:7px;letter-spacing:.10em}.boot-progress-wrap{margin-top:28px}.certificate{min-height:360px;padding:14px}.certificate img{min-height:320px}.recognition-strip{grid-template-columns:1fr}.gateway{padding:32px 22px}.gateway h2{font-size:clamp(52px,15vw,92px)}}

@media(prefers-reduced-motion:reduce){.boot-grid,.boot-orbit,.boot-symbol i,.boot-log span,.boot-title span,.boot-title em,.boot-kicker,.boot-subtitle,.boot-progress-wrap,.boot-enter,.boot-corner{animation:none!important}.boot-progress span{animation:none!important;width:100%!important}.boot-screen{transition:none!important}.reveal{opacity:1!important;transform:none!important;filter:none!important}.hero-orbit,.orbit-a,.orbit-b,.live-dot{animation:none!important}.capability--interactive:hover{transform:none!important}}
/* ENTRY ANIMATION IS IDENTITY-LOCKED: theme toggles must never recolour it. */
.boot-screen{background:#070812!important;color:#f5f7ff!important}.boot-screen .boot-title span{color:#f5f7ff!important}.boot-screen .boot-title em,.boot-screen .boot-kicker b,.boot-screen .boot-progress-meta span:last-child,.boot-screen .boot-enter b{color:#62e9ff!important}.boot-screen .boot-kicker,.boot-screen .boot-subtitle,.boot-screen .boot-log,.boot-screen .boot-progress-meta,.boot-screen .boot-enter{color:#98a4bb!important}.boot-screen .boot-progress span{background:linear-gradient(90deg,#62e9ff,#b9f7ff)!important}.boot-screen .boot-orbit--two{border-color:rgba(49,92,255,.18)!important}
/* Cursor effect intentionally removed. */
.cursor-dot,.cursor-ring{display:none!important}
/* Smooth editorial scroll choreography */
.reveal{opacity:0;transform:translate3d(0,56px,0) scale(.985);filter:blur(4px);transition:opacity .9s cubic-bezier(.16,1,.3,1),transform 1s cubic-bezier(.16,1,.3,1),filter .9s cubic-bezier(.16,1,.3,1);will-change:opacity,transform,filter}
.reveal.is-visible{opacity:1;transform:none;filter:none}
.reveal:nth-child(2){transition-delay:.05s}.reveal:nth-child(3){transition-delay:.1s}.reveal:nth-child(4){transition-delay:.15s}
@media(prefers-reduced-motion:reduce){.reveal{opacity:1;transform:none;filter:none;transition:none!important}}
