/* ══════════════════════════════════════════════════════════════
   Sebastian Brzustowicz — AI Engineer · personal site styles
   Theme: dark · glassmorphism · neon accents · scroll animations
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #05060f;
  --bg-soft: #0a0d1f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #e8ebf6;
  --muted: #9aa3bc;
  --muted-2: #6b7590;

  --cyan: #38bdf8;
  --violet: #6366f1;
  --pink: #8b5cf6;
  --grad-main: linear-gradient(100deg, var(--cyan) 0%, var(--violet) 55%, var(--pink) 100%);
  --grad-soft: linear-gradient(100deg, rgba(56,189,248,.14), rgba(99,102,241,.14), rgba(139,92,246,.14));

  --font-head: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; background: none; border: none; color: inherit; cursor: pointer; }

::selection { background: rgba(99,102,241, 0.35); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  border-radius: 8px;
  border: 2px solid var(--bg);
}

.mono { font-family: var(--font-mono); }
.gradient-text {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent { color: var(--cyan); }
.center { text-align: center; }

.container {
  width: min(1160px, 92%);
  margin-inline: auto;
}

/* ═══ Preloader ═══ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity .6s ease, visibility .6s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-inner { text-align: center; }
.preloader-logo {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.2rem;
}
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.preloader-bar {
  width: 220px; height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 auto .8rem;
}
#preloader-fill {
  display: block; height: 100%; width: 0;
  background: var(--grad-main);
  transition: width .15s ease;
}
.preloader-pct { color: var(--muted); font-size: .8rem; letter-spacing: .2em; }

/* ═══ Scroll progress ═══ */
#scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  z-index: 999;
  background: var(--grad-main);
  box-shadow: 0 0 12px rgba(56,189,248,.6);
}

/* ═══ Custom cursor ═══ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  opacity: 0;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(99,102,241,.7);
  transition: width .25s var(--ease), height .25s var(--ease),
              border-color .25s ease, background .25s ease, opacity .3s ease;
}
.cursor-ring.hovering {
  width: 56px; height: 56px;
  border-color: rgba(56,189,248,.9);
  background: rgba(56,189,248,.08);
}
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ═══ Background layers ═══ */
#bg-canvas {
  position: fixed; inset: 0;
  z-index: -3;
  opacity: .55;
}
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  z-index: -2;
  pointer-events: none;
  will-change: transform;
}
.orb-1 {
  width: 560px; height: 560px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(56,189,248,.22), transparent 65%);
}
.orb-2 {
  width: 620px; height: 620px;
  top: 30%; right: -220px;
  background: radial-gradient(circle, rgba(99,102,241,.20), transparent 65%);
}
.orb-3 {
  width: 520px; height: 520px;
  bottom: -180px; left: 22%;
  background: radial-gradient(circle, rgba(139,92,246,.14), transparent 65%);
}
.bg-grid {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}

/* ═══ Navbar ═══ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 900;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(5,6,15,.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .25s ease;
}
.brand-dot { color: var(--cyan); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.nav-link {
  position: relative;
  font-size: .92rem;
  color: var(--muted);
  padding: .3rem 0;
  transition: color .25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1.5px;
  background: var(--grad-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .4rem;
  z-index: 1001;
}
.nav-toggle span {
  width: 26px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.7rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .25s var(--ease), box-shadow .3s ease, background .3s ease, border-color .3s ease;
  will-change: transform;
}
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn-primary {
  background: var(--grad-main);
  color: #070811;
  box-shadow: 0 6px 24px -6px rgba(56,189,248,.5);
}
.btn-primary:hover { box-shadow: 0 10px 32px -6px rgba(99,102,241,.65); }
.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: rgba(255,255,255,.02);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  background: rgba(56,189,248,.08);
  box-shadow: 0 0 24px -6px rgba(56,189,248,.4);
}
.nav-cta { padding: .55rem 1.3rem; font-size: .88rem; }

/* ═══ Section scaffolding ═══ */
.section { padding: 120px 0; position: relative; }
.section-head { margin-bottom: 3.5rem; }
.section-tag {
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: .8rem;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  font-weight: 700;
}

