/* Mobile-first animations using CSS instead of JS */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0% 0);
  }
}

@keyframes card {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }

  50% {
    background-position: 0 0;
  }

  100% {
    background-position: 100% 0;
  }
}

/* Removed unused marquee and legacy wheelMove keyframes */
/* Animation classes for progressive enhancement */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

.animate-reveal {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.8s ease, clip-path 0.8s ease;
}

.animate-reveal.in-view {
  opacity: 1;
  clip-path: inset(0 0 0% 0);
}

.animate-card {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-card.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Optimized hero animations */
.hero-sub.smooth-loop {
  animation: hero-shimmer 8s ease-in-out infinite;
  animation-play-state: running;
}

@media (prefers-reduced-motion: reduce) {
  .hero-sub.smooth-loop {
    animation: none;
  }
}

/* Removed old marquee and duplicate wheel animation declarations */

/* Mobile-first styles for Professor Kineto Single Page */
:root {
  --bg: #0c0d11;
  --fg: #f0f2f5;
  --muted: #a9afb9;
  --accent: #6B4F3A;
  /* Accent Color */
  --teal: #19d3da;
  --amber: #ffc107;
  --border: rgba(255, 255, 255, 0.12);
  --link: #D3B84E;
  /* Link Color */
  --title: #F6E3B4;
  /* Title Color */
  --dark: #1C1C2A;
  /* DARK COLOR */
  --light-gray: #A0A8B0;
  /* Light Gray */
}

/* Native smooth scrolling (Lenis removed) */
html {
  scroll-behavior: smooth;
}
a {text-decoration: none;}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Federo', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg) url('./bg-film-scratches.gif?v=20251024b') top left / 800px auto repeat fixed;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1.15rem;
}

/* Titles font: Diplomata */
h1,
h2,
h3,
h4,
.hero-title,
.section-head h2,
.feature-card h3,
.card .card-body h3,
.contact-card h3 {
  font-family: 'Diplomata', cursive;
  font-weight: 400;
}

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

