/* A single invitation: one straight pixel arrow, a crisp click, then a split reveal. */
.entry-intro{--intro-bg:#dcecf7;display:none;position:fixed;inset:0;z-index:100;place-items:center;overflow:hidden}
html[data-theme="dark"] .entry-intro{--intro-bg:#102438}
.entry-intro::before,.entry-intro::after{content:"";position:absolute;z-index:0;left:0;right:0;height:50%;background:var(--intro-bg)}
.entry-intro::before{top:0}
.entry-intro::after{bottom:0}
html.intro-pending .entry-intro{display:grid}
html.intro-pending body{overflow:hidden}
/* The page is already drawn under the curtain before it parts. */
html.intro-pending .site-wrap{opacity:1}
.entry-stage{position:relative;z-index:1;display:grid;place-items:center;width:min(90vw,620px);height:260px;transform:translateY(18px) scale(.92);opacity:0}
html.intro-running .entry-stage{animation:entry-arrive .65s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes entry-arrive{to{transform:translateY(0) scale(1);opacity:1}}
.entry-cta{position:relative;z-index:1;min-width:280px;min-height:66px;padding:18px 27px;border:3px solid #16395e;border-radius:10px;background:#2a78c3;color:#fff;box-shadow:7px 8px 0 #9ac9e8;font-size:16px;font-weight:900;letter-spacing:-.035em;transition:transform .14s,box-shadow .14s,background .14s,color .14s}
.entry-cta:hover{background:#2069ae}
html[data-theme="dark"] .entry-cta{box-shadow:7px 8px 0 #081a2c}
.entry-pointer{position:absolute;z-index:2;left:calc(50% + 82px);top:calc(50% - 18px);width:72px;height:96px;opacity:0;pointer-events:none;image-rendering:pixelated;transform:translate(210px,145px)}
html.intro-running:not(.intro-clicked) .entry-pointer{animation:pointer-approach 1.05s .43s cubic-bezier(.16,.83,.22,1) forwards}
@keyframes pointer-approach{35%{opacity:1}100%{opacity:1;transform:translate(0,0)}}
html.intro-clicked .entry-cta{transform:translate(6px,7px);box-shadow:1px 1px 0 #9ac9e8;background:#ffd553;color:#16395e}
html[data-theme="dark"].intro-clicked .entry-cta{box-shadow:1px 1px 0 #081a2c}
html.intro-clicked .entry-pointer,html.intro-ending .entry-pointer{opacity:1;transform:translate(6px,7px) scale(.92)}
.entry-click-spark{position:absolute;z-index:4;left:calc(50% + 86px);top:calc(50% - 13px);width:6px;height:6px;pointer-events:none}
.entry-click-spark::before{content:"";position:absolute;left:-5px;top:-5px;width:16px;height:16px;border:3px solid #fff;box-shadow:0 0 0 2px #071326;opacity:0;transform:scale(.3)}
.entry-click-spark i{position:absolute;left:0;top:0;width:6px;height:6px;border:2px solid #071326;background:#fff;opacity:0;transform:translate(0,0) scale(.4)}
.entry-click-spark i:nth-child(1){--dx:-18px;--dy:-14px}
.entry-click-spark i:nth-child(2){--dx:14px;--dy:-21px;background:#d8e8f5}
.entry-click-spark i:nth-child(3){--dx:25px;--dy:6px}
.entry-click-spark i:nth-child(4){--dx:-12px;--dy:20px;background:#d8e8f5}
.entry-click-spark i:nth-child(5){--dx:8px;--dy:16px;width:4px;height:4px;background:#071326}
html.intro-clicked .entry-click-spark i{animation:click-pixel .42s steps(4,end) both}
html.intro-clicked .entry-click-spark::before{animation:click-pulse .45s steps(5,end) both}
@keyframes click-pixel{0%{opacity:1;transform:translate(0,0) scale(1)}75%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.5)}}
@keyframes click-pulse{0%{opacity:0;transform:scale(.3)}20%{opacity:1}100%{opacity:0;transform:scale(1.5)}}
html.intro-ending .entry-stage{animation:entry-exit .82s cubic-bezier(.3,.05,.2,1) forwards}
@keyframes entry-exit{to{transform:translate(-22vw,0) scale(.54);opacity:0}}
html.intro-ending .entry-intro{pointer-events:none}
html.intro-ending .entry-intro::before{animation:entry-top-open .88s cubic-bezier(.76,0,.24,1) forwards}
html.intro-ending .entry-intro::after{animation:entry-bottom-open .88s cubic-bezier(.76,0,.24,1) forwards}
@keyframes entry-top-open{to{transform:translateY(-102%)}}
@keyframes entry-bottom-open{to{transform:translateY(102%)}}
@keyframes hero-part-in{from{opacity:0;transform:translateY(25px)}to{opacity:1;transform:none}}
@keyframes hero-text-in{from{opacity:0;transform:translateX(-36px)}to{opacity:1;transform:none}}
@keyframes hero-scene-in{from{opacity:0;transform:translate(38px,24px) rotate(4deg)}to{opacity:1;transform:none}}

/* Whole blocks appear gently; their text stays readable throughout. */
html.motion-ready .motion-left,html.motion-ready .motion-right,html.motion-ready .motion-rise{opacity:0;transition:none}
html.motion-ready .motion-left{transform:translate3d(-43px,10px,0)}
html.motion-ready .motion-right{transform:translate3d(43px,10px,0)}
html.motion-ready .motion-rise{transform:translate3d(0,25px,0)}
html.motion-ready .motion-left.is-visible,html.motion-ready .motion-right.is-visible,html.motion-ready .motion-rise.is-visible{opacity:1;transform:none;transition:opacity .62s ease,transform .78s cubic-bezier(.2,.75,.22,1);transition-delay:var(--motion-delay,0ms)}
/* Skills use the same grounded icon-and-copy language on every screen. */
.hero{margin-top:32px}
html[data-theme="dark"] .hero{padding:0;background:transparent;clip-path:none}
.about-side .ghost-art{position:relative;display:block;flex:none;width:205px;height:205px;transform:rotate(-4deg)}
.about-side .ghost-art img{display:block;width:100%;height:100%;transform:none}
html[data-theme="dark"] .ghost-art::before,html[data-theme="dark"] .ghost-art::after{content:"";position:absolute;z-index:1;top:60.1%;width:5.5%;height:3.2%;background:linear-gradient(90deg,#8ccefb,#5daee8);pointer-events:none}
html[data-theme="dark"] .ghost-art::before{left:31.7%}
html[data-theme="dark"] .ghost-art::after{left:62.7%}
.stack{margin-top:104px}
.tech-stack{margin:90px 34px 0;scroll-margin-top:108px}
.tech-stack .stack-heading{margin-bottom:17px}
.about,.stack,.projects,.contact{scroll-margin-top:108px}
.stack-heading{max-width:680px;margin:0 auto 32px}
.stack-heading p{max-width:560px;margin:12px auto 0;font-size:14px}
.skills-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:1100px;margin-inline:auto}
.skill-card{position:relative;display:grid;grid-template-columns:78px minmax(0,1fr);grid-template-rows:auto 1fr auto;column-gap:18px;align-items:start;min-height:176px;padding:23px;border:0;border-radius:19px;background:#fff;color:#16395e;box-shadow:5px 5px 0 #c8e6f6;transition:background .3s,box-shadow .3s,transform .3s}
.skill-card::after{display:none}
.skill-card.is-active{background:#eaf6ff;color:#16395e;box-shadow:6px 7px 0 #95c8e8}
.skill-mark{display:grid;grid-column:1;grid-row:1 / 4;place-items:center;align-self:center;width:72px;height:72px}
.skill-mark svg{display:block;width:62px;height:62px;shape-rendering:crispEdges;filter:drop-shadow(2px 2px 0 #a3cce5)}
.skill-card h3{grid-column:2;grid-row:1;margin:0 0 9px;font-size:20px;line-height:1.14;letter-spacing:-.055em}
.skill-card p{grid-column:2;grid-row:2;margin:0 0 14px;font-size:12px;line-height:1.57;color:#43698a}
.skill-card.is-active p{color:#43698a}
.skill-card small{grid-column:2;grid-row:3;font-size:10px;font-weight:800;color:#266eaa}
.skill-card.is-active small{color:#266eaa}
html[data-theme="dark"] .skill-card{background:#1c3852;color:#eaf5ff;box-shadow:4px 4px 0 #0c1d2d}
html[data-theme="dark"] .skill-card p,html[data-theme="dark"] .skill-card.is-active p{color:#bed7ea}
html[data-theme="dark"] .skill-card small,html[data-theme="dark"] .skill-card.is-active small{color:#99d3f4}
html[data-theme="dark"] .skill-card.is-active{background:#254d70;box-shadow:4px 4px 0 #123250}
html[data-theme="dark"] .skill-mark{color:#8acaf1}
html[data-theme="dark"] .skill-mark svg{filter:drop-shadow(2px 2px 0 #0c263f)}
html[data-theme="dark"] .workflow::before{background:#0c1d2d}
@media(max-width:800px){
  .hero{margin-top:28px}
  .about-side .ghost-art{width:175px;height:175px}
  .tech-stack{margin:84px 8px 0}
  .skills-grid{grid-template-columns:1fr}
  .skill-card{min-height:145px}
}
@media(max-width:600px){
  .hero{margin-top:23px}
  .entry-stage{width:min(96vw,480px);height:250px}
  .entry-cta{min-width:270px;min-height:60px;font-size:14px}
  .entry-pointer{left:calc(50% + 77px);width:60px;height:80px}
  .entry-click-spark{left:calc(50% + 81px)}
  .about-side .ghost-art{width:125px;height:125px;grid-column:1;grid-row:1;transform:rotate(2deg)}
  .stack{margin:82px 18px 0}
  .tech-stack{margin:76px 18px 0}
  .stack-heading{text-align:center;margin-bottom:22px}
  .stack-heading p{font-size:12px}
  .skills-grid{display:grid;grid-template-columns:1fr;gap:11px}
  .skill-card{display:grid;grid-template-columns:70px minmax(0,1fr);column-gap:16px;min-height:0;padding:20px 18px;align-items:start}
  .skill-card,.skill-card.is-active{background:#fff;box-shadow:6px 7px 0 #c8e6f6}
  html[data-theme="dark"] .skill-card,html[data-theme="dark"] .skill-card.is-active{background:#1c3852;box-shadow:4px 4px 0 #0c1d2d}
  .skill-mark{grid-column:1;grid-row:1 / 4;align-self:center;width:66px;height:66px}
  .skill-mark svg{width:58px;height:58px}
  .skill-card h3{grid-column:2;grid-row:1;margin:0 0 7px;font-size:18px}
  .skill-card p{grid-column:2;grid-row:2;margin:0 0 10px;font-size:11px}
  .skill-card small{grid-column:2;grid-row:3;margin:0}
}
@media(max-width:360px){.about-side .ghost-art{width:110px;height:110px}}
@media(prefers-reduced-motion:reduce){
  .entry-intro{display:none!important}
  .motion-left,.motion-right,.motion-rise{opacity:1!important;transform:none!important;clip-path:none!important;animation:none!important;transition:none!important}
}
