/* =========================================================
   Time2marketing – one page
   Palette:
   --red     #C00000  titoli, numeri chiave, cerchi numerati
   --ink     #262626  testo principale
   --grey    #929292  sottotitoli/note SOLO su fondo scuro o testo grande
   --grey-a  #5F5F5F  variante accessibile di #929292 per testo piccolo
                      su fondo chiaro (6,4:1 su bianco, 5,4:1 su #EDEDED)
   --line    #BFBFBF  bordi e linee
   --box     #EDEDED  riquadri / sezioni alternate
   ========================================================= */

:root {
  --red: #C00000;
  --red-dark: #9A0000;
  --ink: #262626;
  --grey: #929292;
  --grey-a: #5F5F5F;
  --line: #BFBFBF;
  --box: #EDEDED;
  --white: #FFFFFF;

  --font-title: "Poppins", "Open Sans", Arial, sans-serif;
  --font-text: "Open Sans", Arial, sans-serif;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;
  --radius: 4px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* slider: numero slide e durata di ciascuna */
  --slides: 5;
  --slide-time: 6s;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--red);
  line-height: 1.2;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

a { color: var(--red); }
a:hover { color: var(--red-dark); }

strong { font-weight: 600; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 16px; color: var(--white); }

.muted { color: var(--grey-a); font-size: .9375rem; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); color: var(--white); }

.btn-ghost { border-color: var(--white); color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--ink); }

.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  color: var(--white);
  transition: background-color .3s, box-shadow .3s, color .3s;
}
.site-header.is-scrolled {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

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

.logo { display: block; line-height: 0; }
.logo img { width: auto; height: 44px; }
.logo-dark,
.site-header.is-scrolled .logo-light,
.nav-open .logo-light { display: none; }
.site-header.is-scrolled .logo-dark,
.nav-open .logo-dark { display: block; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0; padding: 0;
  list-style: none;
}
.main-nav a {
  position: relative;
  display: block;
  padding: 8px 14px;
  color: inherit;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: .9375rem;
  text-decoration: none;
}
.main-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.main-nav a:hover::after,
.main-nav a.is-active::after { transform: scaleX(1); }

.main-nav .nav-cta {
  margin-left: 8px;
  padding: 8px 20px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius);
  transition: background-color .25s;
}
.main-nav .nav-cta:hover { background: var(--red-dark); }

.ext { font-size: .8em; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 26px; height: 2px;
  margin: auto;
  background: currentColor;
  transition: transform .3s var(--ease), background-color .3s;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -8px; }
.nav-toggle-bar::after { top: 8px; }

.nav-open .nav-toggle-bar { background: transparent; }
.nav-open .nav-toggle-bar::before { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle-bar::after { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero slider (CSS3 puro) ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  color: var(--white);
  background: var(--ink);
}

.hero-slides, .slide { position: absolute; inset: 0; }

.slide {
  opacity: 0;
  animation: slide-fade calc(var(--slides) * var(--slide-time)) infinite both;
  animation-delay: calc(var(--i) * var(--slide-time));
}

.slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: slide-zoom calc(var(--slides) * var(--slide-time)) linear infinite both;
  animation-delay: inherit;
}

/* velatura per garantire il contrasto del testo bianco */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.45) 55%, rgba(0,0,0,.2) 100%),
    linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 45%);
}

.slide-caption {
  position: absolute;
  z-index: 2;
  left: 0; right: 0;
  top: 32%;
}

.slide-kicker,
.slide-title {
  opacity: 0;
  animation: caption-in calc(var(--slides) * var(--slide-time)) var(--ease) infinite both;
  animation-delay: calc(var(--i) * var(--slide-time));
}

.slide-kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding-left: 48px;
  position: relative;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: .875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.slide-kicker::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 36px; height: 2px;
  background: var(--red);
}

.slide-title {
  max-width: 14ch;
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
  animation-name: title-in;
}

