/* =====================================================================
   Thristan Edrick De Lara · Portfolio
   ---------------------------------------------------------------------
   THEME COLORS: edit the two blocks below. The light theme is :root,
   the dark theme is [data-theme="dark"]. Every color on the site comes
   from these variables.
   ===================================================================== */

:root {
  /* Light theme */
  --bg: #f8fafc;
  --bg-tint: #f1f5f9;          /* alternating sections */
  --surface: #ffffff;          /* cards */
  --surface-2: #f1f5f9;        /* inner panels, chips */
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #5f6f86;      /* ≥ 4.5:1 on every light background */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2563eb;           /* blue: links, highlights */
  --accent-strong: #1d4ed8;
  --teal: #0f766e;             /* second accent (darker in light mode for text contrast) */
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.28);
  --secondary: #7c3aed;        /* faint violet tint, used only in glows */
  --grad: linear-gradient(90deg, #2563eb, #0f766e);               /* gradient text, underlines */
  --grad-v: linear-gradient(180deg, #2563eb, #14b8a6);            /* timeline line */
  --grad-btn: linear-gradient(110deg, #2563eb 0%, #0f766e 50%, #2563eb 100%);
  --on-accent: #ffffff;
  --logo-chip: #ffffff;        /* tile behind logos so dark logos stay visible in dark mode */
  --success: #15803d;
  --danger: #b91c1c;
  --glow-a: rgba(37, 99, 235, 0.10);
  --glow-b: rgba(20, 184, 166, 0.10);
  --canvas-rgb: 37, 99, 235;   /* hero network color */
  --canvas-alpha: 0.5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 18px 36px -18px rgba(15, 23, 42, 0.22), 0 6px 14px -6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 30px 60px -24px rgba(15, 23, 42, 0.3);
  --dots: rgba(15, 23, 42, 0.07);
  --img-dim: none;
  --card-bg: var(--surface);
  --card-border: 1px solid var(--border);

  /* Type, shape, spacing */
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --nav-h: 68px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  /* Dark theme */
  --bg: #0b1120;
  --bg-tint: #0e1628;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --border: #1f2a3d;
  --border-strong: #334155;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --teal: #2dd4bf;
  --accent-soft: rgba(96, 165, 250, 0.1);
  --accent-border: rgba(96, 165, 250, 0.32);
  --secondary: #a78bfa;
  --grad: linear-gradient(90deg, #60a5fa, #2dd4bf);
  --grad-v: linear-gradient(180deg, #60a5fa, #2dd4bf);
  --grad-btn: linear-gradient(110deg, #2563eb 0%, #0f766e 50%, #2563eb 100%);
  --on-accent: #ffffff;
  --logo-chip: #f1f5f9;
  --success: #4ade80;
  --danger: #f87171;
  --glow-a: rgba(96, 165, 250, 0.10);
  --glow-b: rgba(45, 212, 191, 0.08);
  --canvas-rgb: 96, 165, 250;
  --canvas-alpha: 0.55;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 36px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, 0.7);
  --dots: rgba(148, 163, 184, 0.09);
  --img-dim: brightness(0.92);
  /* thin gradient border on cards */
  --card-bg: linear-gradient(var(--surface), var(--surface)) padding-box,
             linear-gradient(140deg, rgba(96, 165, 250, 0.45), rgba(45, 212, 191, 0.18) 45%, rgba(148, 163, 184, 0.10)) border-box;
  --card-border: 1px solid transparent;

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) - 1px); }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  animation: pageIn 0.45s ease both;
}
@keyframes pageIn { from { opacity: 0; } }
body.modal-open { overflow: hidden; }
/* smooth color change only while the theme is switching */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, fill 0.35s ease, box-shadow 0.35s ease !important;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -0.02em; color: var(--text); text-wrap: balance; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 1000; padding: .6rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); border: 2px solid var(--accent); transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: none; }
.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.1em; height: 1.1em; flex: none; }
[data-icon] { display: inline-flex; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

/* ---------- Scroll progress ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto; z-index: 300; height: 3px; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; }

/* ---------- Buttons & links ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 .95rem/1.2 var(--font-body); white-space: nowrap;
  transition: background-position .5s var(--ease), border-color .2s, color .2s, box-shadow .25s, transform .2s var(--ease);
}
.btn .icon { width: 1.05em; height: 1.05em; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:hover .icon { transform: translateX(3px); }
.btn:active { transform: translateY(1px) scale(.98); transition-duration: .08s; }
.btn--primary {
  color: var(--on-accent); background: var(--grad-btn); background-size: 220% 100%; background-position: 0 0;
  box-shadow: 0 8px 20px -10px rgba(37, 99, 235, .65);
}
.btn--primary:hover { background-position: 100% 0; box-shadow: 0 12px 26px -10px rgba(15, 118, 110, .55), 0 6px 14px -8px rgba(37, 99, 235, .5); }
.btn--outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn--sm { padding: .5rem .85rem; font-size: .875rem; }
.btn--lg { padding: .85rem 1.4rem; font-size: 1rem; }
.btn--block { width: 100%; }


.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm);
  color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
  transition: color .2s, border-color .2s, background-color .2s, transform .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-border); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 18px; height: 18px; }

/* small tile behind logos so dark logos stay visible in dark mode */
.logo-chip {
  --brand: var(--accent);
  display: inline-grid; place-items: center; flex: none; background: var(--logo-chip);
  border: 1px solid var(--border); border-radius: 8px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.logo-chip img { width: 100%; height: 100%; object-fit: contain; }
.logo-chip--xs { width: 20px; height: 20px; padding: 3px; border-radius: 5px; }
.logo-chip--md { width: 40px; height: 40px; padding: 8px; border-radius: 10px; }
.logo-chip--lg { width: 52px; height: 52px; padding: 11px; border-radius: 12px; }
.logo-chip--pair { display: inline-flex; gap: 4px; width: auto; padding: 11px 10px; }
.logo-chip--pair img { width: 28px; height: 28px; }

.badge {
  display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border);
}

/* ---------- Navbar: transparent at the top, glass after scrolling ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h);
  border-bottom: 1px solid transparent; background: transparent;
  transition: background-color .35s, border-color .35s, box-shadow .35s, backdrop-filter .35s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(14px); backdrop-filter: saturate(170%) blur(14px);
  border-bottom-color: var(--border); box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
}
.nav__inner { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; margin-right: auto; font: 700 1.02rem/1 var(--font-head); color: var(--text); }
.brand__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad-btn); background-size: 220% 100%; color: #fff; font: 800 .85rem/1 var(--font-head); letter-spacing: .02em;
  transition: background-position .5s var(--ease);
}
.brand:hover .brand__mark { background-position: 100% 0; }
.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__link { position: relative; padding: .4rem 0; font-size: .95rem; font-weight: 500; color: var(--text-muted); transition: color .2s; }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__menu-theme { display: none; }
.nav__actions { display: flex; align-items: center; gap: .6rem; }
.nav__burger { display: none; }
.burger { position: relative; width: 18px; height: 12px; }
.burger i { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.burger i:nth-child(1) { top: 0; }
.burger i:nth-child(2) { top: 5px; }
.burger i:nth-child(3) { top: 10px; }
.nav.is-open .burger i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav.is-open .burger i:nth-child(2) { opacity: 0; }
.nav.is-open .burger i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* sun ↔ moon morph (light theme shows the moon, dark shows the sun) */
.theme-icon { display: inline-grid; }
.theme-svg { width: 20px; height: 20px; overflow: visible; }
.theme-svg .sun-core { transform-box: fill-box; transform-origin: center; transition: transform .55s var(--ease); }
.theme-svg .moon-cut { transition: transform .55s var(--ease); }
.theme-svg .sun-rays { transform-box: view-box; transform-origin: 12px 12px; transition: transform .55s var(--ease), opacity .3s; }
:root:not([data-theme="dark"]) .theme-svg .sun-core { transform: scale(1.7); }
:root:not([data-theme="dark"]) .theme-svg .moon-cut { transform: translate(-10px, 3px); }
:root:not([data-theme="dark"]) .theme-svg .sun-rays { transform: rotate(-90deg) scale(.4); opacity: 0; }

/* ---------- Reveal (soft, staggered) ---------- */
/* uses `translate` so it never fights the hover lift, which uses `transform` */
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity .7s var(--ease) var(--d, 0s), translate .7s var(--ease) var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; translate: none; }

