/* ==========================================================================
   Sport in Translation - sportintranslation.com
   Foglio di stile unico. Mobile-first, zero dipendenze esterne.
   Palette brand: nero + arancio. Tipografia di sistema per massima leggerezza.
   ========================================================================== */

:root {
  --orange: #ff7a1a;
  --orange-soft: #ff914d;
  --orange-text: #c0480a;  /* arancio scuro per testo/link su sfondo chiaro (contrasto AA) */
  --ink: #16181d;        /* testo principale */
  --ink-2: #4a4f59;      /* testo secondario */
  --black: #101216;      /* sezioni scure */
  --black-2: #1b1e25;
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --line: #e6e6e2;
  --indigo: #0f073f;     /* accento profondo, ereditato dal brand */
  --radius: 14px;
  --maxw: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
  --shadow: 0 10px 30px rgba(16, 18, 22, .08);
  --shadow-lg: 0 18px 50px rgba(16, 18, 22, .16);
  --hero-grad: var(--hero-grad);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }   /* wrapper trasparente: le regole sugli <img> restano valide */

a { color: var(--orange-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  color: var(--ink);
  text-wrap: balance;      /* righe dei titoli bilanciate, niente parole orfane */
  hyphens: none;           /* nessuna sillabazione automatica */
}

h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 1rem; text-wrap: pretty; }

/* Helper di impaginazione in stile sottotitoli
   .nowrap: tiene insieme un'unita che non va spezzata a fine riga
   br.sub: a capo "da sottotitolo" visibile solo da tablet/desktop in su,
   cosi su mobile il testo scorre naturale senza interruzioni forzate */
.nowrap { white-space: normal; }
@media (min-width: 480px) { .nowrap { white-space: nowrap; } }
br.sub { display: none; }
@media (min-width: 760px) {
  br.sub { display: inline; }
}

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

section { padding-block: clamp(56px, 9vw, 110px); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange-text);
  margin-bottom: .6rem;
}

.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; text-wrap: balance; }

.center { text-align: center; }
.center .lead { margin-inline: auto; }

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

/* ----- Skip link (accessibilità) ----- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* ----- Bottoni ----- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #1a1205; }
.btn-primary:hover { background: #ff9440; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }

/* ==========================================================================
   Header / navigazione
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(16, 18, 22, .96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 8px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: clamp(190px, 30vw, 340px); height: auto; }
.brand:hover { text-decoration: none; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 24px; height: 2px; background: #fff;
  position: relative; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 6px; align-items: center;
}
.nav-menu a {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: #e9e9e6; font-weight: 600; font-size: .96rem;
}
.nav-menu a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-menu .nav-cta a { background: var(--orange); color: #1a1205; }
.nav-menu .nav-cta a:hover { background: #ff9440; }
.nav-lang a { display: inline-flex; align-items: center; gap: 7px; }
.nav-lang .flag {
  height: 15px; width: auto; border-radius: 2px; flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

@media (max-width: 860px) {
  .nav-menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--black); padding: 10px var(--gutter) 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 14px 10px; }
  .nav-menu .nav-cta a { text-align: center; margin-top: 6px; }
  /* Switch di lingua ben visibile in coda al menu mobile */
  .nav-menu .nav-lang {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .nav-menu .nav-lang a { display: flex; justify-content: center; font-size: 1rem; }
  .nav-menu .nav-lang .flag { height: 18px; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; color: #fff;
  background-color: var(--black);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  /* Fallback universale (desktop): JPEG per i browser senza WebP */
  background-image:
    var(--hero-grad),
    url("images/hero-workspace.jpg");
  padding-block: clamp(84px, 16vw, 160px);
}
/* Desktop con WebP */
@supports (background-image: image-set(url("i.webp") type("image/webp"))) {
  .hero {
    background-image:
      var(--hero-grad),
      image-set(url("images/hero-workspace-1600.webp") type("image/webp"),
                url("images/hero-workspace.jpg") type("image/jpeg"));
  }
}
/* Mobile/tablet piccoli: immagine hero leggera (800px) */
@media (max-width: 760px) {
  .hero {
    background-image:
      var(--hero-grad),
      url("images/hero-workspace-800.jpg");
  }
  @supports (background-image: image-set(url("i.webp") type("image/webp"))) {
    .hero {
      background-image:
        var(--hero-grad),
        image-set(url("images/hero-workspace-800.webp") type("image/webp"),
                  url("images/hero-workspace-800.jpg") type("image/jpeg"));
    }
  }
}
.hero h1 { color: #fff; max-width: 16ch; }
.hero .eyebrow { color: var(--orange-soft); }
.hero p { color: #ececea; font-size: 1.18rem; max-width: 64ch; }
.hero-claim {
  display: inline-block; margin-top: .4rem; margin-bottom: 1.4rem;
  font-style: italic; color: #cfd0cd; font-size: 1.02rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }

/* ==========================================================================
   Servizi
   ========================================================================== */
.grid-3 {
  display: grid; gap: 26px;
  grid-template-columns: 1fr;
  margin-top: 46px;
}
@media (min-width: 620px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 26px;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .ico {
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: #fff3e9; color: var(--orange);
}
.card .ico svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-2); margin-bottom: 0; font-size: .98rem; }

/* Coppie linguistiche */
.langs {
  margin-top: 46px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}
.lang-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--black); color: #fff;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 1rem;
}
.lang-pill b { color: var(--orange-soft); }
.lang-pill .arrow { color: var(--orange); font-weight: 900; }

/* ==========================================================================
   Chi sono
   ========================================================================== */
.about { background: var(--bg-soft); }
.about-grid {
  display: grid; gap: clamp(32px, 6vw, 64px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 880px) {
  .about-grid { grid-template-columns: 0.85fr 1.15fr; }
}
.about ul.points { list-style: none; margin: 1.2rem 0 1.6rem; padding: 0; }
.about ul.points li {
  position: relative; padding-left: 32px; margin-bottom: 12px; color: var(--ink-2);
}
.about ul.points li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px #ffe6d4;
}

/* ----- Rotazione foto triathlon ----- */
.tri-rotator { margin-top: 10px; }
.tri-figure {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--black);
  aspect-ratio: 3 / 4; max-width: 420px; margin-inline: auto;
}
.tri-figure .slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .9s ease;
}
.tri-figure .slide img { width: 100%; height: 100%; object-fit: cover; }
.tri-figure .slide.is-active { opacity: 1; }
.tri-figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 18px 16px; color: #fff; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(180deg, transparent, rgba(16,18,22,.82));
  font-size: .98rem;
}
.tri-figure figcaption small { display: block; font-weight: 500; color: #d9d9d6; font-size: .82rem; }
.tri-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.tri-dots button {
  width: 44px; height: 44px; border: 0; cursor: pointer; padding: 0;
  background: transparent; display: grid; place-items: center;
}
.tri-dots button::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  background: #cfcfc9; transition: background .2s ease, transform .2s ease;
}
.tri-dots button[aria-current="true"]::before { background: var(--orange); transform: scale(1.2); }

