/* =========================================================
   Jonathan Piscitello — Portfolio · styles.css
   Refonte premium · double thème · motion-driven
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 18px;
  --radius-sm: 12px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --accent: #3b82f6;
  --accent-soft: #60a5fa;
}

/* ---------- Dark theme (default) ---------- */
[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elev: #121214;
  --bg-card: #141417;
  --bg-alt: #0d0d0f;
  --ink: #f5f4f1;
  --ink-soft: #c7c6c2;
  --muted: #8e8d89;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #5b9bff;
  --accent-glow: rgba(91, 155, 255, 0.28);
  --card-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --orb-1: rgba(91, 155, 255, 0.20);
  --orb-2: rgba(168, 85, 247, 0.14);
  --grid-color: rgba(255, 255, 255, 0.035);
  color-scheme: dark;
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #f7f4ee;
  --bg-elev: #fffdf9;
  --bg-card: #fffdf9;
  --bg-alt: #f1ede4;
  --ink: #14130f;
  --ink-soft: #3a3833;
  --muted: #6b675f;
  --line: rgba(20, 19, 15, 0.12);
  --line-strong: rgba(20, 19, 15, 0.22);
  --accent: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.18);
  --card-shadow: 0 24px 50px -30px rgba(40, 38, 30, 0.4);
  --orb-1: rgba(37, 99, 235, 0.16);
  --orb-2: rgba(217, 119, 87, 0.14);
  --grid-color: rgba(20, 19, 15, 0.04);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

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

::selection { background: var(--accent); color: #fff; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 32px; height: 32px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease),
              opacity 0.3s ease;
  opacity: 0;
  display: none;
}
.cursor.is-hover { width: 56px; height: 56px; background: var(--accent-glow); border-color: transparent; }
@media (pointer: fine) {
  .cursor { display: block; }
  body.cursor-ready { cursor: none; }
  body.cursor-ready a, body.cursor-ready button { cursor: none; }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0;
  z-index: 9000;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.preloader-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--ink), var(--muted));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pl-rise 0.8s var(--ease) both;
}
.preloader-line {
  width: 180px; height: 2px;
  background: var(--line);
  overflow: hidden; border-radius: 2px;
}
.preloader-fill {
  display: block; height: 100%; width: 0%;
  background: var(--accent);
  animation: pl-fill 1.1s var(--ease) 0.2s forwards;
}
@keyframes pl-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pl-fill { to { width: 100%; } }