/* ═══ Scroll reveal ═══ */
[data-reveal] {
  opacity: 0;
  transform: translateY(46px);
  transition:
    opacity .9s ease var(--d, 0s),
    transform .9s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-64px); }
[data-reveal="right"] { transform: translateX(64px); }
[data-reveal="zoom"]  { transform: scale(.86); }
[data-reveal].in { opacity: 1; transform: none; }

/* ═══ Glass card ═══ */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%);
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.glass:hover::before { opacity: 1; }

/* ═══ Tags / chips ═══ */
.tag-wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.tag {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .02em;
  padding: .32rem .7rem;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .25s ease;
}
.tag:hover { color: var(--cyan); border-color: rgba(56,189,248,.5); transform: translateY(-2px); }

/* ═══ Hero ═══ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) 0 5rem;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 3.5rem;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1.1rem;
  border-radius: 99px;
  border: 1px solid rgba(56,189,248,.35);
  background: rgba(56,189,248,.07);
  font-size: .82rem;
  color: #a5e1fb;
  margin-bottom: 1.6rem;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52,211,153,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.hero-name {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 1.2rem;
}
.hero-role {
  font-size: 1.02rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  min-height: 1.8rem;
}
.caret {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: var(--cyan);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: caret-blink .9s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-summary {
  color: var(--muted);
  max-width: 52ch;
  font-size: 1.03rem;
  margin-bottom: 2.2rem;
}
.hero-summary strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.hero-socials { display: flex; gap: .7rem; margin-bottom: 2.6rem; }
.hero-socials a {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color .25s ease, border-color .25s ease, transform .25s var(--ease), box-shadow .3s ease;
}
.hero-socials a:hover {
  color: var(--cyan);
  border-color: rgba(56,189,248,.5);
  box-shadow: 0 0 20px -4px rgba(56,189,248,.45);
  transform: translateY(-3px);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 560px;
}
.stat {
  padding: .9rem .4rem;
  border-left: 1px solid var(--border-strong);
  padding-left: 1.1rem;
}
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.stat-label { font-size: .78rem; color: var(--muted-2); }

/* Hero visual — photo */
.hero-visual { display: flex; justify-content: center; }
.photo-scene {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transition: transform .3s ease;
}
.photo-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  padding: 7px;
  background: conic-gradient(from var(--spin, 0deg), var(--cyan), var(--violet), var(--pink), var(--cyan));
  animation: spin 6s linear infinite;
  box-shadow: 0 24px 70px -20px rgba(56,189,248,.35), 0 24px 70px -20px rgba(99,102,241,.35);
}
@property --spin {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes spin { to { --spin: 360deg; } }
.photo-frame {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 8px solid #0a0d1f;
}
.photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
}
.photo-scene::after {
  content: "";
  position: absolute; inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.14), transparent 60%);
  z-index: -1;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.12); opacity: 1; }
}
.chip {
  position: absolute;
  padding: .42rem .8rem;
  font-size: .72rem;
  border-radius: 10px;
  background: rgba(10,13,31,.82);
  border: 1px solid var(--border-strong);
  color: var(--text);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 26px -8px rgba(0,0,0,.6);
  animation: floaty 5s ease-in-out infinite;
  white-space: nowrap;
  z-index: 2;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: .4rem; }
