/* ===== raakthh portfolio ===== */
:root {
  --bg: #0b1a2e;
  --bg-alt: #0e2038;
  --surface: #12263f;
  --border: #1f3a5a;
  --text: #f4f7fb;
  --muted: #9fb0c5;
  --accent: #22d3ee;
  --accent-strong: #67e8f9;
  --on-accent: #06202b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --header-h: 68px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f3f6fa;
  --surface: #ffffff;
  --border: #dbe3ec;
  --text: #0b1a2e;
  --muted: #526277;
  --accent: #0e7490;
  --accent-strong: #155e75;
  --on-accent: #ffffff;
  --shadow: 0 8px 24px rgba(11, 26, 46, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* ===== Header / nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 1.3rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.nav-menu { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  display: block; padding: 0.5rem 0.8rem; border-radius: 999px;
  color: var(--muted); font-weight: 500; font-size: 0.95rem;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.theme-toggle, .nav-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; }
.nav-toggle .bar { display: block; width: 18px; height: 2px; background: currentColor; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    padding: 0.75rem 1rem 1rem; background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-link { padding: 0.75rem 1rem; border-radius: 10px; }
  .theme-toggle { margin: 0.25rem 0 0 0.5rem; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn[hidden] { display: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-secondary:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

/* ===== Hero ===== */
.hero { padding: clamp(3rem, 9vw, 7rem) 0; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; margin-bottom: 0.75rem; }
.hero h1 { font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 800; letter-spacing: -0.03em; }
.tagline { font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 600; color: var(--accent); }
.intro { color: var(--muted); max-width: 52ch; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-photo { display: flex; justify-content: center; }
.avatar {
  width: min(300px, 70vw); aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { font-size: 7rem; font-weight: 800; color: var(--accent); line-height: 1; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-photo { order: -1; justify-content: flex-start; }
  .avatar { width: 160px; border-radius: 22px; }
  .avatar-fallback { font-size: 4rem; }
}

/* ===== Sections ===== */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.lead { color: var(--muted); max-width: 60ch; }
.about-body { max-width: 70ch; color: var(--muted); font-size: 1.05rem; }

/* ===== Filters ===== */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.filter-btn {
  padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ===== Project cards ===== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.card[hidden] { display: none; }
.card-media {
  aspect-ratio: 16 / 9; background: var(--bg-alt); display: grid; place-items: center;
  color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--border);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .ph { text-align: center; padding: 1rem; }
.card-media .ph strong { display: block; font-size: 1.6rem; color: var(--accent); letter-spacing: -0.02em; }
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-body h3 { font-size: 1.25rem; margin: 0; }
.card-subtitle { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin: 0; }
.card-summary { color: var(--muted); font-size: 0.95rem; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
  font-size: 0.78rem; padding: 0.2rem 0.65rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text);
}
.card-actions { margin-top: auto; padding-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.card-actions .btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
.empty { color: var(--muted); }

/* ===== Timeline ===== */
.timeline { display: grid; gap: 1.25rem; max-width: 780px; border-left: 2px solid var(--border); padding-left: 1.5rem; }
.timeline li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.5rem - 7px); top: 1.6rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.timeline h3 { font-size: 1.1rem; margin: 0; }
.timeline .org { color: var(--accent); font-weight: 600; margin-bottom: 0.5rem; }
.timeline p { margin: 0; color: var(--muted); }

/* ===== Skills ===== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 0.9rem; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.contact-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; color: var(--text); transition: transform 0.2s, border-color 0.2s;
}
.contact-card:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--accent); }
.contact-card .label { color: var(--accent); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.contact-card .value { display: block; margin-top: 0.35rem; word-break: break-word; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 1.75rem 0; font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }
.footer-inner p { margin: 0; }

/* ===== Back to top ===== */
.back-to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.back-to-top:hover { border-color: var(--accent); }
.back-to-top[hidden] { display: none; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 12, 24, 0.7); }
.modal-card {
  position: relative; width: min(620px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.75rem;
  box-shadow: var(--shadow);
}
.modal-card:focus { outline: none; }
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { border-color: var(--accent); }
.modal-media { margin-bottom: 1rem; border-radius: 12px; overflow: hidden; }
.modal-media:empty { display: none; }
.modal-subtitle { color: var(--accent); font-weight: 600; }
.modal-list { list-style: disc; padding-left: 1.2rem; color: var(--muted); margin-bottom: 1rem; }
.modal-list li { margin-bottom: 0.3rem; }
.modal .tags { margin-bottom: 1.25rem; }
.modal-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
body.modal-open { overflow: hidden; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
/* Content stays visible if JS is unavailable */
html:not(.js) .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .contact-card:hover { transform: none; }
}

/* ===================================================================
   FX LAYER: premium animation upgrade (appended; original rules above untouched)
   =================================================================== */
.hero, .section, .site-footer { position: relative; z-index: 1; }
.section.alt { background: color-mix(in srgb, var(--bg-alt) 72%, transparent); }
.hero { overflow: hidden; }

/* --- Background: grid, glow, spotlight, particles --- */
.fx-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx-grid {
  position: absolute; inset: -60px;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 30%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 30%, #000 15%, transparent 75%);
  animation: fx-grid 16s linear infinite;
}
.fx-glow { position: absolute; border-radius: 50%; background: var(--accent); filter: blur(90px); opacity: 0.26; animation: fx-drift 18s ease-in-out infinite alternate; }
.fx-glow.g1 { width: 520px; height: 520px; top: -160px; right: -120px; }
.fx-glow.g2 { width: 420px; height: 420px; bottom: -140px; left: -120px; opacity: 0.16; animation-duration: 24s; animation-direction: alternate-reverse; }
.fx-spot { position: absolute; inset: 0; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%); }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
:root[data-theme="light"] .fx-glow { opacity: 0.12; }
:root[data-theme="light"] .fx-glow.g2 { opacity: 0.08; }
:root[data-theme="light"] .fx-grid { opacity: 0.7; }
@keyframes fx-grid { to { transform: translate(56px, 56px); } }
@keyframes fx-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 50px) scale(1.15); } }
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-float { 50% { translate: 0 -10px; } }
@keyframes fx-bar { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
@keyframes fx-draw { from { stroke-dashoffset: 1; } }
@keyframes fx-up { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }
@keyframes fx-rise { from { transform: translateY(110%) rotate(5deg); opacity: 0; } }
@keyframes fx-shine { to { background-position: 200% center; } }
@keyframes fx-pop { from { opacity: 0; transform: scale(0.85) translateY(20px); } }
@keyframes fx-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } to { box-shadow: 0 0 0 11px transparent; } }
@keyframes fx-card-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes fx-menu { from { opacity: 0; transform: translateY(-8px); } }
@keyframes fx-fade { from { opacity: 0; } }
@keyframes fx-modal { from { opacity: 0; transform: translateY(24px) scale(0.96); } }

/* --- Hero entrance + text reveal --- */
html.js .hero .eyebrow, html.js .hero .tagline, html.js .hero .intro, html.js .hero-actions { animation: fx-up 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
html.js .hero .eyebrow { animation-delay: 0.05s; }
html.js .hero .intro { animation-delay: 0.75s; }
html.js .hero-actions { animation-delay: 0.9s; }
html.js .hero .tagline {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), var(--accent));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fx-up 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both, fx-shine 6s linear infinite;
}
.fx-word { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 0.02em 0.1em; margin-bottom: -0.1em; }
.fx-char { display: inline-block; animation: fx-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 55ms + 0.15s); }
html.js .hero-photo { animation: fx-pop 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; }