/* ---------- Sections ---------- */
.section { position: relative; isolation: isolate; padding-block: clamp(72px, 9vw, 112px); overflow-x: clip; }
.section--tinted { background: var(--bg-tint); border-block: 1px solid var(--border); }
/* soft static color glows in the corners */
.section--glow-tr::before, .section--glow-bl::before {
  content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--glow-a), transparent 65%);
}
.section--glow-tr::before { top: -260px; right: -220px; }
.section--glow-bl::before { bottom: -280px; left: -240px; background: radial-gradient(circle, var(--glow-b), transparent 65%); }
.section__head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 48px); }
.eyebrow { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--grad); }
.eyebrow span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.section__title { font-size: clamp(1.85rem, 3.6vw, 2.6rem); font-weight: 800; }
.section__lead { margin-top: .8rem; color: var(--text-muted); font-size: 1.05rem; }

.card { background: var(--card-bg); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card, .js .card.reveal {
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s,
              opacity .7s var(--ease) var(--d, 0s), translate .7s var(--ease) var(--d, 0s);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; display: flex; align-items: center; overflow: clip;
  min-height: clamp(600px, 100svh, 900px); padding: calc(var(--nav-h) + clamp(24px, 5vw, 56px)) 0 clamp(88px, 10vw, 120px);
}
.hero::before { /* faint static dots: shown when the animated canvas is off */
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%);
}
.hero.has-canvas::before { display: none; }
.hero__canvas {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, #000 55%), linear-gradient(#000 70%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, #000 55%), linear-gradient(#000 70%, transparent);
  mask-composite: intersect;
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); align-items: center; gap: clamp(32px, 6vw, 80px); width: 100%; }