.container {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

/* Header block deduped; using fixed header rules below */

.brand {
  font-weight: 700;
  letter-spacing: .4px;
}

.nav-toggle {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  z-index: 60;
}

/* Desktop nav inline */
.site-nav {
  display: none;
  gap: 12px;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
}

.site-nav a.active {
  background: var(--accent);
  border-color: transparent;
}

@media (min-width: 880px) {

  /* Desktop: inline nav */
  .site-nav {
    display: flex;
  }

  .site-nav a {
    width: auto;
    max-width: none;
    font-size: 14px;
    padding: 6px 10px;
  }

  .nav-toggle {
    display: none;
  }
}

/* Mobile overlay nav */
.nav-overlay[hidden] {
  display: none;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(73, 73, 73, 0.95);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.nav-overlay-inner {
  display: contents;
}

.nav-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.nav-close {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.nav-overlay-menu {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px calc(env(safe-area-inset-bottom) + 24px);
  display: grid;
  gap: 12px;
  align-content: start;
  background: rgba(0, 0, 0, 0.8);
}

.nav-overlay-menu a {
  color: var(--fg);
  text-decoration: none;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 18px;
  text-align: center;
}

/* Sections */
.section {
  padding: 60px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 8, 4, 0.85);
  scroll-margin-top: 72px;
  /* prevent fixed header overlap on anchor */
}

.section.alt {
  background: rgba(0, 0, 4, 0.9);
}

.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.2;
}

.section-head h2 {
  color: var(--title);
}

.section .text-cols {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .section .text-cols {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* Sticky Group (USP) */
.sticky-group {
  position: relative;
}

.sticky-group .sticky-wrapper {
  position: relative;
  height: 260vh;
}

.sticky-group .sticky-panel {
  position: sticky;
  top: 72px;
  min-height: calc(100vh - 72px);
  display: grid;
  place-content: center;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transform: scale(0.98);
  opacity: 0;
  transition: opacity 600ms ease, transform 600ms cubic-bezier(.22, 1, .36, 1);
}

.sticky-group .sticky-panel.in {
  opacity: 1;
  transform: scale(1);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.btn-small {
  padding: 6px 10px;
  font-size: 14px;
}

/* Hover/Focus states */
.btn,
.site-nav a,
.nav-overlay-menu a,
.footer-nav a,
.section a:not(.btn) {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .12s ease;
}

.btn:hover {
  color: var(--link);
  border-color: var(--link);
  background-color: rgba(255, 255, 255, 0.04);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: #5E4634;
}

.btn-primary:active {
  background: #523E2E;
  transform: translateY(1px);
}

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

.site-nav a:hover {
  color: var(--link);
  border-color: var(--link);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.nav-overlay-menu a:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.86);
}

.nav-overlay-menu a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.section a:not(.btn):hover {
  text-decoration: underline;
  color: var(--link);
}

.section a:not(.btn):focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 6px;
}

.footer-nav a:hover {
  color: var(--link);
}

.footer-nav a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Blockquote as card */
.quote {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(28, 28, 42, 0.42);
  padding: 16px 16px 16px 16px;
  margin: 25px 0 0;
  color: var(--fg);
  font-style: italic;
}

.quote::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 12px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: rgba(16, 16, 24, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  background-image: url('favicon.png?v=20251024b');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

@media (min-width: 720px) {
  .quote {
    padding: 18px 20px 18px 20px;
  }
}

/* Back to Top button */
.back-to-top {
  position: fixed;
  right: clamp(12px, 3vw, 18px);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1100;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(16, 16, 24, 0.8);
  color: var(--fg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(1.1) blur(6px);
  -webkit-backdrop-filter: saturate(1.1) blur(6px);
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, transform .12s ease, box-shadow .2s ease;
}

.back-to-top img {
  width: 24px;
  height: 24px;
  display: block;
}

.back-to-top:hover {
  background: rgba(28, 28, 42, 0.9);
  border-color: var(--link);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.back-to-top:active {
  transform: translateY(1px) scale(0.98);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

/* Hero */
.hero #film {
  padding-top: 40px;
  padding-bottom: 30px;
  background: radial-gradient(circle at 50% 40%, rgba(40, 30, 15, 1), rgba(38, 23, 20, 0));
  position: relative;
  /* enable overlay */
}

/* Radial vignette with transparent center over the hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Transparent center, dark edges */
  background: radial-gradient(circle at 50% 40%,
      rgba(0, 0, 0, 0) 38%,
      rgba(0, 0, 0, 0.25) 65%,
      rgba(0, 0, 0, 0.55) 100%);
}

/* Sticky header: hidden on load, revealed after first scroll */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transform: translateY(-110%);
  transition: transform 400ms cubic-bezier(.22, 1, .36, 1), background-color 240ms ease, box-shadow 240ms ease;
  background: rgba(12, 13, 17, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.site-header.header-visible {
  transform: translateY(0);
  background: rgba(12, 13, 17, 0.72);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

/* HERO */
.hero-title {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Mobile-friendly infinite loop animation for the title text */
.hero-title>span {
  display: inline-block;
  color: rgba(0, 0, 0, 0.3);
  /* BLACK @ 0.3 opacity */
  animation: heroTitleLoop 8s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes heroTitleLoop {
  0% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }

  100% {
    transform: translateY(0)
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title>span {
    animation: none;
  }
}

.hero-title {
  color: var(--title);
}

.hero-sub {
  color: var(--muted);
  margin: 0 0 16px;
}

.hero-sub.smooth-loop {
  text-align: center;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  position: relative;
  overflow: visible;
}

.hero-sub.smooth-loop::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.08) 70%, rgba(255, 255, 255, 0) 100%);
  mix-blend-mode: screen;
  opacity: .7;
  background-size: 200% 100%;
  background-position: -100% 0;
  animation: hero-shimmer 10s ease-in-out infinite;
}

@keyframes hero-shimmer {
  0% {
    background-position: -100% 0;
  }

  50% {
    background-position: 0 0;
  }

  100% {
    background-position: 100% 0;
  }
}

.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-media {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Hero Scroll Down indicator */
.hero-scroll-down {
  display: grid;
  place-items: center;
  padding: 16px 0 24px;
}

.scroll-down-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
}

.scroll-down-btn:hover {
  color: var(--link);
}

.scroll-down-btn:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 8px;
}

.scroll-down-btn .mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: start center;
  padding-top: 6px;
}

.scroll-down-btn .wheel {
  width: 3px;
  height: 8px;
  background: var(--muted);
  border-radius: 2px;
  animation: wheel-move 1.8s ease-in-out infinite;
}

.scroll-down-btn .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

@keyframes wheel-move {
  0% {
    transform: translateY(0);
    opacity: .8;
  }

  50% {
    transform: translateY(8px);
    opacity: 1;
  }

  100% {
    transform: translateY(0);
    opacity: .8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-down-btn .wheel {
    animation: none;
  }
}

/* Hero scrolling title below logo */
.hero-scroll {
  color: #000;
  opacity: .25;
  overflow: hidden;
  margin-top: 10px;
}

.hero-scroll .marquee-track {
  display: inline-flex;
  gap: 2rem;
  white-space: nowrap;
  will-change: transform;
  animation: hero-marquee 24s linear infinite;
}

@keyframes hero-marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Features / Cards */
.features {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 16px;
  scroll-padding-left: 16px;
  -webkit-overflow-scrolling: touch;
}

/* When used as Glide slides, force flex to avoid grid overrides */
.glide__slides.features {
  display: flex !important;
  gap: 0;
  /* gap handled by Glide's JS option */
}

/* Remove list padding/margins that offset centering in the carousel context */
#sticky-usp .glide__slides.features,
#spettacolo .glide__slides.features {
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Ensure container doesn't clip the 10% peek */
#sticky-usp .container,
#spettacolo .container {
  overflow: visible;
}

/* Make slides flex so cards can stretch to available width */
#sticky-usp .glide,
#spettacolo .glide {
  overflow: visible;
}

#sticky-usp .glide__slide,
#spettacolo .glide__slide {
  display: flex;
  padding: 0 14px;
}

/* For spettacolo, let Glide's gap handle spacing to keep centering exact */
#spettacolo .glide__slide {
  padding: 0;
}