/* --- Photo: glow, orbit ring, floating chips, tilt --- */
.fx-avatar {
  position: relative; isolation: isolate; animation: fx-float 6s ease-in-out infinite;
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.2s ease-out;
}
.fx-avatar::before {
  content: ""; position: absolute; inset: -12%; z-index: -2; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, var(--accent), transparent 55%, var(--accent-strong), transparent);
  filter: blur(36px); opacity: 0.38; animation: fx-spin 12s linear infinite;
}
:root[data-theme="light"] .fx-avatar::before { opacity: 0.22; }
.fx-avatar .avatar { transition: border-color 0.3s, box-shadow 0.3s; }
.fx-avatar:hover .avatar { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 50px color-mix(in srgb, var(--accent) 35%, transparent); }
.fx-ring { position: absolute; inset: -22px; z-index: -1; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); animation: fx-spin 40s linear infinite; pointer-events: none; }
.fx-ring::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.fx-chip {
  position: absolute; z-index: 2; padding: 0.35rem 0.7rem; border-radius: 12px;
  font: 600 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent);
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(8px); box-shadow: var(--shadow); animation: fx-float 5s ease-in-out infinite;
}
.fx-chip.c1 { top: -14px; right: -18px; }
.fx-chip.c2 { left: -22px; top: 42%; animation-delay: -1.5s; animation-duration: 6.5s; }
.fx-chip.c3 { right: -14px; bottom: 18px; height: 34px; display: flex; gap: 3px; align-items: flex-end; padding: 0.5rem 0.6rem; animation-delay: -3s; }
.fx-chip.c3 i { display: block; width: 4px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: bottom; animation: fx-bar 1.6s ease-in-out infinite alternate; }
.fx-chip.c3 i:nth-child(2) { animation-delay: -0.4s; }
.fx-chip.c3 i:nth-child(3) { animation-delay: -0.8s; }
.fx-chip.c3 i:nth-child(4) { animation-delay: -1.2s; }
@media (max-width: 820px) { .fx-chip { font-size: 0.7rem; } .fx-chip.c2 { left: -10px; } .fx-chip.c1 { right: -10px; } .fx-chip.c3 { right: -8px; } }