.js .hero-in { opacity: 0; animation: heroIn .8s var(--ease) var(--d, 0s) forwards; }
@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero__title { font-size: clamp(2.5rem, 5.8vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.hero__title .word { display: inline-block; }
.js .hero__title .word { opacity: 0; transform: translateY(.45em); animation: wordIn .8s var(--ease) calc(.15s + var(--i) * .1s) forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; } }
.hero__role { margin-top: 1rem; min-height: 1.6em; font-size: clamp(1rem, 1.9vw, 1.2rem); font-weight: 600; color: var(--text-muted); }
.hero__role .sep { margin: 0 .55rem; color: var(--text-subtle); font-weight: 400; }
.typed { color: var(--accent); }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -0.18em; border-radius: 2px; background: var(--teal); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { margin-top: 1.1rem; max-width: 600px; font-size: 1.1rem; color: var(--text-muted); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 2rem; }
.highlights {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2.5rem; max-width: 560px;
  border-top: 1px solid var(--border); padding-top: 1.4rem;
}
.highlights li { padding-inline: 1.25rem; border-left: 1px solid var(--border); }
.highlights li:first-child { padding-left: 0; border-left: 0; }
.highlights strong { display: block; font: 800 1.55rem/1.2 var(--font-head); letter-spacing: -.02em; }
.highlights span { display: block; margin-top: .2rem; font-size: .85rem; color: var(--text-subtle); }

.hero__media { position: relative; justify-self: end; width: 100%; max-width: 400px; }
.photo-glow {
  position: absolute; inset: -10%; z-index: -1; border-radius: 42%; opacity: .55; pointer-events: none;
  background: conic-gradient(from 0deg, #2563eb, #14b8a6, #7c3aed, #3b82f6, #2563eb);
  filter: blur(46px); animation: glowSpin 16s linear infinite; will-change: transform;
}
[data-theme="dark"] .photo-glow { opacity: .45; }
@keyframes glowSpin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.08); } 100% { transform: rotate(360deg) scale(1); } }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent); background: var(--surface-2); box-shadow: var(--shadow-lg);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
/* photo crop: values come from profile.photoCrop in js/data.js */
.js-photo { object-position: var(--px, 50%) var(--py, 50%); scale: var(--zoom, 1); transform-origin: var(--px, 50%) var(--py, 50%); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: .4rem;
  translate: -50% 0; color: var(--text-subtle); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.js .scroll-cue { opacity: 0; animation: heroIn .8s var(--ease) 1.6s forwards; }
.scroll-cue__mouse { position: relative; width: 22px; height: 34px; border: 2px solid var(--border-strong); border-radius: 12px; transition: border-color .2s; }
.scroll-cue__mouse span { position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--grad-v); animation: wheel 1.8s var(--ease) infinite; }
.scroll-cue:hover .scroll-cue__mouse { border-color: var(--accent); }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-2px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(11px); } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.about__bio p { color: var(--text-muted); font-size: 1.05rem; }
.about__bio p + p { margin-top: 1.1rem; }
.about__bio p:first-child { color: var(--text); font-size: 1.15rem; }
.about__facts { padding: .5rem 1.4rem; }
.fact { display: flex; align-items: center; gap: .9rem; padding: 1rem 0; }
.fact + .fact { border-top: 1px solid var(--border); }
.fact__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.fact dt { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }
.fact dd { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

/* ---------- Projects: bento grid ---------- */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.project { position: relative; display: flex; flex-direction: column; overflow: hidden; }
/* featured: full-width tile, phone showcase on the left, details on the right */
.project--featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.project--featured .project__media { display: flex; border-bottom: 0; border-right: 1px solid var(--border); }
/* a lone last tile spans the row: screenshot on the left, details on the right */
.project--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.project--wide .project__media { border-bottom: 0; border-right: 1px solid var(--border); }
.project--wide .pmedia--desktop { aspect-ratio: auto; height: 100%; min-height: 300px; }
.project--wide .project__body { justify-content: center; }
.project--wide .project__actions { margin-top: 0; }
/* small colored project icon (e.g. the leaf on Plant Disease Detection) */
.project-icon {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none;
  color: #fff; background: var(--pc); box-shadow: 0 6px 14px -6px var(--pc);
}
.project-icon .icon { width: 15px; height: 15px; }
.project--featured .pmedia--phones { flex: 1; min-height: 440px; }
.project--featured .phone { width: 29%; max-width: 170px; }
.project--featured .phone--main { width: 38%; max-width: 225px; }
.project--featured .project__body { justify-content: center; }
.project--featured .project__actions { margin-top: 0; }
.project:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
/* spotlight that follows the mouse (desktop only, see main.js) */
.has-spot .project::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%);
  transition: opacity .35s;
}
.has-spot .project:hover::after { opacity: 1; }
.project__media { position: relative; display: block; width: 100%; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); cursor: pointer; }
.media-cta {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600; color: #fff;
  background: rgba(15, 23, 42, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.media-cta .icon { width: 1em; height: 1em; transition: transform .3s var(--ease); }
.project:hover .media-cta { opacity: 1; transform: none; }
.project:hover .media-cta .icon { transform: translateX(3px); }
.pmedia--desktop { aspect-ratio: 16 / 9; }
.pmedia--desktop img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: var(--img-dim); transition: transform 1.6s var(--ease); }
.project:hover .pmedia--desktop img { transform: scale(1.07) translateY(-2%); }
.pmedia--phones {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 1.6vw, 18px); height: 100%; min-height: 360px;
  padding: clamp(24px, 3.5vw, 44px) clamp(14px, 3vw, 32px) 0;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, #14b8a6 14%, transparent), transparent 60%),
    linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--secondary) 9%, transparent)), var(--surface-2);
}
.phone {
  position: relative; width: 28%; max-width: 160px; border-radius: 18px 18px 0 0; overflow: hidden;
  border: 3px solid #0f172a; border-bottom: 0; box-shadow: var(--shadow-md); transform: translateY(14px);
  transition: transform .7s var(--ease);
}
.phone img { width: 100%; }
.phone--main { width: 37%; max-width: 220px; z-index: 1; transform: none; box-shadow: 0 24px 50px -18px rgba(15, 23, 42, .55); }
.project:hover .phone { transform: translateY(6px); }
.project:hover .phone--main { transform: translateY(-8px); }
.project--featured .project__body { padding: clamp(1.5rem, 3vw, 2.25rem); }
.project--featured .project__title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.project--featured .project__desc { font-size: 1.05rem; }
.featured-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 700; color: var(--accent); }

