﻿:root {
  --bg: #f6f3ef;
  --bg-elevated: #fffcf8;
  --bg-warm: #efe8df;
  --text: #1c1917;
  --text-soft: #57534e;
  --accent: #0f766e;
  --accent-deep: #115e59;
  --accent-glow: rgba(15, 118, 110, 0.18);
  --gold: #b8860b;
  --gold-soft: rgba(184, 134, 11, 0.12);
  --line: rgba(28, 25, 23, 0.08);
  --shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  --shadow-hover: 0 20px 50px rgba(15, 118, 110, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 800px;
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 5.5rem;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

@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;
  }

  .hero-visual,
  .pillar-image {
    animation: none !important;
  }
}

body.page {
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(15, 118, 110, 0.06), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 40%, var(--gold-soft), transparent 45%);
  min-height: 100vh;
}

@keyframes motion-rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes motion-slide-down {
  from {
    opacity: 0;
    transform: translateY(-0.65rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 0.85;
  }
}

@keyframes hero-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

@keyframes tagline-shift {
  0%,
  100% {
    letter-spacing: 0.01em;
  }
  50% {
    letter-spacing: 0.04em;
  }
}

@keyframes pillar-shimmer {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-30%) skewX(-12deg);
  }
  45% {
    opacity: 0.14;
    transform: translateX(120%) skewX(-12deg);
  }
  46% {
    opacity: 0;
  }
}

@keyframes dot-settle {
  from {
    transform: scale(0.35);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.65rem 0;
  background: rgba(246, 243, 239, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

@media (prefers-reduced-motion: no-preference) {
  .site-header {
    animation: motion-slide-down 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }
}

.lang-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  align-items: center;
}

.lang-btn {
  padding: 0.35rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-soft);
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}

.lang-btn:active {
  transform: translateY(0) scale(0.97);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.lang-separator {
  color: var(--line);
  font-weight: 300;
  user-select: none;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.section {
  padding: var(--space-xl) 0;
}

.section-head {
  margin-bottom: var(--space-md);
}

.section-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .pillars .section-head {
    animation: motion-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.28s backwards;
  }

  .pillars > .pillar:nth-child(2) {
    animation: motion-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.38s backwards;
  }

  .pillars > .pillar:nth-child(3) {
    animation: motion-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.52s backwards;
  }

  .pillars > .pillar:nth-child(4) {
    animation: motion-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.66s backwards;
  }
}

.hero {
  position: relative;
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-xl);
  overflow: hidden;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-visual {
    animation: hero-breathe 14s ease-in-out infinite;
  }
}

.light-beam {
  position: absolute;
  width: min(45vw, 280px);
  height: 140%;
  top: -20%;
  left: 8%;
  background: linear-gradient(
    165deg,
    transparent 0%,
    rgba(15, 118, 110, 0.12) 35%,
    rgba(15, 118, 110, 0.04) 70%,
    transparent 100%
  );
  transform: rotate(-12deg);
  filter: blur(36px);
  animation: beam-drift 14s ease-in-out infinite;
}

.beam-2 {
  left: 42%;
  background: linear-gradient(
    165deg,
    transparent 0%,
    rgba(184, 134, 11, 0.14) 40%,
    rgba(184, 134, 11, 0.04) 75%,
    transparent 100%
  );
  transform: rotate(8deg);
  animation: beam-drift-2 16s ease-in-out infinite;
}

.beam-3 {
  left: 72%;
  width: min(35vw, 200px);
  transform: rotate(-6deg);
  animation: beam-drift-3 18s ease-in-out infinite;
}

@keyframes beam-drift {
  0%,
  100% {
    transform: rotate(-12deg) translateY(0) scale(1);
  }
  50% {
    transform: rotate(-10deg) translateY(24px) scale(1.03);
  }
}

@keyframes beam-drift-2 {
  0%,
  100% {
    transform: rotate(8deg) translateY(0);
  }
  50% {
    transform: rotate(6deg) translateY(18px);
  }
}

@keyframes beam-drift-3 {
  0%,
  100% {
    transform: rotate(-6deg) translateY(0);
  }
  50% {
    transform: rotate(-4deg) translateY(22px);
  }
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-sm);
  color: var(--text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  .hero h1 {
    animation: motion-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }
}

.hero h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: var(--space-md) auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), transparent);
  opacity: 0.85;
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  .hero h1::after {
    animation: line-draw 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.22s backwards;
  }
}

