/* ============================================================
   Manabendu Karfa — portfolio
   Palette is a purple → magenta → orange spectrum on near-black.
   Signature: a flat orange highlight block behind black type,
   borrowed from YellowDoc.ai's own hero. It appears in exactly
   two places — one word in the headline, and a project card on
   hover — so the headline teaches the interaction.
   ============================================================ */

:root{
  /* surfaces */
  --ink:#08080a;
  --ink-2:#0e0e12;
  --surface:rgba(23,23,28,.72);
  --surface-lift:rgba(30,30,36,.82);
  --border:rgba(255,255,255,.09);
  --border-lit:rgba(255,255,255,.16);

  /* spectrum */
  --orange:#ff7a1a;
  --orange-dim:#ff9d4d;
  --flood:#ff9440;          /* card flood — lighter so black type clears 8:1 */
  --magenta:#ff2e88;
  --violet:#7b3ff2;
  --violet-soft:#b06bff;

  /* type colours */
  --text:#f4f3f0;
  --text-dim:#a8a7ad;
  --text-faint:#74737a;
  --on-flood:#170a02;       /* near-black on flood — 8.85:1 */
  --on-flood-dim:#3a1c06;   /* muted on flood — 7.09:1 */

  /* faces */
  --display:'Bricolage Grotesque','Segoe UI',system-ui,sans-serif;
  --body:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,monospace;

  /* motion */
  --ease:cubic-bezier(.22,.8,.3,1);
  --ease-out:cubic-bezier(.16,1,.3,1);
}

*{box-sizing:border-box; margin:0; padding:0;}
*{cursor:none;}
@media (hover:none),(pointer:coarse){
  *{cursor:auto;}
  .cursor-glow,.cursor-dot{display:none !important;}
}