/* animated detection overlay on the CrabLens live screenshot */
.scan { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scan__sweep { transform-box: view-box; animation: sweep 2.6s cubic-bezier(.45, 0, .55, 1) infinite; }
.scan__box { stroke-dasharray: 100; stroke-dashoffset: 100; animation: drawBox 6s var(--ease) infinite; }
.scan__label { opacity: 0; transform-box: view-box; animation: labelIn 6s var(--ease) infinite; }
.scan__corner { opacity: 0; animation: labelIn 6s var(--ease) infinite; }
@keyframes sweep { from { transform: translateY(var(--y0)); } to { transform: translateY(var(--y1)); } }
@keyframes drawBox { 0%, 6% { stroke-dashoffset: 100; opacity: 1; } 30%, 86% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes labelIn { 0%, 28% { opacity: 0; transform: translateY(10px); } 36%, 86% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }

.project__body { position: relative; display: flex; flex-direction: column; flex: 1; padding: 1.35rem 1.5rem 1.5rem; }
.project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: .85rem; font-weight: 500; color: var(--text-subtle); }
.project__title { margin-top: .5rem; font-size: 1.35rem; font-weight: 800; }
.project__desc { margin-top: .5rem; color: var(--text-muted); }
.techs { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.1rem; }
.tech {
  display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem .25rem .3rem; border-radius: 8px;
  font-size: .8rem; font-weight: 500; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border);
}
.tech:not(:has(.logo-chip)) { padding-left: .6rem; }
.project__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: 1.4rem; }