.tagline {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.2vw, 1.45rem);
  font-style: italic;
  font-weight: 400;
  color: var(--text-soft);
  max-width: none;
  margin-inline: auto;
  padding-inline: var(--space-xs);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .tagline {
    animation: motion-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards,
      tagline-shift 10s ease-in-out 1s infinite;
  }
}

.pillars.section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  padding-top: var(--space-lg);
}

.pillars .section-head {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .pillars.section {
    grid-template-columns: 1fr;
  }
}

.pillar {
  position: relative;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.pillar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.25), transparent 40%, rgba(184, 134, 11, 0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pillar:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.2);
}

.pillar:hover::before {
  opacity: 1;
}

.pillar-image {
  height: 128px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .pillar-image::after {
    content: "";
    position: absolute;
    inset: -20% -40%;
    background: linear-gradient(
      105deg,
      transparent 0%,
      rgba(255, 255, 255, 0.55) 48%,
      rgba(255, 255, 255, 0.1) 52%,
      transparent 100%
    );
    animation: pillar-shimmer 7s ease-in-out infinite;
  }

  .pillar:nth-child(2) .pillar-image::after {
    animation-delay: -2s;
  }

  .pillar:nth-child(3) .pillar-image::after {
    animation-delay: -4s;
  }

  .pillar:nth-child(4) .pillar-image::after {
    animation-delay: -1.2s;
  }
}

.incontro-img {
  background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 45%, #a7f3d0 100%);
}

.incontro-img::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translate(-50%, -50%) rotate(-28deg);
  opacity: 0.5;
}

.incontro-img::after {
  content: "";
  position: absolute;
  top: 28%;
  left: 28%;
  width: 44%;
  aspect-ratio: 1;
  border: 2px solid rgba(15, 118, 110, 0.25);
  border-radius: 50%;
}

.protezione-img {
  background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
}

.protezione-img::before {
  content: "";
  position: absolute;
  bottom: 18%;
  left: 16%;
  right: 16%;
  height: 58%;
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.12) 0%, rgba(180, 83, 9, 0.04) 100%);
  border-radius: 50% 50% 0 0;
}

.organizzazione-img {
  background: linear-gradient(145deg, #f5f5f4 0%, #e7e5e4 50%, #d6d3d1 100%);
}

.organizzazione-img::before {
  content: "";
  position: absolute;
  inset: 22%;
  background: linear-gradient(90deg, transparent 49%, rgba(87, 83, 78, 0.15) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(87, 83, 78, 0.15) 50%, transparent 51%);
  background-size: 18px 18px;
  border-radius: 4px;
}

.pillar h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: var(--space-xs);
}

.pillar p {
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.timeline {
  position: relative;
  border-top: 1px solid var(--line);
  padding-top: var(--space-xl);
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 1.375rem minmax(5.25rem, 7.25rem) minmax(0, 1fr);
  column-gap: 1rem;
  align-items: start;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-axis {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 0.2rem;
  min-height: 2.5rem;
}

.timeline-axis::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.55rem;
  bottom: calc(-1 * var(--space-md));
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--accent) 0%, rgba(184, 134, 11, 0.45) 45%, var(--accent-deep) 100%);
  border-radius: 2px;
  opacity: 0.45;
  pointer-events: none;
}