html{scroll-behavior:smooth; background:var(--ink);}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}
body{
  background:transparent;
  color:var(--text);
  font-family:var(--body);
  font-size:16px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
a{color:inherit; text-decoration:none;}
ul{list-style:none;}
img{max-width:100%; display:block;}
h1,h2,h3{font-family:var(--display); font-weight:700; letter-spacing:-.02em; line-height:1.1;}
code{
  font-family:var(--mono); font-size:.88em;
  background:rgba(255,122,26,.12); color:var(--orange-dim);
  border:1px solid rgba(255,122,26,.2);
  padding:1px 6px; border-radius:5px;
  transition:background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}

:focus-visible{
  outline:2px solid var(--orange);
  outline-offset:3px;
  border-radius:4px;
}

.accent{color:var(--orange);}

/* ---------- AMBIENT BACKGROUND ---------- */
.bg-mesh{
  position:fixed; inset:-15%; z-index:-1; pointer-events:none;
  background:
    radial-gradient(38% 40% at 80% 4%,   rgba(255,122,26,.34), transparent 62%),
    radial-gradient(34% 38% at 10% 20%,  rgba(123,63,242,.38), transparent 64%),
    radial-gradient(30% 32% at 58% 34%,  rgba(255,46,136,.22), transparent 64%),
    radial-gradient(36% 38% at 88% 52%,  rgba(123,63,242,.26), transparent 64%),
    radial-gradient(34% 34% at 16% 68%,  rgba(255,122,26,.24), transparent 64%),
    radial-gradient(38% 40% at 66% 92%,  rgba(255,46,136,.20), transparent 64%);
  filter:blur(30px) saturate(118%);
  animation:mesh 30s ease-in-out infinite alternate;
  will-change:transform;
}
@keyframes mesh{
  0%  {transform:translate3d(0,0,0) scale(1);}
  50% {transform:translate3d(-2.5%,1.5%,0) scale(1.06);}
  100%{transform:translate3d(2%,-2%,0) scale(1.03);}
}

/* faint worksheet grid — a nod to what YellowDoc outputs */
.bg-grid{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size:72px 72px;
  mask-image:radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image:radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}

.noise-overlay{
  position:fixed; inset:0; pointer-events:none; z-index:996;
  opacity:.03; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- SCROLL PROGRESS ---------- */
.scroll-progress{
  position:fixed; top:0; left:0; right:0; height:2px; z-index:200; pointer-events:none;
  background:rgba(255,255,255,.05);
}
.scroll-progress span{
  display:block; height:100%; width:0%;
  background:linear-gradient(90deg,var(--violet),var(--magenta),var(--orange));
  box-shadow:0 0 12px rgba(255,122,26,.6);
}

/* ---------- CURSOR ---------- */
.cursor-glow{
  position:fixed; top:0; left:0; width:440px; height:440px;
  border-radius:50%; pointer-events:none; z-index:995;
  background:radial-gradient(circle, rgba(255,122,26,.15), rgba(123,63,242,.11) 45%, transparent 70%);
  transform:translate(-50%,-50%);
  transition:opacity .3s ease;
  opacity:0; will-change:transform;
}
.cursor-glow.active{opacity:1;}
.cursor-dot{
  position:fixed; top:0; left:0; width:8px; height:8px; border-radius:50%;
  background:var(--orange); pointer-events:none; z-index:997;
  transform:translate(-50%,-50%);
  box-shadow:0 0 12px 2px rgba(255,122,26,.8);
  opacity:0;
  transition:opacity .3s ease, width .25s var(--ease), height .25s var(--ease), background .25s ease;
  will-change:transform;
}
.cursor-dot.active{opacity:1;}
.cursor-dot.pointer{width:20px; height:20px; background:rgba(255,122,26,.35);}
.cursor-dot.on-flood{background:var(--on-flood); box-shadow:0 0 12px 2px rgba(0,0,0,.45);}

/* ---------- TOPBAR ---------- */
.topbar{
  position:sticky; top:0; z-index:100;
  background:rgba(8,8,10,.78);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  max-width:1200px; margin:0 auto; padding:16px 32px;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
}
.brand{display:flex; align-items:center; gap:10px;}
.brand-mark{
  width:30px; height:30px; border-radius:9px;
  background:linear-gradient(135deg,var(--orange),var(--magenta) 55%,var(--violet));
  display:flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-weight:700; font-size:15px; color:#08080a;
  transition:transform .4s var(--ease-out);
}
.brand:hover .brand-mark{transform:rotate(-8deg) scale(1.08);}
.brand-name{font-family:var(--mono); font-weight:600; letter-spacing:.06em; font-size:14px;}

.nav-links{display:flex; gap:28px; font-size:14px; color:var(--text-dim);}
.nav-links a{position:relative; padding:2px 0;}
.nav-links a::after{
  content:''; position:absolute; left:0; bottom:-2px; height:1px; width:100%;
  background:var(--orange); transform:scaleX(0); transform-origin:left;
  transition:transform .35s var(--ease);
}
.nav-links a:hover{color:var(--text);}
.nav-links a:hover::after{transform:scaleX(1);}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 22px; border-radius:999px; font-size:14px; font-weight:600;
  font-family:var(--body);
  border:1px solid transparent; white-space:nowrap;
  transition:transform .3s var(--ease-out), box-shadow .3s var(--ease), border-color .3s ease, background .3s ease, color .3s ease;
}
/* Magnetic buttons get their transform from JS, so only the rest lift on hover */
.btn:not(.btn-magnet):hover{transform:translateY(-2px);}
.btn-primary{
  background:linear-gradient(135deg,var(--orange),#ff5c1a);
  color:#08080a;
  box-shadow:0 4px 18px rgba(255,122,26,.28);
}
.btn-primary:hover{box-shadow:0 8px 30px rgba(255,122,26,.45);}
.btn-ghost{border-color:var(--border-lit); color:var(--text);}
.btn-ghost:hover{border-color:var(--orange); background:rgba(255,122,26,.08);}
.btn-dark{background:#08080a; color:var(--text); border-color:transparent;}
.btn-dark:hover{background:#000;}
.btn-sm{padding:9px 18px; font-size:13px;}

.subbar{border-top:1px solid var(--border);}
.subbar-inner{
  max-width:1200px; margin:0 auto; padding:10px 32px;
  display:flex; align-items:center; gap:12px; font-size:13px;
}
.tag{
  font-family:var(--mono); font-size:11px; letter-spacing:.03em;
  padding:5px 12px; border-radius:999px;
  border:1px solid var(--border); color:var(--text-dim);
  transition:border-color .5s var(--ease), color .5s var(--ease), background .5s var(--ease);
}
.tag-active{border-color:var(--orange); color:var(--orange);}
.subbar-right{display:flex; align-items:center; gap:20px; margin-left:auto; color:var(--text-dim);}
.subbar-right a:hover{color:var(--text);}
.pill{
  border:1px solid var(--border); border-radius:999px;
  padding:5px 14px; color:var(--text);
  transition:border-color .3s ease, background .3s ease;
}
.pill:hover{border-color:var(--orange); background:rgba(255,122,26,.08);}

/* ---------- HERO ---------- */
.hero{
  position:relative; overflow:hidden;
  padding:96px 32px 0;
  border-bottom:1px solid var(--border);
}
.hero-glow{
  position:absolute; top:-240px; right:-180px;
  width:780px; height:780px; border-radius:50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(255,122,26,.5), transparent 60%),
    radial-gradient(circle at 62% 62%, rgba(123,63,242,.46), transparent 60%);
  filter:blur(64px);
  animation:drift 16s ease-in-out infinite;
  pointer-events:none;
}
@keyframes drift{
  0%,100%{transform:translate(0,0) scale(1);}
  50%{transform:translate(-26px,20px) scale(1.06);}
}
.hero-inner{
  max-width:1200px; margin:0 auto; position:relative; z-index:1;
  display:grid; grid-template-columns:1.2fr .8fr; gap:40px; align-items:center;
}
.eyebrow-row{display:flex; align-items:center; gap:12px; margin-bottom:20px; flex-wrap:wrap;}
/* min-width:0 keeps long words from forcing the grid column wider than its track */
.hero-copy{min-width:0;}
/* JS writes an inline transform on these; the hint keeps it off the main thread */
.btn-magnet{will-change:transform;}
.eyebrow{font-family:var(--mono); font-size:13px; color:var(--text-dim); letter-spacing:.04em;}
.badge{
  font-family:var(--mono); font-size:11px; padding:4px 10px; border-radius:999px;
  background:rgba(255,122,26,.12); color:var(--orange-dim);
  border:1px solid rgba(255,122,26,.3);
}
.badge::before{
  content:''; display:inline-block; width:5px; height:5px; border-radius:50%;
  background:var(--orange); margin-right:6px; vertical-align:middle;
  animation:pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{
  0%,100%{opacity:1; box-shadow:0 0 0 0 rgba(255,122,26,.6);}
  50%{opacity:.6; box-shadow:0 0 0 4px rgba(255,122,26,0);}
}

.hero h1{
  font-size:clamp(2.5rem,5.2vw,4.1rem);
  font-weight:800;
  line-height:1.06;
  margin-bottom:24px;
}
.hero h1 .line{display:block;}

/* the signature highlight */
.mark{
  position:relative; display:inline-block;
  color:var(--text);
  padding:0 .12em;
  z-index:0;
  transition:color .45s var(--ease) .35s;
}
.mark::before{
  content:''; position:absolute; inset:.06em 0 .1em;
  background:var(--flood); border-radius:3px;
  transform:scaleX(0); transform-origin:left center;
  z-index:-1;
}
.mark.mark-on{color:var(--on-flood);}
.mark.mark-on::before{
  animation:markWipe .68s var(--ease-out) forwards;
}
@keyframes markWipe{
  from{transform:scaleX(0);}
  to{transform:scaleX(1);}
}

.hero-sub{
  max-width:560px; color:var(--text-dim); font-size:17px; margin-bottom:32px;
}
.hero-actions{display:flex; gap:14px; flex-wrap:wrap; margin-bottom:22px;}
.hero-meta{font-family:var(--mono); font-size:13px; color:var(--text-faint);}
.hero-meta .dot{margin:0 8px;}

.hero-orb{position:relative; height:630px; display:flex; align-items:center; justify-content:center;}
.orb-photo{
  position:relative; z-index:2;
  width:444px; height:444px; border-radius:50%;
  overflow:hidden; background:var(--ink);
  border:2px solid rgba(255,122,26,.5);
  box-shadow:0 0 70px rgba(255,122,26,.3), 0 0 130px rgba(123,63,242,.22);
  animation:float 7s ease-in-out infinite;
}
@keyframes float{
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(-12px);}
}
.orb-photo img{width:100%; height:100%; object-fit:cover; object-position:center top;}
.orb-ring{
  position:absolute; width:555px; height:555px; border-radius:50%;
  border:1px solid rgba(255,122,26,.25); animation:spin 24s linear infinite;
}
.orb-ring-2{
  width:660px; height:660px;
  border:1px dashed rgba(123,63,242,.38); animation:spin 34s linear infinite reverse;
}
@keyframes spin{to{transform:rotate(360deg);}}

/* pipeline strip — the thesis of both projects, stated once */
.pipeline{
  max-width:1200px; margin:64px auto 0; padding:18px 0;
  border-top:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap;
  font-family:var(--mono); font-size:11px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--text-faint);
}
.pipe-step{transition:color .4s ease;}
.pipe-step:last-of-type{color:var(--orange);}
.pipe-arrow{color:var(--violet-soft); opacity:.7;}

/* ---------- SECTIONS ---------- */
.section{padding:96px 32px;}
.section-alt{
  /* No backdrop-filter here on purpose: blurring a full-height section over the
     fixed gradient is an expensive composite on every scroll frame. The tint
     alone reads the same. */
  background:rgba(14,14,18,.66);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}
.section-inner{max-width:1200px; margin:0 auto;}

.sec-head{margin-bottom:36px;}
.sec-eyebrow{
  display:inline-flex; align-items:center; gap:10px;
  font-family:var(--mono); font-size:11px; letter-spacing:.18em; text-transform:uppercase;
  color:var(--orange); margin-bottom:14px;
}
.sec-eyebrow::before{
  content:''; width:28px; height:1px; background:var(--orange);
}
.section h2{font-size:clamp(1.8rem,3vw,2.5rem);}
.sec-note{
  margin-top:12px; font-family:var(--mono); font-size:12px; color:var(--text-faint);
  letter-spacing:.04em;
}

/* Banner */
.banner{
  border:1px solid var(--border); border-radius:18px;
  padding:22px 26px; margin-bottom:28px;
  display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap;
  background:linear-gradient(120deg, rgba(255,122,26,.09), rgba(123,63,242,.07));
}
.banner-left{display:flex; flex-direction:column; gap:6px;}
.banner-label{
  font-family:var(--mono); font-size:11px; color:var(--orange);
  letter-spacing:.14em; text-transform:uppercase;
}
.banner-text{color:var(--text-dim); font-size:15px; max-width:580px;}
.banner-tags{display:flex; gap:10px; flex-wrap:wrap;}

.edu-grid{display:grid; grid-template-columns:1fr 1fr; gap:20px;}
.edu-card{
  border:1px solid var(--border); border-radius:18px; padding:26px;
  background:var(--surface);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  transition:border-color .35s ease, background .35s ease, box-shadow .35s var(--ease);
}
.edu-card:hover{
  border-color:rgba(255,122,26,.5);
  background:var(--surface-lift);
  box-shadow:0 14px 40px rgba(0,0,0,.4);
}
.edu-eyebrow{font-family:var(--mono); font-size:12px; color:var(--text-faint);}
.edu-card h3{font-size:19px; margin:10px 0 6px; font-weight:700;}
.edu-card p{color:var(--text-dim); font-size:14px; margin-bottom:16px;}
.edu-stat{
  display:inline-block;
  font-family:var(--mono); font-size:13px; color:var(--orange);
  border:1px solid rgba(255,122,26,.35); border-radius:999px; padding:4px 12px;
}

/* Skills */
.skill-toolbar{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px;
  color:var(--text-dim); font-size:14px; margin-bottom:24px;
  border:1px solid var(--border); border-radius:999px; padding:13px 24px;
  background:rgba(255,122,26,.05);
}
.skill-toolbar-tags{display:flex; gap:10px;}

.skill-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:18px;}
.skill-block{
  border:1px solid rgba(255,122,26,.55); border-radius:16px; padding:20px;
  background:rgba(255,122,26,.04);
  transition:border-color .35s ease, box-shadow .35s var(--ease);
}
.skill-block:hover{
  border-color:var(--orange);
  box-shadow:0 0 0 1px rgba(255,122,26,.25), 0 18px 44px rgba(0,0,0,.36);
}
.skill-block-title{
  display:block; font-family:var(--display); font-size:14px; font-weight:700;
  color:var(--orange-dim); margin-bottom:14px; letter-spacing:-.01em;
}
.skill-cells{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.cell{
  background:rgba(0,0,0,.55); border:1px solid rgba(255,255,255,.07); border-radius:11px;
  padding:14px 10px; text-align:center; font-size:12.5px; color:var(--orange-dim);
  font-family:var(--mono);
  transition:border-color .3s ease, transform .3s var(--ease-out), color .3s ease, background .3s ease;
}
.cell:hover{
  border-color:var(--orange); color:var(--orange);
  background:rgba(255,122,26,.1);
  transform:translateY(-3px);
}

.promo-banner{
  margin-top:32px; border-radius:16px; padding:22px 28px;
  background:linear-gradient(90deg,var(--orange),var(--magenta) 55%,var(--violet));
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px;
}
.promo-title{font-family:var(--display); font-weight:700; color:#08080a; font-size:16px;}

/* Experience */
.timeline{display:flex; flex-direction:column; gap:22px;}
.timeline-item{display:grid; grid-template-columns:180px 1fr; gap:24px;}
.timeline-date{
  font-family:var(--mono); font-size:13px; color:var(--text-faint); padding-top:24px;
}
.timeline-card{
  border:1px solid var(--border); border-radius:18px; padding:26px;
  background:var(--surface);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border-left:3px solid var(--orange);
  transition:border-color .35s ease, background .35s ease, transform .35s var(--ease-out);
}
.timeline-card:hover{background:var(--surface-lift); transform:translateX(4px);}
.timeline-card h3{font-size:19px; margin-bottom:5px;}
.timeline-org{font-size:13px; color:var(--orange-dim); font-family:var(--mono);}
.timeline-card ul{margin-top:14px; display:flex; flex-direction:column; gap:9px;}
.timeline-card li{
  font-size:14.5px; color:var(--text-dim); padding-left:17px; position:relative;
}
.timeline-card li::before{
  content:''; position:absolute; left:0; top:9px; width:5px; height:5px; border-radius:50%;
  background:var(--orange);
}

/* ============================================================
   PROJECTS — the signature interaction
   .project      = reveal wrapper (owns the scroll transform)
   .project-card = hover target  (owns the hover transform)
   Keeping these on separate elements stops the two transforms
   from cancelling each other out.
   ============================================================ */
.project{margin-bottom:26px;}
.project:last-child{margin-bottom:0;}

.project-card{
  position:relative; isolation:isolate; overflow:hidden;
  border:1px solid var(--border); border-radius:22px; padding:32px;
  background:var(--surface);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:34px; align-items:start;
  transition:transform .55s var(--ease-out), box-shadow .55s var(--ease), border-color .45s ease;
  will-change:transform;
}
.project-card:hover,
.project-card:focus-within{
  transform:scale(1.022);
  border-color:var(--flood);
  box-shadow:0 26px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(255,148,64,.5), 0 0 90px rgba(255,148,64,.2);
}

/* the flood — wipes left to right, same gesture as the headline mark.
   Explicit z-index on both flood and content instead of relying on
   negative-z paint order, which is unreliable under backdrop-filter. */
.pc-flood{
  position:absolute; inset:0; z-index:0;
  background:var(--flood);
  transform:scaleX(0); transform-origin:left center;
  transition:transform .6s var(--ease-out);
}
.project-card:hover .pc-flood,
.project-card:focus-within .pc-flood{transform:scaleX(1);}

.pc-body{position:relative; z-index:1; min-width:0;}
.project-head{margin-bottom:16px;}
.project-head h3{
  font-size:22px; max-width:640px; margin-bottom:8px;
  transition:color .5s var(--ease);
}
.project-head h3 a{
  background-image:linear-gradient(currentColor,currentColor);
  background-size:0% 1px; background-repeat:no-repeat; background-position:left 92%;
  transition:background-size .4s var(--ease);
}
.project-head h3 a:hover{background-size:100% 1px;}
.pc-kicker{
  display:block; font-family:var(--mono); font-size:11.5px; letter-spacing:.06em;
  color:var(--text-faint);
  transition:color .5s var(--ease);
}

.project-stack{
  display:flex; gap:8px; flex-wrap:wrap;
  padding-bottom:18px; margin-bottom:18px;
  border-bottom:1px solid var(--border);
  transition:border-color .5s var(--ease);
}
.project-list{display:flex; flex-direction:column; gap:11px;}
.project-list li{
  font-size:14.5px; color:var(--text-dim); padding-left:19px; position:relative;
  transition:color .5s var(--ease);
}
.project-list li::before{
  content:'→'; position:absolute; left:0; top:0; color:var(--orange); font-family:var(--mono);
  transition:color .5s var(--ease);
}

.pc-actions{display:flex; gap:16px; flex-wrap:wrap; margin-top:22px;}
.pc-link{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--mono); font-size:12.5px; letter-spacing:.04em;
  padding:9px 16px; border-radius:999px;
  border:1px solid var(--border-lit); color:var(--text);
  transition:border-color .35s ease, background .35s ease, color .5s var(--ease), transform .35s var(--ease-out);
}
.pc-link-strong{border-color:var(--orange); color:var(--orange); background:rgba(255,122,26,.1);}
.pc-link:hover{transform:translateY(-2px);}
.pc-link-arrow{display:inline-block; transition:transform .35s var(--ease-out);}
.pc-link:hover .pc-link-arrow{transform:translateX(4px);}

/* the two screenshots — a deck at rest, fanned open on hover */
.pc-shots{position:relative; z-index:1; min-height:310px;}
.pc-shot{
  position:absolute; left:0; width:100%;
  aspect-ratio:16/10; overflow:hidden;
  border-radius:12px; border:1px solid rgba(255,255,255,.14);
  background:var(--ink-2);
  box-shadow:0 12px 34px rgba(0,0,0,.45);
  transition:
    transform .62s var(--ease-out),
    opacity .5s var(--ease),
    filter .5s var(--ease),
    border-color .5s var(--ease),
    box-shadow .5s var(--ease);
  will-change:transform,opacity;
}
.pc-shot img{width:100%; height:100%; object-fit:cover; object-position:top left;}

.pc-shot-a{top:0; z-index:1; transform:translate3d(6%,4%,0) rotate(-4.5deg) scale(.88); opacity:.26; filter:grayscale(.6) blur(1.5px);}
.pc-shot-b{top:26%; z-index:2; transform:translate3d(-5%,-6%,0) rotate(3.5deg) scale(.84); opacity:.2; filter:grayscale(.6) blur(1.5px);}

.project-card:hover .pc-shot-a,
.project-card:focus-within .pc-shot-a{
  transform:translate3d(0,-2%,0) rotate(-3deg) scale(1);
  opacity:1; filter:none;
  border-color:rgba(23,10,2,.5);
  box-shadow:0 18px 44px rgba(23,10,2,.42);
}
.project-card:hover .pc-shot-b,
.project-card:focus-within .pc-shot-b{
  transform:translate3d(0,6%,0) rotate(2.5deg) scale(1);
  opacity:1; filter:none;
  transition-delay:.07s;
  border-color:rgba(23,10,2,.5);
  box-shadow:0 18px 44px rgba(23,10,2,.42);
}

/* flooded state — every colour flips to readable dark ink */
.project-card:hover .project-head h3,
.project-card:focus-within .project-head h3{color:var(--on-flood);}
.project-card:hover .pc-kicker,
.project-card:focus-within .pc-kicker{color:var(--on-flood-dim);}
.project-card:hover .project-list li,
.project-card:focus-within .project-list li{color:var(--on-flood);}
.project-card:hover .project-list li::before,
.project-card:focus-within .project-list li::before{color:var(--on-flood-dim);}
.project-card:hover .project-stack,
.project-card:focus-within .project-stack{border-bottom-color:rgba(23,10,2,.28);}
.project-card:hover .tag,
.project-card:focus-within .tag{
  border-color:rgba(23,10,2,.4); color:var(--on-flood); background:rgba(23,10,2,.07);
}
.project-card:hover code,
.project-card:focus-within code{
  background:rgba(23,10,2,.12); color:var(--on-flood); border-color:rgba(23,10,2,.3);
}
.project-card:hover .pc-link,
.project-card:focus-within .pc-link{
  border-color:rgba(23,10,2,.45); color:var(--on-flood); background:rgba(23,10,2,.06);
}
.project-card:hover .pc-link:hover,
.project-card:focus-within .pc-link:hover{background:var(--on-flood); color:var(--flood);}

/* Achievements */
.ach-grid{display:grid; grid-template-columns:1fr 1fr; gap:20px;}
.ach-card{
  border:1px solid var(--border); border-radius:18px; padding:28px;
  background:var(--surface);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  transition:border-color .35s ease, transform .35s var(--ease-out), box-shadow .35s var(--ease);
}
.ach-card:hover{
  border-color:var(--violet-soft); transform:translateY(-4px);
  box-shadow:0 18px 46px rgba(0,0,0,.4);
}
.ach-icon{font-size:28px; display:block; margin-bottom:12px;}
.ach-card h3{font-size:18px; margin-bottom:6px;}
.ach-card p{color:var(--text-dim); font-size:14px;}

/* Footer */
.footer{padding:110px 32px 40px; text-align:center; position:relative; overflow:hidden;}
.footer::before{
  content:''; position:absolute; bottom:-180px; left:50%; transform:translateX(-50%);
  width:700px; height:360px; border-radius:50%;
  background:radial-gradient(circle, rgba(123,63,242,.4), rgba(255,46,136,.16) 55%, transparent 72%);
  filter:blur(54px); pointer-events:none;
}
.footer-inner{max-width:680px; margin:0 auto; position:relative; z-index:1;}
.footer h2{font-size:clamp(1.9rem,3.4vw,2.7rem); margin-bottom:14px;}
.footer p{color:var(--text-dim); margin-bottom:30px;}
.footer-actions{display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-bottom:36px;}
.footer-links{
  display:flex; gap:24px; justify-content:center; margin-bottom:40px;
  font-size:14px; color:var(--text-dim);
}
.footer-links a{position:relative;}
.footer-links a:hover{color:var(--orange);}
.footer-base{
  border-top:1px solid var(--border); padding-top:20px;
  display:flex; justify-content:space-between; font-family:var(--mono);
  font-size:12px; color:var(--text-faint);
}

/* ---------- SCROLL REVEAL ---------- */
.paper{
  transition:opacity .7s var(--ease) calc(var(--i,0) * .08s),
             transform .7s var(--ease) calc(var(--i,0) * .08s);
  transform-origin:center top;
  will-change:transform,opacity;
}
.paper.paper-hidden-down{opacity:0; transform:translateY(42px) scale(.98);}
.paper.paper-hidden-up{opacity:0; transform:translateY(-42px) scale(.98);}
.paper.paper-visible{opacity:1; transform:translateY(0) scale(1);}

/* ---------- HERO LOAD SEQUENCE ---------- */
/* Hidden state is scoped to .js (set by an inline script in <head>) so the
   hero is never blank if JavaScript fails to run. */
.js .reveal-up,.js .reveal-line{opacity:0;}
.loaded .reveal-up{animation:revealUp .8s var(--ease-out) var(--d,0s) forwards;}
@keyframes revealUp{
  from{opacity:0; transform:translateY(22px);}
  to{opacity:1; transform:translateY(0);}
}
.reveal-line{
  display:block;
}
.js .reveal-line{clip-path:inset(0 0 100% 0);}
.loaded .reveal-line{animation:revealLine .9s var(--ease-out) var(--d,0s) forwards;}
@keyframes revealLine{
  from{opacity:0; transform:translateY(.5em); clip-path:inset(0 0 100% 0);}
  to{opacity:1; transform:translateY(0); clip-path:inset(0 0 -10% 0);}
}

/* ---------- RESPONSIVE ---------- */
/* Below the two-column breakpoint the shots span the full card width, so the
   absolute-positioned deck would overflow its fixed-height container and get
   clipped. They become a plain static grid instead.
   The :hover / :focus-within selectors are repeated here on purpose — without
   them these overrides would lose on specificity to the fan-out rules above. */
@media (max-width:1040px){
  .project-card{grid-template-columns:1fr; gap:26px;}
  .pc-shots{
    min-height:0; order:-1;
    display:grid; grid-template-columns:1fr 1fr; gap:12px;
  }
  .project-card .pc-shot-a,
  .project-card .pc-shot-b,
  .project-card:hover .pc-shot-a,
  .project-card:hover .pc-shot-b,
  .project-card:focus-within .pc-shot-a,
  .project-card:focus-within .pc-shot-b{
    position:static; top:auto; transform:none;
    opacity:1; filter:none;
    transition-delay:0s;
  }
}
@media (max-width:900px){
  .hero{padding-top:72px;}
  .hero-inner{grid-template-columns:1fr;}
  .hero-orb{height:250px; order:-1;}
  .skill-grid{grid-template-columns:1fr 1fr;}
  .edu-grid,.ach-grid{grid-template-columns:1fr;}
  .nav-links{display:none;}
  .section{padding:72px 24px;}
  .topbar-inner,.subbar-inner{padding-left:24px; padding-right:24px;}
  .hero{padding-left:24px; padding-right:24px;}
}
@media (max-width:640px){
  .pc-shots{grid-template-columns:1fr;}
}
@media (max-width:600px){
  .skill-grid{grid-template-columns:1fr;}
  .timeline-item{grid-template-columns:1fr;}
  .timeline-date{padding-top:0;}
  .subbar-inner{overflow-x:auto;}
  .footer-base{flex-direction:column; gap:6px; text-align:center;}
  .project-card{padding:24px;}
  .pipeline{gap:8px; font-size:10px;}
}

/* No hover on touch, so the screenshots are shown plainly and permanently.
   Same specificity note as above: the hover selectors must be repeated. */
@media (hover:none),(pointer:coarse){
  .pc-shots{
    min-height:0;
    display:grid; grid-template-columns:1fr 1fr; gap:12px;
  }
  .project-card .pc-shot-a,
  .project-card .pc-shot-b,
  .project-card:hover .pc-shot-a,
  .project-card:hover .pc-shot-b,
  .project-card:focus-within .pc-shot-a,
  .project-card:focus-within .pc-shot-b{
    position:static; top:auto; transform:none;
    opacity:1; filter:none;
    transition-delay:0s;
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  .bg-mesh,.hero-glow,.orb-ring,.orb-ring-2,.orb-photo,.badge::before{animation:none;}
  .paper{transition:none;}
  .paper.paper-hidden-down,.paper.paper-hidden-up{opacity:1; transform:none;}
  .reveal-up,.reveal-line{opacity:1; clip-path:none;}
  .js .reveal-up,.js .reveal-line{opacity:1; clip-path:none;}
  .loaded .reveal-up,.loaded .reveal-line{animation:none;}
  .mark{color:var(--on-flood);}
  .mark::before{transform:scaleX(1); animation:none;}
  .project-card,.pc-flood,.pc-shot{transition-duration:.001s;}
}