/* ---------- Skills ---------- */
.marquee {
  overflow: hidden; margin: 0 auto 2.75rem; max-width: 1240px; padding-block: .35rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; gap: 1rem; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee__item {
  display: inline-flex; align-items: center; gap: .6rem; padding: .5rem 1rem .5rem .55rem; border-radius: 999px;
  background: var(--card-bg); border: var(--card-border); box-shadow: var(--shadow-sm); font-weight: 600; font-size: .92rem; color: var(--text); white-space: nowrap;
}
.marquee__item .logo-chip { width: 30px; height: 30px; padding: 5px; border-radius: 50%; }
.skills { display: grid; gap: 2.5rem; }
.skills__group-title { margin-bottom: 1rem; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.skill { display: flex; align-items: flex-start; gap: 1rem; padding: 1.2rem; }
.skill:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.skill:hover .logo-chip {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent), 0 12px 26px -8px color-mix(in srgb, var(--brand) 70%, transparent);
}
.skill__body { min-width: 0; }
.skill__head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.skill__name { font: 700 1rem/1.3 var(--font-head); letter-spacing: -.01em; }
.skill__desc { margin-top: .35rem; font-size: .9rem; color: var(--text-muted); }
.level { display: inline-flex; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; border: 1px solid; }
.level--proficient { color: #fff; background: var(--grad-btn); border-color: transparent; }
.level--intermediate { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.level--familiar { color: var(--text-muted); background: var(--surface-2); border-color: var(--border-strong); }
.soft-skills { margin-top: 2.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li {
  padding: .5rem 1rem; border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  transition: border-color .25s, color .25s, transform .25s var(--ease), opacity .7s var(--ease) var(--d, 0s), translate .7s var(--ease) var(--d, 0s);
}
.chips li:hover { border-color: var(--accent-border); color: var(--accent); transform: translateY(-2px); }

/* ---------- Achievements timeline ---------- */
.timeline { position: relative; padding-left: 2.75rem; }
.timeline__track { position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--border); }
.timeline__line { position: absolute; inset: 0; border-radius: inherit; background: var(--grad-v); transform: scaleY(var(--p, 0)); transform-origin: top; }
.timeline__list { display: grid; gap: 1.25rem; }
.tl-item { position: relative; }
.tl-dot {
  position: absolute; left: calc(-2.75rem + 2px); top: 1.55rem; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft);
  transform: scale(0); transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
.tl-item.is-reached .tl-dot { transform: scale(1); }
.cert { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: stretch; width: 100%; text-align: left; overflow: hidden; }
.cert:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* the thumbnail fills its column and the card's height (no fixed aspect ratio, so it never overflows into the text) */
.cert__thumb { position: relative; min-height: 150px; overflow: hidden; background: #fff; border-right: 1px solid var(--border); }
.cert__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; filter: var(--img-dim); transition: transform .8s var(--ease); }
.cert:hover .cert__thumb img { transform: scale(1.05); }
.cert__badge { position: absolute; left: 10px; bottom: 10px; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #fff; background: rgba(15, 23, 42, .8); }
.cert__body { display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: 1.1rem 1.4rem; }
.cert__date { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--accent); }
.cert__date .icon { width: 14px; height: 14px; }
.cert__title { font: 700 1.08rem/1.35 var(--font-head); letter-spacing: -.01em; color: var(--text); }
.cert__meta { font-size: .88rem; color: var(--text-subtle); }
.cert__view { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; font-size: .85rem; font-weight: 600; color: var(--accent); }
.cert__view .icon { width: 1em; height: 1em; transition: transform .3s var(--ease); }
.cert:hover .cert__view .icon { transform: translateX(3px); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact__heading { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 800; }
.contact__text { margin-top: .75rem; color: var(--text-muted); }
.contact__links { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-top: 1.75rem; }
.contact-item { display: flex; align-items: stretch; gap: .6rem; }
.contact-link { display: flex; align-items: center; gap: .9rem; flex: 1; min-width: 0; padding: .85rem 1rem; }
.contact-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contact-link:hover .logo-chip, .footer__links a:hover img { animation: bounce .6s var(--ease); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-5px); } 65% { transform: translateY(1px); } }
.contact-link__text { flex: 1; min-width: 0; }
.contact-link__text strong { display: block; font-weight: 600; color: var(--text); }
.contact-link__text small { display: block; font-size: .875rem; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-link > .icon { color: var(--text-subtle); transition: transform .25s var(--ease), color .2s; }
.contact-link:hover > .icon { color: var(--accent); transform: translate(2px, -2px); }
.copy-btn { flex: none; min-width: 92px; padding: 0 .85rem; gap: .4rem; }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }
.copy-btn.is-copied .icon { stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawCheck .45s var(--ease) forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.contact__intro { margin-bottom: 1rem; font-weight: 600; color: var(--text); }

.form-card { position: relative; overflow: hidden; }
.contact__form { padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1.1rem; }
/* floating labels */
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 1.45rem 1rem .55rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); transition: border-color .2s, box-shadow .25s; resize: vertical;
}
.field textarea { min-height: 150px; padding-top: 1.6rem; }
.field label {
  position: absolute; left: 1rem; top: 1rem; font-size: .98rem; color: var(--text-subtle); pointer-events: none;
  transform-origin: left top; transition: transform .2s var(--ease), color .2s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-.62rem) scale(.78); font-weight: 600; }