/* ---------- Animated background ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.orb-1 {
  width: 50vw; height: 50vw; max-width: 640px; max-height: 640px;
  top: -10%; right: -8%;
  background: var(--orb-1);
  animation: float-a 22s ease-in-out infinite;
}
.orb-2 {
  width: 42vw; height: 42vw; max-width: 540px; max-height: 540px;
  bottom: -12%; left: -10%;
  background: var(--orb-2);
  animation: float-b 26s ease-in-out infinite;
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
@keyframes float-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px, 50px) scale(1.1); } }
@keyframes float-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px, -40px) scale(1.08); } }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 50%; top: -60px;
  transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 0.6rem 1.2rem; border-radius: 0 0 10px 10px;
  z-index: 9999; transition: top 0.25s var(--ease);
  font-size: 0.9rem;
}
.skip-link:focus { top: 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 16px 0 auto 0;
  z-index: 800;
  transition: transform 0.4s var(--ease);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  background: color-mix(in srgb, var(--bg-elev) 72%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.6rem 0.7rem 0.6rem 1.2rem;
  box-shadow: 0 10px 30px -18px rgba(0,0,0,0.5);
  max-width: calc(var(--maxw) - 1rem);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.site-header.is-scrolled .nav-inner { border-color: var(--line-strong); }

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg); }
.brand-name { font-size: 0.92rem; letter-spacing: -0.01em; }

.nav { display: flex; gap: 0.3rem; }
.nav a {
  position: relative;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem; color: var(--ink-soft);
  border-radius: 100px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0.35rem;
  height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a.is-current { color: var(--ink); }
.nav a.is-current::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.lang-switch {
  display: flex; align-items: center; gap: 0.25rem;
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--muted);
}
.lang-switch button {
  padding: 0.3rem 0.4rem; border-radius: 7px;
  transition: color 0.2s var(--ease);
}
.lang-switch button.is-active { color: var(--ink); font-weight: 500; }
.lang-switch button:hover { color: var(--accent); }

.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--line-strong); transform: rotate(20deg); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.menu-toggle {
  display: none;
  width: 40px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle span {
  width: 18px; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(8rem, 18vh, 12rem);
  padding-bottom: clamp(3rem, 6vh, 5rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.8rem;
  letter-spacing: 0.04em; color: var(--muted);
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line); border-radius: 100px;
  margin-bottom: 1.6rem;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(3.2rem, 9vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 1.4rem;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.05em; }
.hero-title .line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease);
}
.is-loaded .hero-title .line > span { transform: translateY(0); }
.is-loaded .hero-title .line.accent > span { transition-delay: 0.12s; }
.hero-title .accent > span {
  font-style: italic; font-weight: 420;
  background: linear-gradient(110deg, var(--accent), var(--accent-soft));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft); font-weight: 500;
  margin-bottom: 1.1rem;
}
.hero-lead {
  max-width: 46ch; color: var(--muted);
  font-size: 1.05rem; margin-bottom: 2rem;
}

.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  font-size: 0.95rem; font-weight: 500;
  min-height: 44px;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
              color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 12px 30px -12px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 16px 40px -10px var(--accent-glow); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-link {
  color: var(--muted); padding: 0.85rem 0.6rem;
}
.btn-link:hover { color: var(--accent); }
.btn-link svg { transition: transform 0.3s var(--ease); }
.btn-link:hover svg { transform: translateY(2px); }

/* Hero photo */
.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s var(--ease-out);
  transform-style: preserve-3d;
}
.photo-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, transparent 55%, var(--accent-glow));
  mix-blend-mode: overlay;
}
.photo-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.12) contrast(1.02);
}
.photo-badge {
  position: absolute; bottom: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0.4rem 0.75rem; border-radius: 100px;
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  backdrop-filter: blur(8px); border: 1px solid var(--line);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stats li { display: flex; flex-direction: column; gap: 0.2rem; }
.stats strong {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em; line-height: 1;
}
.stats span { font-size: 0.85rem; color: var(--muted); }

/* Scroll cue */
.scroll-cue {
  display: grid; place-items: center;
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  width: 26px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: 100px;
}
.scroll-cue-line {
  width: 3px; height: 8px; border-radius: 2px;
  background: var(--accent);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(-6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4.5rem, 11vw, 8rem); position: relative; }
.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head--center { text-align: center; max-width: 620px; margin-inline: auto; }
.section-num {
  font-family: var(--font-mono); color: var(--accent);
  font-size: 0.85rem; letter-spacing: 0.1em; margin-bottom: 0.6rem;
}
.section-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em; line-height: 1.05;
}
.section-sub { color: var(--muted); margin-top: 0.9rem; font-size: 1.02rem; }

/* About */
.section-grid {
  display: grid; grid-template-columns: 0.5fr 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}
.lead-para {
  font-family: var(--font-display); font-weight: 380;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.4; letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
.section-body > p:not(.lead-para) { color: var(--muted); max-width: 60ch; }
.facts {
  margin-top: 2.2rem; display: grid; gap: 0.2rem;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.facts-k { color: var(--muted); font-family: var(--font-mono); font-size: 0.82rem; }
.facts-v { font-weight: 500; text-align: right; }

/* Marquee */
.marquee {
  overflow: hidden; border-block: 1px solid var(--line);
  padding-block: 1.3rem;
  background: var(--bg);
  -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; align-items: center; gap: 1.6rem;
  width: max-content;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--ink-soft);
  animation: marquee 32s linear infinite;
}
.marquee-track .sep { color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Skills */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.6rem);
}
.skill-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  overflow: hidden;
}
.skill-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--accent-glow), transparent 60%);
  opacity: 0; transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.skill-card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--card-shadow); }
.skill-card:hover::before { opacity: 1; }
.skill-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); margin-bottom: 1.2rem;
}
.skill-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; letter-spacing: -0.01em; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  font-size: 0.82rem; color: var(--ink-soft);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line); border-radius: 100px;
  background: var(--bg-elev);
}