#sticky-usp .glide__slide .feature-card,
#spettacolo .glide__slide .feature-card {
  width: 100%;
  flex: 1 0 auto;
  /* override base flex-basis to fill slide */
  max-width: 100%;
  aspect-ratio: 16 / 9;
  /* fixed proportion */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  position: relative;
}

#sticky-usp .glide__slide .feature-card::before,
#spettacolo .glide__slide .feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--card-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .5;
  z-index: 0;
  pointer-events: none;
}

#sticky-usp .glide__slide .feature-card>*,
#spettacolo .glide__slide .feature-card>* {
  position: relative;
  z-index: 1;
}

/* Background set via --card-bg for each card */

/* Non-carousel features grid: keep same visual treatment */
.features:not(.glide__slides) .feature-card {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.features:not(.glide__slides) .feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--card-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .5;
  z-index: 0;
  pointer-events: none;
}

.features:not(.glide__slides) .feature-card>* {
  position: relative;
  z-index: 1;
}

/* Match visual treatment for generic .card items in features grid */
.features:not(.glide__slides) .card {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.features:not(.glide__slides) .card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--card-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .5;
  z-index: 0;
  pointer-events: none;
}

.features:not(.glide__slides) .card>* {
  position: relative;
  z-index: 1;
}

@media (min-width: 600px) {
  #sticky-usp .glide__slide {
    padding: 0 16px;
  }
}

@media (min-width: 1024px) {
  #sticky-usp .glide__slide {
    padding: 0 20px;
  }
}

/* Center controls and style arrows/bullets with dark palette */
#sticky-usp .glide,
#spettacolo .glide {
  position: relative;
  width: 100vw;
  /* full-bleed to viewport */
  margin-left: calc(50% - 50vw);
  /* break out of container padding */
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
}

#sticky-usp .glide__track,
#spettacolo .glide__track {
  overflow: visible;
}

#sticky-usp .glide__arrows,
#spettacolo .glide__arrows {
  position: absolute;
  inset: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  /* allow click only on arrows */
  padding: 0 8px;
}

#sticky-usp .glide__arrow,
#spettacolo .glide__arrow {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(16, 16, 24, 0.8);
  color: var(--text, #fff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  backdrop-filter: saturate(1.1) blur(6px);
  -webkit-backdrop-filter: saturate(1.1) blur(6px);
  transition: background-color .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  pointer-events: auto;
}

#sticky-usp .glide__arrow:hover,
#sticky-usp .glide__arrow:focus-visible,
#spettacolo .glide__arrow:hover,
#spettacolo .glide__arrow:focus-visible {
  background: rgba(28, 28, 42, 0.9);
  border-color: var(--link, #8cb7ff);
  outline: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45), 0 0 0 2px color-mix(in lab, var(--link, #8cb7ff) 40%, transparent);
}

#sticky-usp .glide__arrow:active,
#spettacolo .glide__arrow:active {
  transform: translateY(1px) scale(.98);
}

#sticky-usp .glide__arrow[disabled],
#spettacolo .glide__arrow[disabled] {
  opacity: .45;
  cursor: default;
}

#sticky-usp .glide__bullets,
#spettacolo .glide__bullets {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Slider card text color */
#sticky-usp .glide__slide .feature-card p,
#spettacolo .glide__slide .feature-card p {
  color: #FFFFFF;
}