.c-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.c-violet { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.c-pink { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.chip-1 { top: 4%; left: -12%; animation-delay: 0s; }
.chip-2 { top: 14%; right: -16%; animation-delay: .7s; }
.chip-3 { bottom: 24%; left: -22%; animation-delay: 1.4s; }
.chip-4 { top: 44%; right: -24%; animation-delay: 2.1s; }
.chip-5 { bottom: -4%; left: 6%; animation-delay: 2.8s; }
.chip-6 { bottom: 8%; right: -6%; animation-delay: 3.5s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) translateZ(var(--dz, 0px)); }
  50% { transform: translateY(-10px) translateZ(var(--dz, 0px)); }
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.scroll-line {
  width: 1px; height: 44px;
  background: var(--border-strong);
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 10px;
  background: var(--cyan);
  animation: scrolldot 1.8s ease-in-out infinite;
}
@keyframes scrolldot {
  0% { transform: translateY(-12px); }
  100% { transform: translateY(48px); }
}

/* ═══ About ═══ */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3.5rem;
  align-items: start;
}
.about-text p { color: var(--muted); margin-bottom: 1.2rem; font-size: 1.02rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.knowledge-tags { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.about-facts { display: grid; gap: 1.1rem; }
.fact-card { padding: 1.5rem; transition: transform .35s var(--ease), border-color .3s ease; }
.fact-card:hover { transform: translateY(-4px); border-color: rgba(56,189,248,.4); }
.fact-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.fact-card h3 { font-family: var(--font-head); font-size: 1.08rem; margin-bottom: .45rem; }
.fact-card p { color: var(--muted); font-size: .93rem; }
.ico { font-style: normal; }

/* ═══ Skills ═══ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}
.skill-card { padding: 1.6rem; transition: transform .35s var(--ease), border-color .3s ease; }
.skill-card:hover { transform: translateY(-5px); border-color: rgba(99,102,241,.45); }
.skill-card h3 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .2rem;
}
.proficiency { padding: 2.2rem 2.2rem 2rem; margin-top: .4rem; }
.proficiency h3, .block-label {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}
.bar-row { margin-bottom: 1.25rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: .5rem;
}
.bar-val { color: var(--cyan); font-size: .8rem; }
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--grad-main);
  box-shadow: 0 0 14px -2px rgba(56,189,248,.55);
  transition: width 1.5s var(--ease) .15s;
}
.bar-row.in .bar-fill { width: var(--w); }

/* ═══ Experience timeline ═══ */
.timeline {
  position: relative;
  max-width: 820px;
  margin-inline: auto;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 14px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), var(--pink));
  opacity: .35;
}
.timeline-item {
  position: relative;
  padding-left: 58px;
  margin-bottom: 2.2rem;
}
.timeline-marker {
  position: absolute;
  left: 0; top: 26px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
}
.timeline-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--cyan);
  box-shadow: 0 0 16px -2px var(--cyan);
}
.timeline-card { padding: 1.7rem 1.9rem; transition: transform .35s var(--ease), border-color .3s ease; }
.timeline-card:hover { transform: translateX(6px); border-color: rgba(56,189,248,.4); }
.timeline-meta {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: .7rem;
  flex-wrap: wrap;
}
.period {
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: .28rem .7rem;
  border: 1px solid rgba(56,189,248,.35);
  border-radius: 99px;
  background: rgba(56,189,248,.07);
}
.role { color: var(--muted-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; }
.timeline-card h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: .5rem; }
.location { color: var(--muted-2); font-weight: 400; font-size: .95rem; }
.timeline-card p { color: var(--muted); font-size: .95rem; }

