/* ============================================================
   Antonio Della Rosa — sito personale
   Tema scuro/chiaro con variabili CSS, responsive, no framework.
   ============================================================ */

:root {
  --bg: #0f1115;
  --bg-soft: #171a21;
  --bg-card: #1c2029;
  --text: #e8eaf0;
  --text-soft: #a3a9b8;
  --accent: #6c8cff;
  --accent-2: #9d6cff;
  --border: #2a2f3b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --header-bg: rgba(15, 17, 21, 0.8);
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #eef0f6;
  --bg-card: #ffffff;
  --text: #1b1e27;
  --text-soft: #5a6172;
  --accent: #3b63e0;
  --accent-2: #7a3ff2;
  --border: #e2e5ee;
  --shadow: 0 10px 30px rgba(30, 40, 80, 0.10);
  --header-bg: rgba(246, 247, 251, 0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.nav__logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
}
.nav__logo span { color: var(--accent); }
.nav__logo:hover { text-decoration: none; }

.nav__links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin-left: auto;
}
.nav__links a {
  color: var(--text-soft);
  font-weight: 500;
  transition: color 0.2s;
}
.nav__links a:hover, .nav__links a.active { color: var(--accent); text-decoration: none; }

.nav__toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.theme-toggle {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.theme-toggle:hover { transform: scale(1.1); }

/* ---------- Hero ---------- */
.hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
}

.hero__hi { color: var(--text-soft); font-size: 1.2rem; }

.hero__name {
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__tagline { font-size: clamp(1.05rem, 2.5vw, 1.4rem); color: var(--text-soft); max-width: 640px; }

.hero__cta { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--bg-soft); }

/* ---------- Sezioni ---------- */
.section { padding: 90px 24px; }

.section__title {
  font-size: 2rem;
  margin-bottom: 36px;
  position: relative;
  display: inline-block;
}
.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- Chi sono ---------- */
.about {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.about__photo img {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.about__photo--empty {
  width: 260px; height: 260px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  background: var(--bg-soft);
}

.about__text p { margin-bottom: 14px; color: var(--text-soft); }
.about__facts { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Progetti ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }

.filter {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter.is-active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.card.hidden { display: none; }

.card__title { font-size: 1.2rem; }
.card__desc { color: var(--text-soft); font-size: 0.95rem; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.card__footer { display: flex; gap: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.card__link { font-weight: 600; font-size: 0.92rem; }

/* ---------- Curriculum ---------- */
.cv { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.cv__subtitle { margin: 24px 0 16px; font-size: 1.15rem; color: var(--accent); }
.cv__subtitle:first-child { margin-top: 0; }

.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 26px; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -22px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.timeline__date { font-size: 0.82rem; color: var(--accent-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.timeline__item h4 { font-size: 1.05rem; margin: 2px 0; }
.timeline__org { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 4px; }
.timeline__item p:last-child { color: var(--text-soft); font-size: 0.93rem; }

.skills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-bottom: 26px; }
.skills li {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.cv__download { margin-top: 4px; }

/* ---------- Contatti ---------- */
.contact { max-width: 560px; }
.contact__intro { color: var(--text-soft); margin-bottom: 20px; }

.socials { display: flex; gap: 18px; list-style: none; margin-bottom: 30px; flex-wrap: wrap; }
.socials a { font-weight: 600; }

.contact__form { display: flex; flex-direction: column; gap: 12px; }
.contact__form input, .contact__form textarea {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.contact__form input:focus, .contact__form textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}
.contact__form .btn { align-self: flex-start; border: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ---------- Animazioni ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 8px 0;
  }
  .nav__links.open { display: flex; }
  .nav__links li { padding: 4px 24px; }
  .nav__links a { display: block; padding: 10px 0; }

  .about { grid-template-columns: 1fr; }
  .about__photo img, .about__photo--empty { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; }
  .cv { grid-template-columns: 1fr; gap: 8px; }
  .section { padding: 64px 24px; }
  .hero { min-height: 62vh; }
}