/* --- Decorative data visuals --- */
.fx-spark { position: absolute; left: 0; bottom: 0; width: 100%; height: 90px; opacity: 0.4; pointer-events: none; z-index: -1; }
.fx-spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; vector-effect: non-scaling-stroke; animation: fx-draw 3.2s ease 0.9s both; filter: drop-shadow(0 0 6px var(--accent)); }
.section-head { position: relative; }
.fx-deco { position: absolute; right: 0; bottom: 0.4rem; display: flex; align-items: flex-end; gap: 4px; height: 44px; pointer-events: none; }
.fx-deco i { display: block; width: 5px; border-radius: 3px; background: linear-gradient(var(--accent), transparent); opacity: 0.55; transform-origin: bottom; transform: scaleY(0.25); }
.section-head.visible .fx-deco i { animation: fx-bar 2.4s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * 0.17s); }
.section-head h2::after {
  content: ""; display: block; height: 3px; width: 0; margin-top: 0.5rem; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), transparent); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s;
}
.section-head.visible h2::after { width: 80px; }
@media (max-width: 560px) { .fx-deco { display: none; } }

/* --- Scroll reveal + stagger --- */
html.js .reveal { transform: translateY(32px) scale(0.97); filter: blur(5px); transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.8s ease; }
html.js .reveal.visible { transform: none; filter: none; }
html.js .reveal:not(.visible) .tags li { opacity: 0; transform: scale(0.7); }
.reveal .tags li { transition: opacity 0.4s ease, transform 0.4s ease; transition-delay: calc(var(--i, 0) * 45ms + 0.25s); }
.timeline li::before { animation: fx-pulse 2.4s ease-out infinite; }
.card.fx-in { animation: fx-card-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--fd, 0ms); }

/* --- Navbar --- */
.site-header { transition: background 0.3s, box-shadow 0.3s; }
.site-header.scrolled { background: color-mix(in srgb, var(--bg) 94%, transparent); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2); }
.brand { transition: transform 0.2s ease; }
.brand:hover { transform: scale(1.05); }
.nav-link { position: relative; transition: color 0.2s, background 0.3s; }
.nav-link::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 0; height: 2px; border-radius: 2px; background: var(--accent); transition: width 0.3s ease, left 0.3s ease; }
.nav-link:hover::after { width: 40%; left: 30%; }
.nav-link.active::after { width: 0; }
.theme-toggle, .nav-toggle { transition: border-color 0.2s, transform 0.25s ease, background 0.2s; }
.theme-toggle:hover { transform: rotate(18deg); }
.nav-menu.open { animation: fx-menu 0.25s ease; }
@media (max-width: 820px) { .nav-link::after { display: none; } }
.fx-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 150; pointer-events: none; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent), var(--accent-strong)); box-shadow: 0 0 10px var(--accent); }

/* --- Buttons & filters --- */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform 0.6s ease; }
.btn:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:active { transform: translateY(0) scale(0.97); }
.filter-btn:hover { transform: translateY(-2px); }
.filter-btn:active { transform: scale(0.95); }
.filter-btn[aria-pressed="true"] { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.back-to-top { transition: transform 0.2s ease, border-color 0.2s; }
.back-to-top:hover { transform: translateY(-3px); }
.back-to-top:not([hidden]) { animation: fx-pop 0.35s ease both; }

/* --- Project cards: spotlight, image zoom, tilt --- */
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%); }
.card:hover::after { opacity: 1; }
.card-media { overflow: hidden; }
.card-media img { transition: transform 0.6s ease; }
.card:hover .card-media img { transform: scale(1.07); }
.card.reveal.visible:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); transition: transform 0.12s ease-out, border-color 0.2s, box-shadow 0.25s; }
.contact-card { transition: transform 0.2s, border-color 0.2s, box-shadow 0.25s; }
.contact-card:hover { box-shadow: var(--shadow); }
.skill-card { transition: transform 0.25s ease, border-color 0.25s; }
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); }

/* --- Modal --- */
.modal:not([hidden]) .modal-backdrop { animation: fx-fade 0.25s ease; backdrop-filter: blur(4px); }
.modal:not([hidden]) .modal-card { animation: fx-modal 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* --- Reduced motion: neutralise everything added above --- */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; filter: none; }
  .card.reveal.visible:hover, .skill-card:hover, .contact-card:hover { transform: none; }
  .fx-avatar { transform: none; }
  .fx-progress { transition: none; }
}