/* Timeline */
.timeline {
  position: relative; max-width: 760px; margin-inline: auto;
  padding-left: 1.8rem;
}
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1.5px; background: var(--line);
}
.t-item { position: relative; padding-bottom: 2.6rem; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: ""; position: absolute; left: -1.8rem; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  transform: translateX(-0.5px);
}
.t-period {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--accent); margin-bottom: 0.5rem; letter-spacing: 0.02em;
}
.t-content h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.7rem; letter-spacing: -0.01em; }
.t-role { color: var(--muted); font-weight: 400; }
.t-content ul { display: grid; gap: 0.45rem; }
.t-content li {
  position: relative; padding-left: 1.1rem;
  color: var(--muted); font-size: 0.95rem;
}
.t-content li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong);
}

/* Education */
.edu {
  max-width: 760px; margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  padding-top: 2.2rem; border-top: 1px solid var(--line);
}
.edu-title {
  font-family: var(--font-mono); font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 1.2rem;
}
.edu-list { display: grid; gap: 0.2rem; }
.edu-list li {
  display: flex; gap: 1.2rem; align-items: baseline;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}
.edu-year { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; min-width: 3rem; }

/* Projects */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
}
.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  display: flex; flex-direction: column;
  min-height: 240px;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), var(--accent-glow), transparent 60%);
  opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--card-shadow); }
.project-card:hover::before { opacity: 1; }
.p-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1rem;
}
.p-index {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--accent);
}
.p-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.6rem; border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  white-space: nowrap;
}
.p-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.p-status--active { color: #22c55e; }
.p-status--active::before { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0.5); animation: pulse 2s infinite; }
.p-status--paused { color: #f59e0b; }
.p-status--paused::before { background: #f59e0b; }
.p-status--archived { color: var(--muted); }
.p-status--archived::before { background: var(--muted); }
.project-card h3 { font-family: var(--font-display); font-weight: 420; font-size: 1.4rem; letter-spacing: -0.02em; margin-bottom: 0.7rem; }
.project-card p { color: var(--muted); font-size: 0.95rem; flex-grow: 1; }
.p-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.2rem; }
.p-tags span {
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 0.28rem 0.65rem; border-radius: 100px;
  border: 1px solid var(--line); color: var(--ink-soft);
}
.p-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1.3rem; font-size: 0.9rem; font-weight: 500; color: var(--accent);
}
.p-link svg { transition: transform 0.3s var(--ease); }
.p-link:hover svg { transform: translate(3px, -3px); }

.projects-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 0.5rem; align-items: center;
  text-align: center; padding: clamp(2.5rem, 6vw, 4rem);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted);
}
.projects-empty strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); font-weight: 420; }

/* Contact */
.contact { text-align: center; }
.contact-inner { max-width: 720px; margin-inline: auto; }
.contact-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: -0.035em; line-height: 1; margin-block: 0.6rem 1.4rem;
}
.contact-lead { color: var(--muted); font-size: 1.1rem; max-width: 48ch; margin-inline: auto; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2.4rem;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.3rem, 4vw, 2.1rem);
  letter-spacing: -0.02em;
  border-bottom: 1.5px solid var(--line-strong); padding-bottom: 0.3rem;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }
.contact-mail svg { transition: transform 0.3s var(--ease); }
.contact-mail:hover svg { transform: translate(3px, -3px); }
.contact-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem;
  margin-top: 2.6rem; font-size: 0.92rem; color: var(--muted);
}
.contact-links a { transition: color 0.25s var(--ease); }
.contact-links a:hover { color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: var(--muted);
}
.footer-made { font-family: var(--font-mono); font-size: 0.78rem; }
.footer-top { transition: color 0.25s var(--ease); }
.footer-top:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }
.reveal[data-delay="6"] { transition-delay: 0.48s; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; justify-content: flex-start; }
  .photo-frame { width: min(260px, 60%); }
  .section-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 0.6rem;
    box-shadow: var(--card-shadow);
  }
  .nav.is-open a { padding: 0.85rem 1rem; font-size: 1rem; }
  .nav.is-open a::after { display: none; }
  .brand-name { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1rem; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 420px) {
  .hero-cta { width: 100%; }
  .btn-primary, .btn-ghost { flex: 1; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
  .orb { animation: none; }
  .cursor { display: none !important; }
  body.cursor-ready { cursor: auto; }
}