.timeline-item:last-child .timeline-axis::before {
  bottom: 0.35rem;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.timeline-body {
  min-width: 0;
}

.timeline-copy {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.timeline-kw {
  color: var(--accent-deep);
  font-weight: 600;
  font-style: normal;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 118, 110, 0.22);
}

@media (prefers-reduced-motion: no-preference) {
  .timeline.section > h3 {
    animation: motion-rise 0.68s cubic-bezier(0.22, 1, 0.36, 1) 0.74s backwards;
  }

  .timeline-item:nth-child(1) {
    animation: motion-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.84s backwards;
  }

  .timeline-item:nth-child(1) .timeline-dot {
    animation: dot-settle 0.58s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s backwards;
  }

  .timeline-item:nth-child(2) {
    animation: motion-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.96s backwards;
  }

  .timeline-item:nth-child(2) .timeline-dot {
    animation: dot-settle 0.58s cubic-bezier(0.34, 1.56, 0.64, 1) 1.02s backwards;
  }

  .timeline-item:nth-child(3) {
    animation: motion-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 1.08s backwards;
  }

  .timeline-item:nth-child(3) .timeline-dot {
    animation: dot-settle 0.58s cubic-bezier(0.34, 1.56, 0.64, 1) 1.14s backwards;
  }

  .languages.section > h3 {
    animation: motion-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 1.02s backwards;
  }

  .lang-item:nth-child(1) {
    animation: motion-rise 0.58s cubic-bezier(0.22, 1, 0.36, 1) 1.1s backwards;
  }

  .lang-item:nth-child(2) {
    animation: motion-rise 0.58s cubic-bezier(0.22, 1, 0.36, 1) 1.18s backwards;
  }

  .lang-item:nth-child(3) {
    animation: motion-rise 0.58s cubic-bezier(0.22, 1, 0.36, 1) 1.26s backwards;
  }

  .education.section > h3 {
    animation: motion-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 1.12s backwards;
  }

  .edu-list {
    animation: motion-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.22s backwards;
  }

  .contact.section > h3 {
    animation: motion-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 1.2s backwards;
  }

  .cta-email {
    animation: motion-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 1.3s backwards;
  }

  .site-footer {
    animation: motion-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 1.38s backwards;
  }
}

@media (max-width: 640px) {
  .timeline-item {
    grid-template-columns: 1rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
  }

  .timeline-axis {
    grid-row: 1 / span 2;
    padding-top: 0.35rem;
    align-self: stretch;
    min-height: 100%;
  }

  .timeline-axis::before {
    top: 0.5rem;
    bottom: calc(-1 * var(--space-md) - 2px);
  }

  .timeline-item:last-child .timeline-axis::before {
    bottom: 0.5rem;
  }

  .year {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    padding-top: 0;
  }

  .timeline-body {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 400px) {
  .timeline-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .timeline-axis {
    display: none;
  }

  .year {
    padding-left: 0.65rem;
    border-left: 3px solid var(--accent);
    text-align: left;
  }

  .timeline-body {
    padding-left: 0.65rem;
    border-left: 3px solid transparent;
  }
}

.timeline h3,
.languages h3,
.education h3 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  text-align: left;
}

.contact h3 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  text-align: center;
}

.year {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.45;
  padding-top: 0.2rem;
  word-break: break-word;
}

.languages {
  border-top: 1px solid var(--line);
}

.lang-grid {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.55rem 1rem;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.lang-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.18);
}

.lang-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.lang-level {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.lang-level[data-lang] {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.education {
  border-top: 1px solid var(--line);
}

.edu-list {
  list-style: none;
}

.edu-list li {
  padding: 0.55rem 0;
  padding-left: 1.35rem;
  font-size: 0.95rem;
  color: var(--text-soft);
  position: relative;
  line-height: 1.5;
}

.edu-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact {
  position: relative;
  text-align: center;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.contact-visual {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, var(--accent-glow), transparent 55%),
    radial-gradient(ellipse 60% 40% at 20% 30%, var(--gold-soft), transparent 50%);
  z-index: 0;
  pointer-events: none;
}

.contact h3,
.cta-email {
  position: relative;
  z-index: 1;
}

.cta-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--bg-elevated);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  margin-bottom: var(--space-sm);
  box-shadow: 0 8px 28px var(--accent-glow);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.25s ease;
}

.cta-email:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px rgba(15, 118, 110, 0.32);
  filter: saturate(1.08);
}

.cta-email:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.site-footer {
  text-align: center;
  padding: var(--space-lg) var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-soft);
  border-top: 1px solid var(--line);
  background: rgba(239, 232, 223, 0.5);
}

[hidden] {
  display: none !important;
}
