/* Pixel Night: M S Raaghavan portfolio */
:root {
  --ground: #07080f; --panel: rgba(9, 11, 22, .86); --chip: #1a2038;
  --line: #2c375c; --line2: #4a5a86;
  --head: #f4efe2; --text: #ece6d6; --body: #d5dceb; --muted: #aeb9cd;
  --amber: #ffc65c; --amber2: #ffd99a; --fire: #f99a3c; --ember: #e0582c; --cyan: #73eff7; --ink: #1a1205;
  --px: 'Pixelify Sans', ui-monospace, monospace;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --shadow: 0 2px 0 rgba(5, 6, 12, .9), 0 0 24px rgba(5, 6, 12, .9);
  --shadow-big: 0 6px 0 rgba(5, 6, 12, .95), 0 0 60px rgba(5, 6, 12, .9);
}
* { box-sizing: border-box; }
html { background: var(--ground); }
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: #7fe3ec; }
a:hover { color: #c4f8fb; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
::selection { background: var(--amber); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 300; padding: 10px 14px; background: var(--amber); color: var(--ink); font-family: var(--mono); }
.skip:focus { top: 12px; }

/* ---------- one fixed scenery behind the whole page: the rooftop, then a pixel world per section ---------- */
.scenery { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--ground); }
.scene { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; transform-origin: 50% 50%; }
.js #sceneA, .js #sceneB { opacity: 0; visibility: hidden; will-change: opacity, transform; }
.scenery::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse 80% 75% at 50% 50%, rgba(4, 5, 10, 0) 58%, rgba(4, 5, 10, .5) 100%); }
/* darkens behind the text only while a section's content is on screen; the world stays visible at the sides */
.veil { position: absolute; inset: 0; z-index: 3; opacity: 0; background: linear-gradient(90deg, rgba(6, 7, 14, .42) 0%, rgba(6, 7, 14, .8) 22%, rgba(6, 7, 14, .8) 78%, rgba(6, 7, 14, .42) 100%); }
main, .foot { position: relative; z-index: 1; }