.field input:focus + label, .field textarea:focus + label { color: var(--accent); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 6px 24px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin-top: .35rem; font-size: .85rem; color: var(--danger); }
.field__error:empty { display: none; }
.field__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-top: .35rem; }
.field__meta .field__error { margin-top: 0; }
.field__count { margin-left: auto; font-size: .8rem; color: var(--text-subtle); }
.form__status { font-size: .92rem; text-align: center; }
.form__status:empty { display: none; }
.form__status.is-error { color: var(--danger); }
.form-success {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  padding: 2rem; text-align: center; background: var(--surface); animation: fadeIn .4s var(--ease);
}
.form-success__check { width: 72px; height: 72px; margin-bottom: .5rem; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.form-success__check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: drawLine .7s var(--ease) .1s forwards; }
.form-success__check path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: drawLine .45s var(--ease) .65s forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: scale(.98); } }
.form-success__title { font-size: 1.4rem; font-weight: 800; outline: none; }
.form-success__text { max-width: 340px; color: var(--text-muted); }
.form-success .btn { margin-top: .75rem; }

/* ---------- Footer ---------- */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); background: var(--bg-tint); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; font-size: .9rem; color: var(--text-subtle); }
.footer__links { display: flex; gap: .5rem; }
.footer__links a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, transform .2s var(--ease); }
.footer__links img { width: 18px; height: 18px; filter: grayscale(1); opacity: .7; transition: filter .25s, opacity .25s; }
.footer__links a:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.footer__links a:hover img, .footer__links a:focus-visible img { filter: none; opacity: 1; }