#sticky-usp .glide__bullet,
#spettacolo .glide__bullet {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .35);
  transition: background-color .2s ease, border-color .2s ease, transform .15s ease, width .2s ease;
}

#sticky-usp .glide__bullet:hover,
#sticky-usp .glide__bullet:focus-visible,
#spettacolo .glide__bullet:hover,
#spettacolo .glide__bullet:focus-visible {
  background: rgba(255, 255, 255, .6);
  border-color: var(--link, #8cb7ff);
  outline: none;
}

#sticky-usp .glide__bullet--active,
#sticky-usp .glide__bullet[aria-current="true"],
#spettacolo .glide__bullet--active,
#spettacolo .glide__bullet[aria-current="true"] {
  width: 22px;
  background: var(--text, #fff);
  border-color: var(--link, #8cb7ff);
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  background: rgba(28, 28, 42, 0.42);
  opacity: 1;
  transform: none;
  transition: box-shadow .25s ease, border-color .25s ease, background-color .25s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
  scroll-snap-align: center;
  flex: 0 0 min(85%, 420px);
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(246, 227, 180, 0.35);
  background-color: rgba(28, 28, 42, 0.48);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  outline: none;
}

.feature-card h3 {
  margin: 0 0 8px;
  color: var(--title);
  font-size: clamp(16px, 2.2vw, 20px);
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card .card-body h3 {
  font-size: clamp(16px, 2.2vw, 20px);
}

/* Horizontal features: snap carousel on small screens, grid on large */
@media (min-width: 900px) {
  .features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    scroll-snap-type: none;
    padding: 0;
  }

  .feature-card {
    scroll-snap-align: initial;
    flex: initial;
  }

  /* Keep carousel layout as flex on desktop when inside Glide */
  .glide__slides.features {
    display: flex !important;
  }
}

/* Optional: subtle scrollbar styling */
.features::-webkit-scrollbar {
  height: 8px;
}

.features::-webkit-scrollbar-track {
  background: transparent;
}

.features::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

/* Horizontal slides removed per request */

/* Phone layout: place text under the image inside Glide slides */
@media (max-width: 599px) {

  /* Turn the card into a simple two-row grid: image (from ::before) + text */
  #sticky-usp .glide__slide .feature-card,
  #spettacolo .glide__slide .feature-card {
    display: grid;
    grid-template-rows: auto auto;
    align-items: start;
    aspect-ratio: auto;
    /* let content define height */
    padding: 18px 12px;
    /* extra top/bottom padding on mobile */
    text-align: center;
  }

  /* Make ::before a block element occupying the first row (image on top) */
  #sticky-usp .glide__slide .feature-card::before,
  #spettacolo .glide__slide .feature-card::before {
    position: static;
    /* participate in layout instead of overlay */
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    opacity: .85;
    /* show the image more strongly on mobile */
    border-radius: 8px;
    margin-bottom: 10px;
  }

  /* Tighten mobile spacing for titles and text */
  #sticky-usp .glide__slide .feature-card h3,
  #spettacolo .glide__slide .feature-card h3 {
    margin: 0 0 6px;
  }

  #sticky-usp .glide__slide .feature-card p,
  #spettacolo .glide__slide .feature-card p {
    margin: 0;
  }
}

/* Visibility helpers */
.hide-on-mobile {
  display: block;
}

@media (max-width: 899px) {
  .hide-on-mobile {
    display: none;
  }
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(28, 28, 42, 0.38);
}

.card-body {
  padding: 12px;
}

/* Card responsive video embed */
.card-embed {
  background: #000;
}

.card-embed_inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

  .card-embed_inner iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }

  /* Lite YouTube embed placeholder */
  .card-embed_inner .yt-lite {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background-color: #000;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    cursor: pointer;
    outline: none;
  }

  .card-embed_inner .yt-lite::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
  }

  .card-embed_inner .yt-lite::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 26px solid #ffffff;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    filter: drop-shadow(0 3px 10px rgba(0,0,0,.6));
    transition: transform .15s ease, filter .2s ease;
  }

  .card-embed_inner .yt-lite:hover::after,
  .card-embed_inner .yt-lite:focus-visible::after {
    transform: translate(-50%, -50%) scale(1.06);
    filter: drop-shadow(0 5px 14px rgba(0,0,0,.7));
  }

  .card-embed_inner .yt-lite:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
    border-radius: 8px;
  }

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Optimized SVG animation using CSS */
.logo-wrap {
  display: grid;
  place-items: center;
  min-height: 40vh;
}

/* Disable container-level animations for logo */
.logo-wrap.animate-reveal {
  opacity: 1 !important;
  clip-path: none !important;
  transition: none !important;
  overflow: visible !important;
}