/* 5 slide x 6s = 30s: ogni slide e' visibile per il 20% del ciclo */
@keyframes slide-fade {
  0%      { opacity: 0; }
  3.33%   { opacity: 1; }
  20%     { opacity: 1; }
  23.33%  { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes slide-zoom {
  0%      { transform: scale(1.12); }
  23.33%  { transform: scale(1); }
  100%    { transform: scale(1); }
}
@keyframes caption-in {
  0%, 2%  { opacity: 0; transform: translateY(16px); }
  6%      { opacity: 1; transform: none; }
  18%     { opacity: 1; transform: none; }
  20.5%, 100% { opacity: 0; transform: translateY(-12px); }
}
@keyframes title-in {
  0%, 3%  { opacity: 0; transform: translateY(28px); }
  8%      { opacity: 1; transform: none; }
  18%     { opacity: 1; transform: none; }
  20.5%, 100% { opacity: 0; transform: translateY(-16px); }
}

.hero.is-paused .slide,
.hero.is-paused .slide img,
.hero.is-paused .slide-kicker,
.hero.is-paused .slide-title { animation-play-state: paused; }

.hero-content {
  position: absolute;
  z-index: 3;
  left: 0; right: 0;
  bottom: 18%;
}

.hero-lead {
  max-width: 40ch;
  margin-bottom: 28px;
  font-size: clamp(1.0625rem, 1.6vw, 1.3rem);
  font-weight: 400;
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
  animation: fade-up .9s .3s var(--ease) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  animation: fade-up .9s .5s var(--ease) both;
}

.hero-pause {
  position: absolute;
  z-index: 4;
  right: var(--gutter);
  bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius);
  background: rgba(0,0,0,.35);
  color: var(--white);
  font: 400 .8125rem var(--font-text);
  cursor: pointer;
}
.hero-pause:hover { background: rgba(0,0,0,.6); }
.hero-pause-icon {
  width: 10px; height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.hero.is-paused .hero-pause-icon {
  border: 0;
  border-left: 10px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 28px;
  width: 26px; height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 14px;
}
.scroll-cue::before {
  content: "";
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--white);
  animation: scroll-dot 1.8s ease-in-out infinite;
}
@keyframes scroll-dot {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Sezioni ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-alt { background: var(--box); }

.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--grey-a);
  font-family: var(--font-title);
  font-weight: 500;
  font-size: .8125rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 32px; height: 2px;
  background: var(--red);
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.section-sub { color: var(--grey-a); font-size: 1.125rem; }

.quote {
  margin: 20px 0 0;
  padding-left: 20px;
  border-left: 3px solid var(--red);
}
.quote p {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--ink);
}

/* ---------- Chi siamo ---------- */
.about {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-head { position: sticky; top: calc(var(--header-h) + 32px); }

.lead {
  font-size: clamp(1.1875rem, 2vw, 1.4375rem);
  line-height: 1.6;
  color: var(--ink);
}

.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.values li {
  padding: 22px 20px;
  border-top: 3px solid var(--red);
  background: var(--box);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.125rem;
}
.values-num {
  display: block;
  margin-bottom: 4px;
  color: var(--red);
  font-family: var(--font-text);
  font-weight: 400;
  font-size: .875rem;
  letter-spacing: .1em;
}

/* ---------- Servizi ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0; padding: 0;
  list-style: none;
}

.service {
  position: relative;
  padding: 36px 32px 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.service::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.service:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: 0 18px 40px rgba(38,38,38,.12);
}
.service:hover::before { transform: scaleX(1); }

.service-num {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .04em;
  transition: transform .45s var(--ease);
}
.service:hover .service-num { transform: rotate(-12deg) scale(1.08); }

.service h3 { font-size: 1.25rem; font-weight: 600; }
.service p { margin: 0; }

/* ---------- Portfolio: slider loghi (CSS3) ---------- */
.section-dark { background: var(--ink); color: var(--line); }
.section-dark .eyebrow,
.section-dark .section-sub { color: var(--line); }
/* il rosso #C00000 su #262626 ha contrasto 2,3:1: qui il titolo e' bianco */
.section-dark .section-title { color: var(--white); }

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-time, 60s) linear infinite;
}
.marquee:hover .marquee-track,
.marquee.is-paused .marquee-track { animation-play-state: paused; }

.marquee-list {
  display: flex;
  align-items: center;
  margin: 0; padding: 0;
  list-style: none;
}
.marquee-list li {
  flex: none;
  display: grid;
  place-items: center;
  width: 240px; height: 120px;
  padding: 0 28px;
}
.marquee-list img {
  max-width: 100%;
  max-height: 80px;
  width: auto; height: auto;
  opacity: .85;
  transition: opacity .3s, transform .4s var(--ease);
}
.marquee-list li:hover img { opacity: 1; transform: scale(1.08); }

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