/* ---------- hero: pinned cinematic opening ---------- */
.hero { position: relative; height: 230vh; }
.hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.trail { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; pointer-events: none; }
.hero-glow { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse 46% 34% at 50% 44%, rgba(5, 6, 12, .62), rgba(5, 6, 12, 0) 72%); }
.hero-center { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px 12vh; text-align: center; pointer-events: none; }
.hero-name { margin: 0; font-family: var(--px); font-weight: 700; font-size: clamp(42px, 11vw, 156px); line-height: .95; letter-spacing: .01em; color: var(--head); text-shadow: var(--shadow-big); will-change: transform; }
.hero-typed { margin: 26px 0 0; min-height: 1.4em; font-family: var(--mono); font-weight: 500; font-size: clamp(20px, 2.6vw, 34px); line-height: 1.3; color: var(--text); text-shadow: var(--shadow); }
.typed { color: var(--amber); }
.caret { display: inline-block; width: .55em; height: 1.05em; margin-left: 4px; vertical-align: -.16em; background: var(--amber); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.scroll-cue { position: absolute; left: 50%; bottom: 5vh; z-index: 4; width: 30px; height: 46px; margin-left: -15px; border: 3px solid #c3d6e2; box-shadow: 0 0 0 3px rgba(5, 6, 12, .6); }
.scroll-cue i { position: absolute; left: 50%; top: 8px; width: 6px; height: 8px; margin-left: -3px; background: var(--amber); animation: cue 1.6s steps(5) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(18px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }

/* ---------- sections: an establishing shot (the heading over the bright world), then the content ---------- */
.world { position: relative; }
.world-intro { position: relative; height: 150vh; height: 150svh; }
.sec-head { position: sticky; top: 0; height: 100vh; height: 100svh; margin: 0; padding: 0 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.world-in { position: relative; max-width: 1000px; margin: 0 auto; padding: 0 20px clamp(160px, 28vh, 280px); text-align: center; }
.h2 { margin: 0; font-family: var(--px); font-weight: 700; font-size: clamp(60px, 11vw, 150px); line-height: .95; color: var(--head); text-shadow: var(--shadow-big); }
.lede { margin: 26px auto 0; max-width: 640px; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.6; color: #eef1f7; text-shadow: var(--shadow); }
.split .w { display: inline-block; white-space: nowrap; overflow: hidden; vertical-align: top; padding: 0 .02em .12em; margin-bottom: -.12em; }
.split .c { display: inline-block; will-change: transform; }

/* ---------- entries: open layouts over the world, no panels ---------- */
.stack { display: flex; flex-direction: column; gap: clamp(130px, 20vh, 220px); }
.card { position: relative; text-align: center; transform-origin: 50% 0%; }
.card-in { transform-origin: 50% 100%; }
.meta { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-family: var(--mono); font-size: 15px; color: var(--muted); text-shadow: var(--shadow); }
.hot { color: var(--amber); }
.title { margin: 12px 0 8px; font-family: var(--px); font-weight: 700; font-size: clamp(40px, 5vw, 64px); line-height: 1.05; color: var(--head); text-shadow: var(--shadow-big); }
.title-sm { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.15; }
.kick { margin: 0 auto 18px; max-width: 700px; font-weight: 500; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--amber2); text-shadow: var(--shadow); }
.body { margin: 0 auto 8px; max-width: 700px; font-size: 18px; line-height: 1.7; color: var(--body); text-shadow: var(--shadow); }
.venue { margin: 26px 0 0; font-family: var(--mono); font-size: 14px; color: var(--muted); text-shadow: var(--shadow); }
.metrics { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 56px; margin: 36px auto 0; }
.metric { flex: 0 1 190px; }
.metric b { display: block; font-family: var(--px); font-weight: 600; font-size: clamp(38px, 4vw, 48px); line-height: 1.05; color: var(--amber); font-variant-numeric: tabular-nums; text-shadow: var(--shadow-big); }
.metric span { display: block; margin-top: 8px; font-size: 15px; line-height: 1.4; color: var(--muted); text-shadow: var(--shadow); }
.list { max-width: 720px; margin: 30px auto 0; padding-left: 20px; text-align: left; font-size: 17px; line-height: 1.7; color: var(--body); text-shadow: var(--shadow); }
.list li + li { margin-top: 10px; }
.list li::marker { color: var(--amber); }
.tags { margin: 0; font-size: 18px; line-height: 1.95; color: #e8ecf4; text-shadow: var(--shadow); text-wrap: balance; }
.tags span { white-space: nowrap; }
.tags span:not(:last-child)::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 13px 0 15px; vertical-align: .22em; background: var(--fire); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin-top: 32px; }
.label { margin: 0 0 10px; font-family: var(--mono); font-size: 14px; color: var(--muted); text-shadow: var(--shadow); }

/* ---------- skills: six open groups ---------- */
.skillset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(70px, 11vh, 120px) 64px; }
.skill { transform-origin: 50% 0%; }
.skill h3 { margin: 0 0 14px; font-family: var(--px); font-weight: 600; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.1; color: var(--amber); text-shadow: var(--shadow-big); }

/* ---------- buttons ---------- */
.btn { --bb: var(--line2); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; margin: 3px; overflow: hidden; background: #161b31; color: var(--head); border: 0; cursor: pointer; text-decoration: none; font-family: var(--px); font-weight: 600; font-size: 19px; box-shadow: 0 -3px 0 0 var(--bb), 0 3px 0 0 var(--bb), -3px 0 0 0 var(--bb), 3px 0 0 0 var(--bb), inset 0 -4px 0 0 #0d1020; transition: background .2s; }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 16%; background: rgba(255, 255, 255, .22); transform: skewX(-20deg); }
.btn:hover { color: var(--head); background: #1d2444; }
.btn:hover::after { left: 130%; transition: left .55s steps(10); }
.btn-primary { --bb: var(--ink); background: var(--amber); color: var(--ink); box-shadow: 0 -3px 0 0 var(--bb), 0 3px 0 0 var(--bb), -3px 0 0 0 var(--bb), 3px 0 0 0 var(--bb), inset 0 -4px 0 0 #e0912f; }
.btn-primary:hover { background: #ffd27a; color: var(--ink); }
.btn-mail { font-family: var(--mono); font-weight: 500; font-size: clamp(16px, 2vw, 20px); min-height: 58px; padding: 0 28px; }

/* ---------- research flow diagrams ---------- */
.flow { margin: 34px 0 6px; padding: 4px 0; overflow-x: auto; }
.flow svg { display: block; width: 100%; min-width: 620px; height: auto; }
.flow .bx { fill: rgba(11, 13, 24, .92); stroke: #36456b; stroke-width: 2; }
.flow .bx-e { stroke: #4a5a86; }
.flow .bx-f { stroke: var(--amber); animation: pulse 2.4s steps(4) infinite; }
.flow .bx-o { stroke: var(--cyan); }
.flow text { font-family: var(--mono); font-size: 14px; fill: #dfe5ef; }
.flow .t-dim { fill: var(--muted); font-size: 12px; }
.flow .t-hot { fill: var(--amber); }
.flow .t-cy { fill: var(--cyan); }
.flow .wire { fill: none; stroke: #2c375c; stroke-width: 2; }
.flow .run { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-dasharray: 4 10; animation: dash .9s linear infinite; }
.flow .pk { fill: var(--amber); }
@keyframes dash { to { stroke-dashoffset: -14; } }
@keyframes pulse { 50% { stroke: #ffe69a; } }

/* ---------- live visualisations: soft-edged screens that melt into the world ---------- */
.viz { margin: 0 auto 30px; }
.viz canvas { display: block; width: 100%; height: 270px; transform-origin: 50% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%); mask-composite: intersect; }
.viz-cap { margin: 4px auto 0; max-width: 760px; min-height: 3.1em; padding: 0 16px; font-family: var(--mono); font-size: 14px; line-height: 1.5; color: var(--muted); text-shadow: var(--shadow); }
.viz-cap b { color: var(--amber); font-weight: 500; }
.viz-small canvas { height: 160px; }

/* ---------- education ---------- */
.degree { max-width: 560px; margin: 30px auto 32px; }
.degree-row { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 14px; color: var(--muted); text-shadow: var(--shadow); }
.degree-row b { color: var(--amber); font-weight: 500; }
.segs { display: flex; gap: 3px; margin-top: 8px; padding: 4px; background: rgba(7, 8, 15, .8); box-shadow: inset 0 0 0 2px #232b4d; }
.segs i { flex: 1; height: 18px; background: var(--chip); }
.segs i.on { background: var(--amber); }
.segs i.tip { background: #ffe69a; animation: tip 1s steps(1) infinite; }
@keyframes tip { 50% { background: var(--chip); } }
.schools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 48px; }
.school .kick { margin-bottom: 0; }

/* ---------- footer: the last screen holds the heading, the links and the campfire together ---------- */
.foot .world-intro { height: auto; }
.foot .sec-head { position: relative; height: auto; padding: 24vh 20px 0; }
.foot .world-in { padding-top: 46px; padding-bottom: 44px; }
.foot-title { margin: 0; font-family: var(--px); font-weight: 700; font-size: clamp(54px, 9vw, 124px); line-height: .98; color: var(--head); text-shadow: var(--shadow-big); }
.foot-cta { display: flex; justify-content: center; }
.contact { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 36px; font-size: 17px; color: #e3e8f2; text-shadow: var(--shadow); }
.contact li { display: flex; align-items: center; gap: 10px; }
.contact a { color: #e3e8f2; text-decoration: none; }
.contact a:hover { color: var(--amber); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 18px; margin-top: 56px; }
.social { --b: var(--line); display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 22px; margin: 3px; background: var(--panel); color: var(--head); text-decoration: none; font-size: 18px; font-weight: 500; box-shadow: 0 -3px 0 0 var(--b), 0 3px 0 0 var(--b), -3px 0 0 0 var(--b), 3px 0 0 0 var(--b); transition: background .2s, box-shadow .2s, color .2s; }
.social svg { flex: none; }
.social:hover { --b: var(--amber); background: #1a2140; color: var(--amber); }
.foot-bar { margin-top: 72px; padding-top: 24px; border-top: 2px solid rgba(44, 55, 92, .7); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; font-family: var(--mono); font-size: 14px; color: var(--muted); text-shadow: var(--shadow); }
.foot-bar a { color: #dfe5ef; }

@media (max-width: 860px) {
  .skillset, .schools { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { height: 200vh; }
  .scroll-cue { display: none; }
  .world-intro { height: 130vh; height: 130svh; }
  .world-in { padding: 0 16px 150px; }
  .stack { gap: 110px; }
  .viz canvas { height: 220px; }
  .metrics { gap: 22px 32px; }
  .metric { flex-basis: 100%; }
  .veil { background: rgba(6, 7, 14, .76); }
  .tags { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: 100vh; height: 100svh; }
  .world-intro { height: auto; }
  .sec-head { position: relative; height: auto; padding: 34vh 20px 18vh; }
  .caret, .scroll-cue i, .flow .run, .flow .bx-f, .segs i.tip { animation: none; }
  .btn::after { display: none; }
}