@media (prefers-reduced-motion: reduce) {
  .tri-figure .slide { transition: none; }
}

/* ==========================================================================
   Portfolio
   ========================================================================== */
.grid-port {
  display: grid; gap: 26px; margin-top: 46px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.proj {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.proj:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.proj-media {
  aspect-ratio: 16 / 10; background: var(--bg-soft);
  display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line);
}
.proj-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.proj-media.cover img { object-fit: cover; padding: 0; }
.proj-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.proj h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.proj p { color: var(--ink-2); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--indigo); background: #eef0ff; padding: 5px 10px; border-radius: 6px;
}
.proj .proj-link {
  margin-top: auto; font-weight: 700;
  display: inline-flex; align-items: center; min-height: 44px;
}
.proj .proj-link::after { content: " \2192"; }

/* ==========================================================================
   Testimonianza
   ========================================================================== */
.quote-band { background: var(--black); color: #fff; }
.quote-band .eyebrow { color: var(--orange-soft); }
.quote-wrap { max-width: 760px; margin-inline: auto; text-align: center; }
.quote-wrap blockquote {
  margin: 0 0 24px; font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.45; font-weight: 600; color: #fff;
}
.quote-wrap .stars { color: #f4c133; letter-spacing: 3px; margin-bottom: 18px; font-size: 1.1rem; }
.quote-author { display: flex; align-items: center; gap: 14px; justify-content: center; }
.quote-author img { width: 58px; height: 58px; border-radius: 50%; }
.quote-author .who { text-align: left; }
.quote-author .who b { display: block; color: #fff; }
.quote-author .who span { color: #b9bac0; font-size: .9rem; }

/* ==========================================================================
   Contatti
   ========================================================================== */
.contact { text-align: center; }
.contact .lead { margin-inline: auto; }
.contact .email-big {
  display: inline-block; margin: 10px 0 8px;
  font-size: clamp(1.3rem, 4vw, 2.1rem); font-weight: 800; color: var(--ink);
  border-bottom: 3px solid var(--orange);
}
.contact .email-big:hover { color: var(--orange); text-decoration: none; }
.contact .area { color: var(--ink-2); margin-bottom: 26px; }
.socials { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.socials a {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--black); color: #fff; transition: background .2s ease, transform .15s ease;
}
.socials a:hover { background: var(--orange); color: #1a1205; transform: translateY(-3px); text-decoration: none; }
.socials svg { width: 20px; height: 20px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--black-2); color: #c7c8cd;
  padding-block: 40px; font-size: .9rem;
}
.footer-grid {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
}
.site-footer img { height: 46px; width: auto; }
.site-footer a { color: #e9e9e6; }
.footer-meta { color: #8f9197; }
.footer-links { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; }

/* ==========================================================================
   Pagina privacy
   ========================================================================== */
.doc { max-width: 780px; }
.doc h1 { margin-bottom: .2em; }
.doc h2 { font-size: 1.35rem; margin-top: 2rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc .updated { color: #8f9197; font-size: .9rem; margin-bottom: 2rem; }
.page-head { background: var(--black); color: #fff; padding-block: clamp(40px, 8vw, 70px); }
.page-head h1 { color: #fff; margin: 0; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 24px; font-weight: 700; }
.back-link::before { content: "\2190  "; }
