/* =========================================================
   Mariam Omar - portfolio
   Dark, AI/terminal aesthetic. Bold name hero, scroll-driven
   section animations, magnetic "try it out" cards.
   Palette: 000000, 656565, D5D5D5, C0FF6B (+ cyan, magenta, amber)
   ========================================================= */

:root {
  --bg: #000000;
  --bg-2: #070707;
  --surface: rgba(213, 213, 213, 0.04);
  --surface-solid: #0b0b0b;
  --border: rgba(213, 213, 213, 0.14);
  --border-strong: rgba(192, 255, 107, 0.45);

  --ink: #D5D5D5;
  --muted: #9a9a9a;
  --faint: #656565;

  --accent: #C0FF6B;
  --accent-dim: #9be84f;
  --accent-ink: #0c1500;
  --accent-2: #D5D5D5;
  --good: #C0FF6B;
  --sk: #cdd2db;

  --cyan: #38e8ff;
  --magenta: #ff6bc1;
  --amber: #ffc46b;

  --grad: linear-gradient(120deg, #C0FF6B, #9be84f);
  --grad-multi: linear-gradient(90deg, #C0FF6B, #38e8ff 40%, #ff6bc1 70%, #ffc46b);

  --key-face: #141414;
  --ease: cubic-bezier(.16, .84, .3, 1);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  --maxw: 1280px;

  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: radial-gradient(1100px 700px at 82% -10%, rgba(192,255,107,.06), transparent 60%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(95px); opacity: .12; }
.orb-1 { width: 520px; height: 520px; background: var(--accent); top: -140px; right: -60px; animation: drift1 26s ease-in-out infinite; }
.orb-2 { width: 460px; height: 460px; background: var(--cyan); bottom: -160px; left: -90px; animation: drift2 31s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-44px, 60px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(54px, -44px); } }
.grid-overlay { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(213,213,213,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(213,213,213,.03) 1px, transparent 1px);
  background-size: 50px 50px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px; min-height: 76px;
  padding: 17px clamp(20px, 4vw, 60px);
  background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; transition: color .2s, background .2s; padding: 8px 12px; border-radius: 6px; }
.nav-links a::before { content: "/"; color: var(--faint); margin-right: 2px; }
.nav-links a:hover { color: var(--accent); background: rgba(192,255,107,.08); }
.nav-cta { margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---------- Buttons (keyboard keys) ---------- */
.btn {
  font-family: var(--font-mono); font-weight: 600; font-size: 13.5px;
  border-radius: 8px; padding: 10px 16px; cursor: pointer;
  color: var(--ink); background: var(--key-face);
  border: 1px solid #2b2b2b; border-bottom-color: #000;
  box-shadow: 0 3px 0 #050505, inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .08s ease, box-shadow .12s ease, color .15s, border-color .15s, background .15s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover { color: var(--accent); border-color: var(--border-strong); box-shadow: 0 3px 0 #050505, 0 0 16px rgba(192,255,107,.16); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 #050505, inset 0 1px 0 rgba(255,255,255,.05); }
.btn-primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent-dim); border-bottom-color: #5f8a2c; box-shadow: 0 3px 0 #5f8a2c, inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { color: var(--accent-ink); background: #cfff85; box-shadow: 0 3px 0 #5f8a2c, 0 0 22px rgba(192,255,107,.4); }
.btn-primary:active { box-shadow: 0 0 0 #5f8a2c; }
.btn-ghost { background: var(--key-face); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; box-shadow: 0 2px 0 #050505; }
.btn-sm:active { transform: translateY(2px); box-shadow: 0 0 0; }
.btn-block { width: 100%; }

/* magnetic "try it out" button: gradient fill, glow pulse, shimmer sweep */
.btn-try {
  position: relative; overflow: hidden; color: var(--accent-ink);
  background: linear-gradient(120deg, var(--accent), var(--cyan));
  border: 1px solid transparent; border-bottom: 3px solid #2c6b6b;
  box-shadow: 0 3px 0 #2c6b6b, 0 0 16px rgba(56,232,255,.25);
  animation: tryPulse 2.6s ease-in-out infinite;
}
.btn-try .tri { font-size: 10px; line-height: 1; transform: translateY(0.5px); }
.btn-try::after {
  content: ""; position: absolute; top: 0; left: 0; width: 55%; height: 100%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-180%) skewX(-20deg); animation: shimmer 3.2s ease-in-out infinite;
}
.btn-try:hover { color: var(--accent-ink); transform: translateY(-2px) scale(1.05); filter: brightness(1.08); }
.btn-try:active { transform: translateY(2px) scale(1); box-shadow: 0 0 0 #2c6b6b; }
@keyframes tryPulse { 0%,100% { box-shadow: 0 3px 0 #2c6b6b, 0 0 12px rgba(56,232,255,.2); } 50% { box-shadow: 0 3px 0 #2c6b6b, 0 0 28px rgba(56,232,255,.55); } }
@keyframes shimmer { 0% { transform: translateX(-180%) skewX(-20deg); } 55%, 100% { transform: translateX(280%) skewX(-20deg); } }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px, 8vw, 110px) clamp(16px, 4vw, 56px) 0; }
#contact { padding-bottom: 48px; }
.section-title { font-weight: 700; font-size: clamp(28px, 4.4vw, 46px); margin: 0 0 30px; letter-spacing: -0.02em; }
.section-title::before { content: "> "; color: var(--accent); }
.section-title::after { content: "_"; color: var(--accent); margin-left: 6px; font-weight: 400; animation: caret 1s steps(1) infinite; }
.subhead { font-weight: 600; font-size: 21px; margin: 54px 0 22px; }
.subhead::before { content: "// "; color: var(--faint); }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Hero ---------- */
/* The hero is just a 1-screen spacer. The identity itself is a fixed element
   that travels from the centre of the screen to the top-left as you scroll.
   Sizes are interpolated through --p (0 at top, 1 when parked) so the text
   stays crisp, and name/role shrink independently (no squashed ratios). */
.hero { height: 82vh; position: relative; }
/* animated neural-network backdrop, concentrated toward the centre */
.hero-net {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 72% 66% at 50% 52%, #000 36%, transparent 84%);
  mask-image: radial-gradient(ellipse 72% 66% at 50% 52%, #000 36%, transparent 84%);
}
.hero-stage {
  position: fixed; top: 0; left: 0; z-index: 56; text-align: center; max-width: 88vw;
  opacity: 0; will-change: transform; transform: translate(var(--tx, 50px), var(--ty, 40vh));
  --name-big: clamp(58px, 12.5vw, 184px); --name-rest: 31px;
  --role-big: clamp(19px, 3.3vw, 40px); --role-rest: 15px;
}
.hero-stage.ready { opacity: 1; transition: opacity .8s ease; }
.hero-name {
  margin: 0; font-weight: 800; line-height: .9; letter-spacing: -0.045em;
  font-size: calc(var(--name-big) * (1 - var(--p, 0)) + var(--name-rest) * var(--p, 0));
  background: linear-gradient(100deg, #ffffff 0%, var(--accent) 54%, var(--cyan) 100%); background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* soft glow while the name is big, gone once it parks as the brand (tied to --p) */
  filter: drop-shadow(0 0 calc((1 - var(--p, 0)) * 26px) rgba(192, 255, 107, 0.22));
  animation: nameFlow 9s linear infinite;
}
.hero-role {
  /* gap shrinks from 16px to 4px as the identity parks, so the brand stays tight */
  margin: calc(16px * (1 - var(--p, 0)) + 4px * var(--p, 0)) 0 0;
  font-weight: 600; color: var(--accent); letter-spacing: -0.01em;
  font-size: calc(var(--role-big) * (1 - var(--p, 0)) + var(--role-rest) * var(--p, 0));
}
.hero-role::before { content: "> "; color: var(--accent); }
.hero-desc {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 30px;
  width: min(700px, 90vw); color: var(--muted); font-size: clamp(15px, 1.55vw, 19px); line-height: 1.75;
  opacity: clamp(0, calc(1 - var(--p, 0) * 2.4), 1);
}
@keyframes nameFlow { to { background-position: 220% center; } }

/* ---------- Scroll reveal: every section enters with its own creative motion ----------
   Defaults to a clean rise; variants give each section a distinct, smooth signature:
   titles wipe in like print, projects/contact tilt up in 3D, experience swings in from
   the left, certs flip in, skills spring-pop with overshoot, education/resume focus-in
   from blur. Stagger comes from --i; the animation is cleared on end so hover stays crisp. */
.reveal { opacity: 0; }
.reveal.in { animation: revUp .9s var(--ease) both; animation-delay: calc(min(var(--i, 0), 8) * 70ms); }
.reveal.r-left.in  { animation-name: revLeft; animation-duration: .95s; }
.reveal.r-right.in { animation-name: revRight; animation-duration: .9s; }
.reveal.r-scale.in { animation-name: revScale; animation-duration: .8s; animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
.reveal.r-blur.in  { animation-name: revBlur; animation-duration: 1.05s; }
.reveal.r-rise.in  { animation-name: revRise; animation-duration: 1s; animation-timing-function: cubic-bezier(.16, .9, .28, 1); }
.section-title.reveal.in { animation-name: revTitle; animation-duration: .9s; }
.reveal.revealed { animation: none !important; opacity: 1 !important; }
@keyframes revUp { from { opacity: 0; transform: translateY(46px); } to { opacity: 1; transform: none; } }
/* titles print in left-to-right behind a moving mask, then the caret blinks */
@keyframes revTitle {
  from { opacity: 0; clip-path: inset(0 100% -30% 0); transform: translateY(10px); }
  60%  { opacity: 1; }
  to   { opacity: 1; clip-path: inset(0 0 -30% 0); transform: none; }
}
/* experience / community swing in from the left with a slight 3D yaw */
@keyframes revLeft {
  from { opacity: 0; transform: perspective(1000px) translateX(-72px) rotateY(11deg); }
  to   { opacity: 1; transform: perspective(1000px) translateX(0) rotateY(0); }
}
/* certs flip in toward the viewer */
@keyframes revRight {
  from { opacity: 0; transform: perspective(1000px) translateX(58px) rotateY(-15deg); }
  to   { opacity: 1; transform: perspective(1000px) translateX(0) rotateY(0); }
}
/* skills spring-pop from a small dot (overshoot via the timing function above) */
@keyframes revScale {
  from { opacity: 0; transform: scale(.5) translateY(22px); }
  55%  { opacity: 1; }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
/* education / resume rack into focus from a soft blur */
@keyframes revBlur { from { opacity: 0; filter: blur(18px); transform: scale(1.06); } to { opacity: 1; filter: blur(0); transform: none; } }
/* projects / contact tilt up in 3D as if standing up off the page */
@keyframes revRise {
  from { opacity: 0; transform: perspective(1100px) rotateX(15deg) translateY(72px) scale(.96); }
  to   { opacity: 1; transform: perspective(1100px) rotateX(0) translateY(0) scale(1); }
}

/* ---------- Search ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; margin: 0 0 26px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; max-width: 640px; transition: border-color .2s, box-shadow .2s; }
.searchbar:focus-within { border-color: var(--border-strong); box-shadow: 0 0 20px rgba(192,255,107,.1); }
.search-prompt { color: var(--accent); font-weight: 700; }
.searchbar input { flex: 1; background: none; border: 0; outline: none; color: var(--ink); font-family: var(--font-mono); font-size: 14px; caret-color: var(--accent); }
.searchbar input::placeholder { color: var(--faint); }
.search-count { font-size: 12.5px; color: var(--accent); white-space: nowrap; }
.search-empty { color: var(--muted); font-size: 14px; margin: 6px 2px; }

/* ---------- Projects (hover-flip cards) ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.project-card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); perspective: 1800px; transition: box-shadow .3s; }
.project-card.flagship { grid-column: 1 / -1; }
.project-card:hover { box-shadow: var(--shadow), 0 0 30px rgba(56,232,255,.12); }

/* the inner layer flips on hover; flex:1 keeps cards in a row equal height */
.card3d { position: relative; flex: 1; transform-style: preserve-3d; transition: transform .6s var(--ease); }
.project-card:hover .card3d { transform: rotateY(180deg); }
.card-face { border-radius: var(--radius); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.card-front { position: relative; height: 100%; background: var(--surface); border: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 13px; overflow: hidden; }
.card-front::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0; transition: opacity .28s;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.project-card.flagship .card-front { background: linear-gradient(135deg, rgba(192,255,107,.06), rgba(213,213,213,.02)), var(--surface); }
.project-card.coming .card-front { border-style: dashed; }

/* no-flip cards stay static (no back face); they keep the classic hover lift */
.project-card.no-flip { transition: transform .28s var(--ease), box-shadow .3s; }
.project-card.no-flip .card-front { flex: 1; }
.project-card.no-flip:hover { transform: translateY(-5px); }

/* demo cards keep their inviting glow at rest on the front face */
.has-demo .card-front::before { background: linear-gradient(120deg, var(--accent), var(--cyan)); opacity: .38; animation: borderGlow 3.4s ease-in-out infinite; }
@keyframes borderGlow { 0%,100% { opacity: .22; } 50% { opacity: .55; } }

/* back face: a live miniature of the actual project UI */
.card-back { position: absolute; inset: 0; transform: rotateY(180deg); background: var(--surface-solid); border: 1px solid var(--border-strong); overflow: hidden; }
.card-thumb { position: absolute; inset: 0; overflow: hidden; background: var(--surface-solid); }
/* the iframe renders at (--tz x) the card size then scales down, so --tz is a zoom
   knob per project: smaller --tz means a narrower logical viewport = more zoomed in */
.thumb-frame { position: absolute; top: 0; left: 0; width: calc(100% * var(--tz, 3.2)); height: calc(100% * var(--tz, 3.2)); transform: scale(calc(1 / var(--tz, 3.2))); transform-origin: top left; border: 0; pointer-events: none; background: #fff; }
.thumb-video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.thumb-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.thumb-ph .thumb-mark { color: var(--accent); }
.thumb-ph-t { font-weight: 700; font-size: 16px; color: var(--ink); }
.thumb-ph-c { font-size: 12.5px; color: var(--faint); }

.pc-top { display: flex; align-items: center; gap: 12px; }
.pc-flag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 6px; }
.pc-flag.coming { color: var(--amber); background: rgba(255,196,107,.12); border: 1px solid rgba(255,196,107,.45); animation: softPulse 2s ease-in-out infinite; }
.pc-date { margin-left: auto; font-size: 12.5px; color: var(--faint); }
.pc-title { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 0; }
.pc-desc { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.65; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-stat { font-size: 12px; font-weight: 600; color: var(--cyan); background: rgba(56,232,255,.08); border: 1px solid rgba(56,232,255,.35); padding: 4px 10px; border-radius: 7px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pc-tag { font-size: 12px; color: var(--muted); background: rgba(213,213,213,.05); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; transition: color .2s, border-color .2s; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* front buttons fade out as the card turns; the same buttons fade back in on
   the back face in the same spot, over a scrim above the UI thumbnail */
.card-front .pc-actions { margin-top: auto; padding-top: 6px; transition: opacity .18s ease; }
.project-card:not(.no-flip):hover .card-front .pc-actions { opacity: 0; }
.card-back .pc-actions { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 15px 22px 18px;
  background: linear-gradient(to top, rgba(0,0,0,.92), rgba(0,0,0,.4) 65%, transparent); opacity: 0; transition: opacity .2s ease; }
.project-card:hover .card-back .pc-actions { opacity: 1; transition: opacity .3s ease .38s; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 4px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), rgba(56,232,255,.5)); }
.tl-item { position: relative; padding: 14px 0 22px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 20px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 10px var(--accent); animation: nodePulse 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .3s); }
@keyframes nodePulse { 0%,100% { box-shadow: 0 0 0 4px var(--bg), 0 0 6px var(--accent); } 50% { box-shadow: 0 0 0 4px var(--bg), 0 0 16px var(--accent); } }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tl-role { font-weight: 700; font-size: 17px; }
.tl-org { color: var(--accent); font-weight: 600; font-size: 14px; }
.tl-org::before { content: "@ "; color: var(--faint); }
.tl-date { margin-left: auto; font-size: 13px; color: var(--faint); }
.tl-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.tl-list li { margin-bottom: 5px; }
.tl-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; max-width: 880px; }

/* ---------- Skills: categorized groups ---------- */
.skills-wrap { display: grid; gap: 32px; }
.skill-group { --c: var(--accent); }
.sg-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.sg-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--c); color: var(--accent-ink); box-shadow: 0 0 20px -6px var(--c); }
.sg-ic .sk-svg { width: 19px; height: 19px; color: var(--accent-ink); }
.sg-title { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.sg-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--c), transparent); opacity: .4; }
.sg-count { font-size: 12px; font-weight: 600; color: var(--faint); }
.skill-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.logo-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 12px; min-height: 92px;
  transition: transform .2s var(--ease), border-color .2s, background .2s, box-shadow .25s;
}
.logo-tile:hover { transform: translateY(-4px); border-color: var(--c); background: rgba(213,213,213,.04); box-shadow: 0 12px 26px -14px var(--c); }
.logo-tile img, .logo-tile .sk-svg { width: 28px; height: 28px; color: var(--sk); transition: color .2s; }
.logo-tile .ln { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.2; }
.logo-tile:hover .ln { color: var(--ink); }
.logo-tile:hover .sk-svg { animation: floaty .9s ease-in-out infinite; color: var(--c); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
/* tighter, longer cascade just for skill tiles so each group ripples in like a wave */
.skill-tiles .logo-tile.in { animation-delay: calc(min(var(--i, 0), 14) * 45ms); }
.logo-fallback { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--accent-ink); font-weight: 700; font-size: 13px; background: var(--accent); }

/* ---------- Education ---------- */
.edu-wrap { display: grid; gap: 16px; }
.edu-card { position: relative; background: linear-gradient(135deg, rgba(192,255,107,.05), rgba(213,213,213,.02)), var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; overflow: hidden; }
.edu-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.edu-degree { font-weight: 700; font-size: 18px; margin: 0; }
.edu-school { color: var(--accent); font-weight: 600; font-size: 14px; margin: 6px 0 0; }
.edu-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.edu-meta span { font-size: 12.5px; color: var(--amber); background: rgba(255,196,107,.1); border: 1px solid rgba(255,196,107,.4); padding: 4px 10px; border-radius: 7px; }
.edu-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; line-height: 1.65; }
.edu-date { position: absolute; top: 22px; right: 22px; font-size: 12.5px; color: var(--faint); }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cert-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.cert-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 0 22px rgba(192,255,107,.1); }
.cert-card.upcoming { border-style: dashed; }
.cert-issuer { font-size: 12.5px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.cert-name { font-weight: 700; font-size: 16px; margin: 8px 0 0; line-height: 1.4; }
.cert-year { position: absolute; top: 18px; right: 18px; font-size: 12px; color: var(--faint); }
.cert-status { display: inline-block; margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 3px 10px; border-radius: 6px; }

/* ---------- Resume ---------- */
.resume-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.resume-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.resume-bar span { font-weight: 600; }
.resume-bar .btn { margin-left: auto; }
.cv-frame { width: 100%; height: 80vh; min-height: 540px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.resume-fallback { font-size: 13px; color: var(--faint); margin: 12px 2px 2px; }
.resume-fallback a { color: var(--accent); }

/* ---------- Contact ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.contact-card { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.contact-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 0 22px rgba(192,255,107,.1); }
.cc-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--accent-ink); background: var(--accent); margin-bottom: 8px; }
.cc-l { font-size: 12px; color: var(--faint); }
.cc-v { font-size: 13.5px; font-weight: 500; word-break: break-word; }

/* ---------- Footer ---------- */
.footer { max-width: var(--maxw); margin: 56px auto 0; padding: 26px clamp(16px, 4vw, 56px); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--faint); font-size: 13px; }
.footer-credit { display: inline-flex; align-items: center; gap: 8px; }
.footer-logo { height: 20px; width: auto; display: block; }
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { position: relative; z-index: 1; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-x { background: var(--key-face); border: 1px solid #2b2b2b; color: var(--ink); width: 34px; height: 34px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; transition: color .2s, border-color .2s; }
.modal-x:hover { color: var(--accent); border-color: var(--border-strong); }

.modal-card--form { width: min(560px, 100%); padding: 24px; max-height: 92vh; overflow: auto; }
.modal-card--form .modal-x { position: absolute; top: 16px; right: 16px; }
.ask-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.ask-logo { line-height: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.ask-head h3 { margin: 0; font-size: 19px; }
.ask-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ask-sub span { color: var(--accent); font-weight: 600; }
.ask-form { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
.field input, .field textarea { font-family: var(--font-mono); font-size: 14px; color: var(--ink); background: #000; border: 1px solid #2b2b2b; border-radius: 9px; padding: 11px 13px; resize: vertical; transition: border-color .2s; caret-color: var(--accent); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--border-strong); }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: 13.5px; margin: 4px 0 0; min-height: 18px; }
.form-note.ok { color: var(--accent); }
.form-note.err { color: #ff8b6b; }

.modal-card--demo, .modal-card--video { width: min(1100px, 100%); height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.demo-bar strong { font-size: 14px; }
.demo-spacer { flex: 1; }
.demo-frame-wrap { flex: 1; background: #0e1018; }
#demoFrame { width: 100%; height: 100%; border: 0; background: #fff; }
.modal-card--video video { width: 100%; height: 100%; flex: 1; background: #000; object-fit: contain; }

/* ---------- Scroll progress + scanlines ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--grad-multi); background-size: 220% 100%; box-shadow: 0 0 12px rgba(192,255,107,.5); animation: barFlow 6s linear infinite; }
@keyframes barFlow { to { background-position: 220% 0; } }
.scanlines { position: fixed; inset: 0; z-index: 45; pointer-events: none; opacity: .25; background: repeating-linear-gradient(rgba(213,213,213,.02) 0 1px, transparent 1px 3px); animation: scan 9s linear infinite; }
@keyframes scan { to { background-position: 0 9px; } }

/* gentle pulse for the coming-soon badge */
@keyframes softPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--accent); padding: 13px 20px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav.open .nav-links { display: flex; flex-direction: column; gap: 2px; position: absolute; top: 100%; left: 0; right: 0; background: rgba(0,0,0,.98); border-bottom: 1px solid var(--border); padding: 12px clamp(16px,4vw,40px) 16px; box-shadow: var(--shadow); }
  .nav.open .nav-links a { padding: 10px 0; font-size: 15px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav.open .nav-links a:last-child { border-bottom: 0; }
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .tl-date { margin-left: 0; width: 100%; }
  .edu-date { position: static; display: block; margin-top: 6px; }
  .hero-stage { --name-big: clamp(46px, 15.5vw, 112px); --role-big: clamp(17px, 4.6vw, 26px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1 !important; }
  .orb { display: none; }
  /* no card flip: keep the front face and its buttons */
  .project-card:hover .card3d { transform: none !important; }
  .card-back { display: none !important; }
  .project-card:hover .card-front .pc-actions { opacity: 1 !important; }
}

/* ---------- Theme toggle (top right, under the nav) ---------- */
.theme-toggle {
  position: fixed; top: 86px; right: clamp(16px, 4vw, 56px); z-index: 46;
  display: inline-flex; align-items: center; padding: 5px; cursor: pointer; min-height: 34px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0,0,0,.35); transition: border-color .2s, box-shadow .2s, background .3s;
}
.theme-toggle:hover { border-color: var(--border-strong); box-shadow: 0 8px 24px rgba(192,255,107,.18); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tt-track { position: relative; display: inline-flex; align-items: center; width: 52px; height: 24px; }
.tt-ic { position: absolute; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); z-index: 2; transition: color .2s; pointer-events: none; }
.tt-sun { left: 4px; }
.tt-moon { right: 4px; }
.tt-knob { position: absolute; top: 1px; left: 1px; width: 22px; height: 22px; border-radius: 50%; z-index: 1; background: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.4); transform: translateX(28px); transition: transform .28s var(--ease), background .3s; }
html[data-theme="light"] .tt-knob { transform: translateX(0); }
/* whichever icon sits under the knob gets the contrasting colour */
html:not([data-theme="light"]) .tt-moon { color: var(--accent-ink); }
html[data-theme="light"] .tt-sun { color: var(--accent-ink); }

/* ---------- Light theme ---------- */
html[data-theme="light"] {
  --bg: #f4f4ef;
  --bg-2: #eaeae4;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --border: rgba(20,20,12,0.14);
  --border-strong: rgba(95,138,44,0.55);

  --ink: #1b1b14;
  --muted: #565049;
  --faint: #8a8478;

  --accent: #4f7d1f;
  --accent-dim: #3f6417;
  --accent-ink: #ffffff;
  --accent-2: #1b1b14;
  --good: #4f7d1f;
  --sk: #4a4a42;

  --cyan: #0e7d92;
  --magenta: #b83d86;
  --amber: #8a6312;

  --key-face: #ffffff;
  --shadow: 0 24px 60px rgba(20,20,12,0.16);
}
html[data-theme="light"] .bg { background: radial-gradient(1100px 700px at 82% -10%, rgba(79,125,31,.08), transparent 60%), var(--bg); }
html[data-theme="light"] .orb { opacity: .08; }
html[data-theme="light"] .grid-overlay { background-image: linear-gradient(rgba(20,20,12,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(20,20,12,.04) 1px, transparent 1px); }
html[data-theme="light"] .nav { background: rgba(244,244,239,.82); }
html[data-theme="light"] .nav.open .nav-links { background: rgba(244,244,239,.98); }
html[data-theme="light"] .btn { color: var(--ink); border-color: rgba(20,20,12,.18); border-bottom-color: rgba(20,20,12,.30); box-shadow: 0 3px 0 rgba(20,20,12,.16), inset 0 1px 0 rgba(255,255,255,.6); }
html[data-theme="light"] .btn:hover { color: var(--accent); }
html[data-theme="light"] .btn:active { box-shadow: 0 0 0 rgba(20,20,12,.16), inset 0 1px 0 rgba(255,255,255,.6); }
html[data-theme="light"] .btn-primary { color: #fff; }
html[data-theme="light"] .btn-primary:hover { color: #fff; background: var(--accent-dim); }
html[data-theme="light"] .hero-name { background: linear-gradient(100deg, var(--ink) 0%, var(--accent) 55%, var(--cyan) 100%); -webkit-background-clip: text; background-clip: text; }
html[data-theme="light"] .field input, html[data-theme="light"] .field textarea { background: #fff; border-color: rgba(20,20,12,.2); color: var(--ink); }
html[data-theme="light"] .logo-tile img { filter: brightness(0) opacity(.66); }
html[data-theme="light"] .toast { box-shadow: var(--shadow); }