.marquee-controls { display: flex; justify-content: center; margin-top: 32px; }

.marquee-pause {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  background: transparent;
  color: var(--line);
  font: 400 .8125rem var(--font-text);
  cursor: pointer;
  transition: border-color .25s, color .25s;
}
.marquee-pause:hover { border-color: var(--white); color: var(--white); }
.pause-icon {
  width: 10px; height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.marquee-pause[aria-pressed="true"] .pause-icon {
  border: 0;
  border-left: 10px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.section-dark :focus-visible { outline-color: var(--white); }

/* ---------- Contatti ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 4fr 7fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.contact-cards { display: grid; gap: 16px; }

.contact-card {
  padding: 24px 26px;
  background: var(--white);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
}
.contact-card h3 {
  margin-bottom: 6px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.contact-card p:last-child { margin: 0; }
.contact-card address { font-style: normal; margin-bottom: 8px; font-weight: 400; }

.contact-big {
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 1.1875rem;
  text-decoration: none;
  word-break: break-word;
}
.contact-big:hover { color: var(--red); }
.contact-card .muted { margin: 2px 0 0; }

.text-link { font-weight: 400; }

.contact-form {
  padding: clamp(24px, 4vw, 44px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(38,38,38,.08);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 20px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 400;
  font-size: .9375rem;
}
.req { color: var(--red); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: 400 1rem var(--font-text);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,0,0,.15);
}
.field .is-invalid { border-color: var(--red); background: #FFF5F5; }

.field-check { display: flex; gap: 12px; align-items: flex-start; }
.field-check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--red); }
.field-check label { margin: 0; font-size: .875rem; font-weight: 300; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note { margin-bottom: 18px; font-size: .8125rem; }

.form-status { margin: 16px 0 0; font-weight: 400; }
.form-status:empty { display: none; }
.form-status.is-ok { padding: 12px 16px; background: #EAF5EC; color: #1E5E2C; border-left: 4px solid #1E5E2C; }
.form-status.is-error { padding: 12px 16px; background: #FFF5F5; color: var(--red-dark); border-left: 4px solid var(--red); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 56px 40px;
  background: var(--ink);
  color: var(--line);
  font-size: .875rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 32px;
  align-items: start;
}
.footer-logo { width: 180px; height: auto; }
.footer-brand p { margin: 4px 0 0; color: var(--grey); }
.footer-legal p { margin: 0 0 4px; }
.footer-legal strong { color: var(--white); }
.footer-links { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--line); text-decoration: none; }
.footer-links a:hover { color: var(--white); text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--white); }

/* ---------- Animazioni allo scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-links { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: block; position: relative; z-index: 2; }

  .main-nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--ink);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }
  .nav-open .main-nav { opacity: 1; visibility: visible; }
  .nav-open .site-header { color: var(--ink); }
  .nav-open .logo { position: relative; z-index: 2; }
  .logo img { height: 36px; }
  .main-nav ul { flex-direction: column; gap: 8px; }
  .main-nav a { font-size: 1.375rem; padding: 10px 20px; }
  .main-nav .nav-cta { margin: 12px 0 0; }

  .about { grid-template-columns: 1fr; }
  .about-head { position: static; }
  .contact-cards { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .services, .field-row, .footer-inner { grid-template-columns: 1fr; }
  .marquee-list li { width: 170px; height: 96px; padding: 0 18px; }
  .marquee-list img { max-height: 60px; }
  .values { grid-template-columns: 1fr; }
  .slide-caption { top: 26%; }
  .hero-content { bottom: 16%; }
  .hero-pause-label { display: none; }
  .hero-pause { bottom: 28px; }
  .scroll-cue { display: none; }
  .footer-links { flex-wrap: wrap; }
}

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .slide, .slide-kicker, .slide-title { animation: none !important; opacity: 0; }
  .slide:first-child, .slide:first-child .slide-kicker, .slide:first-child .slide-title { opacity: 1; }
  .slide img { animation: none !important; }
  .hero-pause, .marquee-controls { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { width: auto; animation: none !important; }
  .marquee-list { flex-wrap: wrap; justify-content: center; }
  .marquee-list[aria-hidden="true"] { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