/* ═══ Projects ═══ */
.featured {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.8rem;
  margin-bottom: 2.2rem;
  background:
    linear-gradient(120deg, rgba(56,189,248,.06), rgba(99,102,241,.07) 50%, rgba(139,92,246,.05)),
    var(--surface);
}
.featured-label { color: var(--pink); font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; margin-bottom: .7rem; }
.featured h3 { font-family: var(--font-head); font-size: 2rem; margin-bottom: .8rem; }
.featured-desc { color: var(--muted); max-width: 56ch; margin-bottom: 1.4rem; }
.featured .btn { margin-top: 1.2rem; }
.featured-stats {
  display: grid;
  gap: 1.2rem;
  justify-items: end;
}
.fstat { text-align: right; }
.fstat-num {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  display: block;
}
.fstat .mono { color: var(--muted-2); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 2.4rem;
}
.project-card {
  padding: 1.7rem;
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), border-color .3s ease, box-shadow .3s ease;
  transform-style: preserve-3d;
}
.project-card:hover {
  border-color: rgba(99,102,241,.5);
  box-shadow: 0 22px 48px -18px rgba(56,189,248,.28);
}
.pc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}
.pc-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 1.05rem;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
}
.pc-stars { color: #fbbf24; font-size: .8rem; }
.project-card h3 { font-family: var(--font-head); font-size: 1.12rem; margin-bottom: .5rem; }
.project-card p { color: var(--muted); font-size: .9rem; flex-grow: 1; }
.project-card .tag-wrap { margin-top: auto; padding-top: 1.2rem; }

/* ═══ Education ═══ */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 2.4rem;
}
.edu-cards { display: grid; gap: 1.2rem; }
.edu-card { padding: 1.8rem; transition: transform .35s var(--ease), border-color .3s ease; }
.edu-card:hover { transform: translateY(-4px); border-color: rgba(56,189,248,.4); }
.edu-meta { margin-bottom: .6rem; }
.edu-meta span {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--violet);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 99px;
  padding: .26rem .7rem;
  background: rgba(99,102,241,.07);
}
.edu-card h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: .2rem; }
.edu-card .uni { color: var(--cyan); font-weight: 500; margin-bottom: .3rem; }
.edu-card p:not(.uni) { color: var(--muted); font-size: .92rem; }
.cert-column .block-label { margin-bottom: 1.2rem; }
.cert-list { display: grid; gap: .8rem; margin-bottom: 1.4rem; }
.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.3rem;
  transition: transform .3s var(--ease), border-color .3s ease;
}
.cert-item:hover { transform: translateX(5px); border-color: rgba(99,102,241,.45); }
.cert-ico { font-size: 1.3rem; }
.cert-item h4 { font-size: .95rem; font-weight: 600; }
.cert-item p { color: var(--muted-2); font-size: .76rem; margin-top: .15rem; }
.cert-link { color: var(--cyan); font-size: .82rem; display: inline-flex; align-items: center; gap: .4rem; transition: color .25s ease, transform .25s ease; }
.cert-link:hover { color: var(--pink); }

.languages { padding: 2.2rem; }
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.lang-grid .bar-head span { display: flex; gap: .45rem; align-items: baseline; }
.lang-grid em { font-style: normal; color: var(--muted-2); font-size: .72rem; }

/* ═══ Contact ═══ */
.contact { padding-bottom: 80px; }
.contact-intro {
  color: var(--muted);
  max-width: 56ch;
  margin: -1.5rem 0 2.6rem;
  font-size: 1.05rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 2.6rem;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.6rem;
  transition: transform .35s var(--ease), border-color .3s ease, box-shadow .3s ease;
}
.contact-card:hover {
  border-color: rgba(56,189,248,.45);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -16px rgba(99,102,241,.3);
}
.cc-ico { font-size: 1.4rem; margin-bottom: .4rem; }
.cc-label { color: var(--muted-2); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.cc-value { font-weight: 600; font-size: .98rem; word-break: break-word; }
.consent {
  text-align: center;
  color: var(--muted-2);
  font-size: .84rem;
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
}

/* ═══ Footer ═══ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 0;
  background: rgba(5,6,15,.6);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer p { color: var(--muted-2); font-size: .8rem; }
.footer-socials { display: flex; gap: 1.4rem; }
.footer-socials a {
  font-size: .85rem;
  color: var(--muted);
  transition: color .25s ease;
}
.footer-socials a:hover { color: var(--cyan); }

/* Back to top */
#to-top {
  position: fixed;
  right: 1.6rem; bottom: 1.6rem;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 1.1rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .35s ease, transform .35s var(--ease), visibility .35s, border-color .3s ease;
  z-index: 800;
}
#to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#to-top:hover { border-color: var(--cyan); box-shadow: 0 0 20px -4px rgba(56,189,248,.5); }

/* ═══ Responsive ═══ */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 4.5rem; }
  .hero-visual { order: -1; }
  .hero-stats { max-width: 100%; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(5,6,15,.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    font-size: 1.3rem;
    transform: translateX(100%);
    transition: transform .45s var(--ease);
    z-index: 1000;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .section { padding: 90px 0; }
}

@media (max-width: 680px) {
  .about-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; padding: 2rem; }
  .featured-stats { justify-items: start; grid-template-columns: repeat(3, auto); gap: 1.6rem; }
  .fstat { text-align: left; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
  .skills-grid, .project-grid, .contact-grid { grid-template-columns: 1fr; }
  .chip { display: none; }
  .photo-scene { width: min(280px, 88%); }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ═══ Reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .bar-fill { width: var(--w); }
  #bg-canvas { display: none; }
  .cursor-dot, .cursor-ring { display: none; }
}
