/* ============================================
   Leonardo Forconi — DNA Blue + Life Green
   ============================================ */

:root {
  --primary: #0EA5E9;
  --primary-dark: #0284C7;
  --accent: #059669;
  --accent-light: #10B981;
  --bg: #F0F9FF;
  --fg: #0C4A6E;
  --fg-muted: #64748B;
  --card: #FFFFFF;
  --muted: #E8F2F8;
  --border: #BAE6FD;
  --shadow: 0 4px 24px rgba(14, 165, 233, 0.12);
  --shadow-lg: 0 12px 48px rgba(12, 74, 110, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --font: 'Figtree', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.3s var(--ease);
}

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* ---- HEADER ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--fg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow var(--transition);
}

.header--scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  transition: transform var(--transition);
}

.header__logo:hover img {
  transform: scale(1.05);
}

.header__nav {
  display: flex;
  gap: 2rem;
}

.header__nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
  position: relative;
  padding: 0.25rem 0;
}

.header__nav a:hover {
  color: rgba(255, 255, 255, 0.85);
}

.header__nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.header__nav a:hover::after,
.header__nav a.active::after {
  width: 100%;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
}

.btn--primary:hover {
  background: #047857;
  color: #fff;
  box-shadow: 0 6px 24px rgba(5, 150, 105, 0.45);
}

.btn--outline {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--border);
}

.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(14, 165, 233, 0.08);
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* ---- HERO ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 1rem;
}

.hero__title span {
  color: var(--primary);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
  max-width: 480px;
}

.hero__quote {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--fg-muted);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 1.25rem;
}

.hero__quote cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  color: var(--primary);
}

.hero__goal {
  font-size: 0.95rem;
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero__goal em {
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 500;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---- PHOTO FRAME ---- */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-frame {
  width: min(440px, 44vw);
}

.photo-frame__box {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 42%, var(--accent) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  animation: frameEnter 0.9s var(--ease) 0.2s forwards;
}

.photo-frame__box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 25%
  );
  pointer-events: none;
  z-index: 1;
}

.photo-frame__img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 86%;
  display: block;
  opacity: 0;
  transform: translateY(12px);
  animation: imgEnter 0.75s var(--ease) 0.45s forwards;
}

@keyframes frameEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes imgEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- SECTION HEADER ---- */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--fg-muted);
  max-width: 560px;
  margin-inline: auto;
}

/* ---- ROADMAP / TIMELINE ---- */
.roadmap {
  padding: 5rem 0;
}

.timeline-block {
  margin-bottom: 4rem;
}

.timeline-block__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.timeline-block__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  color: #fff;
}

.timeline-block__icon svg {
  width: 20px;
  height: 20px;
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1.2s var(--ease);
}

.timeline.is-visible::before {
  transform: scaleY(1);
}

.timeline__item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline__marker {
  position: absolute;
  left: -2rem;
  top: 1.25rem;
  width: 16px;
  height: 16px;
  background: var(--card);
  border: 3px solid var(--primary);
  border-radius: 50%;
  transform: translateX(-1px) scale(0);
  transition: transform 0.5s var(--ease), border-color var(--transition);
  z-index: 1;
}

.timeline__item.is-visible .timeline__marker {
  transform: translateX(-1px) scale(1);
}

.timeline__marker--current {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.25);
  animation: pulseMarker 2s ease-in-out infinite;
}

@keyframes pulseMarker {
  0%, 100% { box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.1); }
}

.timeline__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.timeline__card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.timeline__card--highlight {
  border-left: 4px solid var(--primary);
}

.timeline__card--current {
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, #fff 0%, rgba(5, 150, 105, 0.04) 100%);
}

.timeline__card time {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--muted);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.timeline__card h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.35rem;
}

.timeline__org {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.timeline__card p {
  font-size: 0.92rem;
  color: var(--fg-muted);
}

.timeline__list {
  list-style: none;
  margin-top: 0.5rem;
}

.timeline__list li {
  font-size: 0.92rem;
  color: var(--fg-muted);
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.35rem;
}

.timeline__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline__badge {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(5, 150, 105, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
}

/* ---- SKILLS ---- */
.skills {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}

.skills__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-align: center;
}

.skills__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.skill-tag {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-dark);
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}

.skill-tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.skills__langs {
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* ---- CONTACT ---- */
.contact {
  padding: 4rem 0 6rem;
}

.contact__card {
  background: linear-gradient(135deg, var(--fg) 0%, #0e3a5c 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.contact__card h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.75rem;
}

.contact__card > p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 520px;
  margin: 0 auto 2rem;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

.contact__item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background var(--transition), transform var(--transition);
}

.contact__item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.contact__item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-2px);
}

.contact__item--linkedin:hover {
  background: rgba(10, 102, 194, 0.4);
}

.contact__card .btn--primary {
  margin-top: 0.5rem;
}

/* ---- FOOTER ---- */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ---- SCROLL REVEAL ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal--delay {
  transition-delay: 0.15s;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline__item {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.timeline__item.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__subtitle,
  .hero__goal {
    margin-inline: auto;
  }

  .hero__quote {
    text-align: left;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__visual {
    order: -1;
  }

  .photo-frame {
    width: min(320px, 88vw);
  }
}

@media (max-width: 640px) {
  .header__nav {
    gap: 1.25rem;
  }

  .header__nav a {
    font-size: 0.85rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline__marker {
    left: -1.5rem;
  }
}

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

  .reveal,
  .timeline__item {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .photo-frame__box,
  .photo-frame__img,
  .timeline__marker--current {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .timeline::before {
    transform: scaleY(1);
  }

  .timeline__marker {
    transform: translateX(-1px) scale(1);
  }
}
