/* ==========================================================================
   Sebastiano Matteucci — Portfolio
   Dark tech theme · accent teal · glass cards
   ========================================================================== */

:root {
  --bg: #0a0e14;
  --bg-elevated: #0f141c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #e6edf3;
  --text-muted: #9aa4b2;
  --accent: #4de8c2;
  --accent-soft: rgba(77, 232, 194, 0.1);
  --accent-border: rgba(77, 232, 194, 0.25);
  --accent-contrast: #08251d;
  --glow: rgba(77, 232, 194, 0.1);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f7f9fb;
  --bg-elevated: #ffffff;
  --surface: rgba(15, 23, 32, 0.03);
  --surface-hover: rgba(15, 23, 32, 0.06);
  --border: rgba(15, 23, 32, 0.1);
  --border-strong: rgba(15, 23, 32, 0.2);
  --text: #16202b;
  --text-muted: #5b6673;
  --accent: #0d9d7d;
  --accent-soft: rgba(13, 157, 125, 0.08);
  --accent-border: rgba(13, 157, 125, 0.3);
  --accent-contrast: #ffffff;
  --glow: rgba(13, 157, 125, 0.07);
  --shadow: 0 20px 50px rgba(15, 23, 32, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ------------------------------ Header ------------------------------ */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.logo .dot {
  color: var(--accent);
}

.desktop-menu ul {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.desktop-menu a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.desktop-menu a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle,
.burger-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover,
.burger-menu:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

.burger-menu {
  display: none;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu ul {
  list-style: none;
  padding: 0.8rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mobile-menu a {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.mobile-menu a:hover {
  color: var(--text);
}

/* ------------------------------ Hero ------------------------------ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 55% 45% at 75% 0%, var(--glow), transparent),
    radial-gradient(ellipse 40% 35% at 10% 90%, var(--glow), transparent);
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-muted);
  min-height: 1.8em;
  margin-bottom: 1.6rem;
}

.cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-border);
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-socials {
  display: flex;
  gap: 0.5rem;
  margin-left: 0.3rem;
}

.hero-socials a,
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-socials a:hover,
.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.hero-photo {
  justify-self: center;
  position: relative;
}

.hero-photo img {
  width: min(300px, 65vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 28px;
  border: 1px solid var(--accent-border);
  opacity: 0.5;
  pointer-events: none;
}

.scroll-down {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
  40% { transform: translate(-50%, -8px); }
  60% { transform: translate(-50%, -4px); }
}

/* ------------------------------ Sections ------------------------------ */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------ About ------------------------------ */

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
  max-width: 58ch;
}

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

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.highlight-card {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.highlight-card i {
  color: var(--accent);
  font-size: 1.05rem;
  margin-top: 0.2rem;
}

.highlight-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.highlight-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ------------------------------ Skills ------------------------------ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  background: var(--surface-hover);
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.skill-card-head i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 1rem;
}

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.skill-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

/* ------------------------------ Contact ------------------------------ */

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 3rem 2rem;
  text-align: center;
  background-image: radial-gradient(ellipse 60% 80% at 50% 0%, var(--glow), transparent);
}

.contact-card h2 {
  margin-bottom: 0.6rem;
}

.contact-card > p {
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 auto 1.8rem;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
  transition: color 0.2s ease;
}

.contact-email:hover {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-links {
  display: flex;
  gap: 0.5rem;
}

/* ------------------------------ Footer ------------------------------ */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

footer .footer-links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

footer a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--accent);
}

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 820px) {
  .desktop-menu {
    display: none;
  }

  .burger-menu {
    display: inline-flex;
  }

  .hero {
    padding-top: 6rem;
    text-align: center;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }

  .hero-photo {
    order: -1;
  }

  .hero-photo img {
    width: min(220px, 55vw);
  }

  .hero-actions {
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3.5rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-down,
  .cursor {
    animation: none;
  }
}