/* ---------- Back to top + toast ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  color: var(--text); background: var(--surface); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9); transition: opacity .3s, transform .35s var(--ease), visibility .3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); }
.to-top .icon { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.to-top:hover .icon { transform: translateY(-2px); }
.to-top__ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.to-top__ring circle { fill: none; stroke-width: 3; }
.to-top__track { stroke: var(--border); }
.to-top__bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 131.95; stroke-dashoffset: 131.95; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 400; display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.1rem; border-radius: 999px; font-size: .92rem; font-weight: 600; color: #f8fafc; background: #0f172a;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45); pointer-events: none;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity .3s, transform .4s var(--ease);
}
[data-theme="dark"] .toast { background: #f8fafc; color: #0f172a; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 18px; height: 18px; color: #22c55e; stroke-dasharray: 30; stroke-dashoffset: 30; }
.toast.is-on .icon { animation: drawCheck .45s var(--ease) .1s forwards; }
[data-theme="dark"] .toast .icon { color: #15803d; }

/* ---------- Dialogs: case study + certificate lightbox ---------- */
.modal, .lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; padding: var(--gutter); border: 0;
  background: transparent; color: var(--text); overflow-y: auto; overscroll-behavior: contain;
}
.modal[open], .lightbox[open] { display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; }
.modal::backdrop, .lightbox::backdrop { background: rgba(2, 6, 23, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.modal[open] .modal__box, .lightbox[open] .lightbox__box { animation: dialogIn .4s var(--ease); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.modal__box {
  position: relative; width: min(980px, 100%); margin-block: clamp(0px, 3vh, 32px); padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: var(--radius-lg); background: var(--card-bg); border: var(--card-border); box-shadow: var(--shadow-lg);
}
.modal__close { position: absolute; top: 16px; right: 16px; }
.modal__head { padding-right: 3rem; }
.modal__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: .85rem; font-weight: 500; color: var(--text-subtle); }
.modal__title { margin-top: .4rem; font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 800; }
.modal__desc { margin-top: .5rem; color: var(--text-muted); font-size: 1.05rem; }

.viewer { margin-top: 1.5rem; }
.viewer__stage { position: relative; display: grid; place-items: center; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.viewer__stage img { width: 100%; max-height: 62vh; object-fit: contain; filter: var(--img-dim); }
.modal.is-phone .viewer__stage { padding: 1.25rem 0 0; }
.modal.is-phone .viewer__stage img { width: auto; height: min(560px, 62vh); border-radius: 18px; border: 3px solid #0f172a; }
.viewer__stage figcaption { width: 100%; padding: .75rem 1rem; font-size: .9rem; color: var(--text-muted); text-align: center; }
.viewer__nav { position: absolute; top: calc(50% - 40px); z-index: 1; background: var(--surface); box-shadow: var(--shadow-sm); }
.viewer__nav--prev { left: 12px; }
.viewer__nav--next { right: 12px; }
.viewer__thumbs { display: flex; gap: .6rem; margin-top: .75rem; overflow-x: auto; padding-bottom: .25rem; }
.viewer__thumb { flex: none; width: 110px; aspect-ratio: 16 / 9.5; border-radius: 8px; overflow: hidden; border: 2px solid var(--border); opacity: .7; transition: opacity .2s, border-color .2s; background: var(--surface-2); }
.modal.is-phone .viewer__thumb { width: 54px; aspect-ratio: 9 / 19; }
.viewer__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.viewer__thumb:hover, .viewer__thumb[aria-current="true"] { opacity: 1; border-color: var(--accent); }
.viewer__note { margin-top: .5rem; font-size: .82rem; font-style: italic; color: var(--text-subtle); }

.case { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: 2rem; }
.case__block h4 { margin-bottom: .5rem; font: 700 .8rem/1.3 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.case__block h4 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.case__block p { color: var(--text-muted); }
.case__block--wide { grid-column: 1 / -1; }
.case__block .techs { margin-top: 0; }
.case__note { margin-top: .5rem; font-size: .82rem; color: var(--text-subtle); }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1.5rem; }
.features li { display: flex; gap: .6rem; color: var(--text-muted); }
.features .icon { margin-top: .3rem; color: var(--accent); }
.bars { display: grid; gap: .75rem; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) 3.5rem; align-items: center; gap: .9rem; font-size: .9rem; }
.bar-row__label { color: var(--text); font-weight: 500; }
.bar-row__value { text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; width: var(--v); border-radius: inherit; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease) var(--bd, 0s); }
.is-animated .bar span { transform: scaleX(1); }
.modal__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.modal__actions:empty { display: none; }

.lightbox[open] { place-items: center; }
.lightbox__box { width: min(1080px, 100%); }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; color: #e2e8f0; }
.lightbox__figure { position: relative; }
.lightbox__figure img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-lg); }
.lightbox__nav { position: absolute; top: calc(50% - 60px); }
.lightbox__nav--prev { left: -56px; }
.lightbox__nav--next { right: -56px; }
.lightbox__figure figcaption { display: flex; flex-direction: column; align-items: center; gap: .2rem; margin-top: 1rem; text-align: center; color: #e2e8f0; }
.lightbox__figure strong { font: 700 1.1rem/1.3 var(--font-head); color: #f8fafc; }
.lightbox__figure span { color: #cbd5e1; font-size: .9rem; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1024px) {
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}

@media (max-width: 860px) {
  :root { --nav-h: 62px; }
  .nav__burger { display: inline-grid; }
  .nav__cta { display: none; }
  .nav.is-open { background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom-color: var(--border); }
  .nav__links {
    position: absolute; top: calc(var(--nav-h) + 6px); left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 0; padding: .5rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility .25s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav__link { display: block; padding: .8rem 1rem; border-radius: var(--radius-sm); }
  .nav__link::after { display: none; }
  .nav__link.is-active { background: var(--accent-soft); color: var(--accent); }
  .nav__menu-theme { display: block; margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--border); }
  .theme-row { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .8rem 1rem; border-radius: var(--radius-sm); font-weight: 500; color: var(--text-muted); }
  .theme-row:hover { background: var(--surface-2); color: var(--text); }

  .hero { min-height: 0; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; justify-self: center; max-width: 270px; }
  .scroll-cue { display: none; }
  .about, .contact { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .project--featured, .project--wide { display: flex; }
  .project--featured .project__media, .project--wide .project__media { border-right: 0; border-bottom: 1px solid var(--border); }
  .project--wide .pmedia--desktop { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .project--featured .pmedia--phones { min-height: 320px; }
  .project--featured .project__actions, .project--wide .project__actions { margin-top: auto; }
  .case { grid-template-columns: 1fr; }
  .cert { grid-template-columns: 170px minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .brand__name { display: none; }
  .hero__cta .btn { flex: 1 1 100%; }
  .highlights li { padding-inline: .75rem; }
  .highlights strong { font-size: 1.25rem; }
  .highlights span { font-size: .78rem; }
  .skill-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .pmedia--phones { min-height: 260px; }
  .marquee { margin-bottom: 2rem; }
  .copy-btn { min-width: 78px; padding: 0 .6rem; }
  .contact-link { padding: .8rem .85rem; gap: .75rem; }
  .timeline { padding-left: 2rem; }
  .timeline__track { left: 6px; }
  .tl-dot { left: calc(-2rem - 2px); width: 16px; height: 16px; }
  .cert { grid-template-columns: 1fr; }
  .cert__thumb { aspect-ratio: 1.414; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .bar-row { grid-template-columns: minmax(0, 1fr) 3.2rem; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .footer__inner { flex-direction: column; text-align: center; }
  .to-top { right: 14px; bottom: 14px; width: 46px; height: 46px; }
  .lightbox__nav { top: auto; bottom: -56px; }
  .lightbox__nav--prev { left: calc(50% - 52px); }
  .lightbox__nav--next { right: calc(50% - 52px); }
  .lightbox__figure figcaption { margin-bottom: 64px; }
}

@media (hover: none) {
  .media-cta { display: none; }
}

/* Respect reduced motion: everything is shown in its final, static state */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; translate: none; }
  .js .hero-in, .js .hero__title .word, .js .scroll-cue { opacity: 1; transform: none; animation: none; }
  .hero__canvas { display: none; }
  .hero.has-canvas::before { display: block; }
  .photo-glow { animation: none; }
  .caret { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; padding-inline: var(--gutter); }
  .marquee__item[aria-hidden="true"] { display: none; }
  .scan__sweep { display: none; }
  .scan__box { stroke-dashoffset: 0; animation: none; }
  .scan__label, .scan__corner { opacity: 1; animation: none; }
  .timeline__line { transform: none; }
  .tl-dot { transform: none; }
}
