/* ============================================================
   edoardo-fiore.it — design system
   dark-first, cyan→violet accent, Space Grotesk + Inter
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-var-latin.woff2') format('woff2');
}

:root {
  --bg: #07070c;
  --bg-soft: #0d0d17;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecedf5;
  --muted: #9d9fb5;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --grad: linear-gradient(100deg, var(--accent), var(--accent-2));
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 20px;
  --nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

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

/* subtle background texture: grid + radial glows */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 45% at 15% -5%, rgba(34, 211, 238, 0.07), transparent),
    radial-gradient(ellipse 55% 40% at 90% 25%, rgba(167, 139, 250, 0.06), transparent),
    radial-gradient(ellipse 50% 40% at 40% 110%, rgba(34, 211, 238, 0.05), transparent);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 20%, transparent 75%);
  pointer-events: none;
}

::selection { background: rgba(34, 211, 238, 0.3); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

strong { color: var(--text); font-weight: 600; }

.accent {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ custom cursor ============ */
.cursor-dot, .cursor-ring {
  display: none;
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
}
html.has-cursor .cursor-dot,
html.has-cursor .cursor-ring { display: block; }
html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }

.cursor-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(34, 211, 238, 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.cursor-ring.is-hover {
  width: 58px; height: 58px;
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.08);
}
.cursor-dot.is-down { transform: translate(-50%, -50%) scale(2.2); }

/* ============ nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 7, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1140px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 1.5px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

/* ============ hero ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 24px) 24px 80px;
}
#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-content { position: relative; z-index: 2; max-width: 860px; }

.hero-eyebrow {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 9vw, 5.8rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: 26px;
  background: linear-gradient(180deg, #ffffff 30%, #b9bdd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-height: 1.1em;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 40px;
}
.hero-sub a {
  color: var(--muted);
  border-bottom: 1px dashed rgba(157, 159, 181, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.hero-sub a:hover { color: var(--accent); border-color: var(--accent); }

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 24px; height: 44px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.scroll-hint-line {
  width: 2.5px; height: 9px;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollHint 1.8s ease-in-out infinite;
}
@keyframes scrollHint {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
  will-change: transform;
}
.btn-primary {
  background: var(--grad);
  color: #06060a;
}
.btn-primary:hover { box-shadow: 0 0 32px rgba(34, 211, 238, 0.35); }
.btn-ghost {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ============ sections ============ */
.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 110px 24px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 48px;
}
.section-index {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ============ about ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-text p { color: var(--muted); margin-bottom: 20px; }
.about-text p a { border-bottom: 1px dashed rgba(34, 211, 238, 0.4); }
.about-text p a:hover { border-bottom-style: solid; }

.cert-row, .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 26px;
}
.chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.about-visual { display: flex; justify-content: center; }
.avatar-frame {
  position: relative;
  width: min(320px, 80vw);
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  transform-style: preserve-3d;
}
.avatar-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ============ cards (shared) ============ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.card:hover { border-color: var(--border-strong); }
/* spotlight that follows the mouse (JS sets --mx / --my) */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(34, 211, 238, 0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

/* tilt glare */
.tilt { will-change: transform; }
.tilt-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.07) 50%, transparent 60%);
  background-size: 250% 250%;
  background-position: var(--glare, 50%) 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tilt:hover .tilt-glare { opacity: 1; }

/* ============ projects ============ */
.projects-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.project-card { padding: 38px; }
.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.project-mark {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.project-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.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); }
}
.project-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.project-desc { color: var(--muted); margin-bottom: 8px; }
.tag-row { margin-top: 18px; margin-bottom: 30px; }
.project-links { display: flex; gap: 14px; flex-wrap: wrap; }
.project-meta {
  margin-top: 24px;
  font-size: 0.82rem;
  color: rgba(157, 159, 181, 0.6);
  letter-spacing: 0.03em;
}

.more-card {
  display: flex;
  color: var(--text);
  border-style: dashed;
}
.more-card-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 38px;
}
.more-plus {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
}
.more-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.more-card p { color: var(--muted); font-size: 0.95rem; }
.more-link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 6px;
  transition: letter-spacing 0.25s ease;
}
.more-card:hover .more-link { letter-spacing: 0.03em; }

/* ============ passions ============ */
.passions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.passion-card { padding: 30px; }
.passion-icon {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  margin-bottom: 18px;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.18);
  transition: transform 0.3s ease, color 0.3s ease, background 0.3s ease;
}
.passion-card:hover .passion-icon {
  transform: translateY(-4px) rotate(-4deg);
  color: var(--accent-2);
  background: rgba(167, 139, 250, 0.09);
  border-color: rgba(167, 139, 250, 0.25);
}
.passion-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.passion-card p { color: var(--muted); font-size: 0.97rem; }

/* ============ contact ============ */
.contact { text-align: center; padding-bottom: 90px; }
.contact .section-head { justify-content: center; }
.contact-lead {
  color: var(--muted);
  font-size: 1.15rem;
  margin-bottom: 46px;
}
.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.18);
}

/* ============ footer ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 24px;
  text-align: center;
  color: rgba(157, 159, 181, 0.55);
  font-size: 0.85rem;
}

/* ============ scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ responsive ============ */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { order: -1; }
  .projects-grid { grid-template-columns: 1fr; }
  .passions-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 22px; }
}
@media (max-width: 560px) {
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 0.84rem; }
  .project-card, .more-card-inner, .passion-card { padding: 26px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroll-hint-line { animation: none; }
}