/* Hide logo until SVG is ready to prevent flicker */
.logo-wrap { visibility: hidden; }
.logo-wrap.logo-ready { visibility: visible; }

.logo-wrap svg {
  width: min(90vw, 720px);
  max-width: 100%;
  height: auto;
  display: block;
  /* FORCE NO ANIMATION ON CONTAINER */
  transform: none !important;
  animation: none !important;
  overflow: visible !important;
}

/* Sequential animation for SVG elements - each element animates independently */
.logo-wrap svg .d {
  /* Set transform origin to center for proper scaling */
  transform-origin: center center;
}

/* Per-path animations applied via JS; no default CSS animation here */

@keyframes whiteElementReveal {
  0% {
    opacity: 0;
    transform: translateY(80px) scale(0.6);
    filter: blur(5px);
  }

  50% {
    opacity: 0.7;
    transform: translateY(-20px) scale(1.12);
    filter: blur(1.5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

/* Stronger reveal for the initial letter (hero) */
@keyframes whiteElementRevealHero {
  0% {
    opacity: 0;
    transform: translateY(100px) scale(0.55);
    filter: blur(6px);
  }

  45% {
    opacity: 0.85;
    transform: translateY(-30px) scale(1.2);
    filter: blur(1.6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

/* Removed logoReveal - only individual elements animate */

@keyframes elementReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Deduped: keep the translateY-based whiteElementReveal above */

@keyframes blackElementReveal {
  0% {
    opacity: 0;
    transform: scale(0.85) rotate(2deg);
    filter: blur(2px) brightness(0.9);
  }

  60% {
    opacity: 0.6;
    transform: scale(1.03) rotate(-0.5deg);
    filter: blur(0.5px) brightness(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px) brightness(1);
  }
}

/* Mobile-first performance optimizations */
@media (max-width: 899px) {

  /* Reduce motion on mobile for better performance */
  .hero-sub.smooth-loop {
    animation: none;
  }

  .hero-scroll .marquee-track {
    animation: none;
  }

  .scroll-down-btn .wheel {
    animation: none;
  }

  /* Simplify card hover effects on touch */
  .feature-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  /* Optimize scroll performance */
  .features {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Reduce font loading on mobile */
  body {
    font-display: swap;
  }
}

/* Removed unused CSS for performance - selectors no longer exist in HTML */

/* Optimize images for mobile */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Critical path optimizations */
.section {
  contain: layout style paint;
  /* CSS containment for better performance */
}

/* Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}



/* A11y utility */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Contact form - dark elegant */
.contact-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.contact-form .field {
  display: grid;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 44px;
  /* touch target */
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}

.contact-form input:disabled,
.contact-form textarea:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.contact-form .contact-submit {
  width: 100%;
  min-height: 46px;
  font-weight: 600;
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.contact-form .contact-submit:hover {
  background: #5E4634;
  /* darker accent hover to match existing btn-primary hover */
}

.contact-form .contact-submit:active {
  background: #523E2E;
  transform: translateY(1px);
}

.contact-form .contact-submit:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Autofill adjustments */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.35) inset;
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
}

/* Footer */
.site-footer {
  padding: 30px 0;
}

.footer-social {
  display: inline-block;
}

.footer-social img {
  width: 60px;
  height: 60px;
}

.footer-badge {
  height: 16px;
  vertical-align: middle;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.ga {
  text-align: center;
  margin-bottom: 6px;
  margin-top: 6px;
  font-size: 15px;
  color: #004400;
}

/* Content link color (avoid nav/buttons) */
.section a:not(.btn) {
  color: var(--link);
}

/* Animations placeholders (GSAP hooks) */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(14px);
}

[data-animate="reveal"] {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
}

[data-animate="card"] {
  opacity: 0;
  transform: translateY(12px) scale(.98);
}

[data-animate="split-skew"] {
  display: inline-block;
}

/* Professor Section with Fixed Background */
.professor-section {
  min-height: 50vh;
  background-image: url('../images/kineto-hat.jpg?v=20251024b');
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  /* Dark overlay for better text readability */
  background-color: rgba(0, 0, 0, 0.4);
  background-blend-mode: multiply;
}

.professor-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(12, 13, 17, 0.7) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(12, 13, 17, 0.7) 100%
  );
  z-index: 1;
}

.professor-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.professor-section .section-head h2 {
  color: var(--title);
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.professor-text {
  color: var(--fg);
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  opacity: 0.95;
}

.professor-text p {
  margin: 0;
}
