/* Landing "I caschi MIPS da ciclismo" — stile derivato dai token del template Karma
   Palette: ink #222222 · banda #f9f9ff · accento gradiente #ffba00→#ff6c00
   Font: Poppins 500/700 (titoli) · Roboto 400/500/700 (testo) — self-hosted */

:root {
  --ink: #222222;
  --body: #494950;
  --muted: #6d6d76;
  --paper: #ffffff;
  --band: #f9f9ff;
  --dark: #16161a;
  --dark-2: #1d1d23;
  --line: #e8e8ef;
  --acc-1: #ffba00;
  --acc-2: #ff6c00;
  --grad: linear-gradient(90deg, #ffba00 0%, #ff6c00 100%);
  --link: #b54708;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(22, 22, 26, .10);
  --font-display: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--body);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

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

::selection { background: var(--acc-1); color: var(--ink); }

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

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .65rem 1.1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .9rem;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 22, 26, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
}

.brand em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-icon { width: 34px; height: 34px; flex: none; }

.topbar-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #d8d8e0;
  text-decoration: none;
  padding: .5rem .25rem;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.topbar-link:hover { color: var(--acc-1); border-bottom-color: var(--acc-1); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .06em;
}

.lang-switcher .lang-link {
  color: #d8d8e0;
  text-decoration: none;
  padding: .5rem .15rem;
  transition: color .2s ease;
}

.lang-switcher .lang-link:hover,
.lang-switcher .lang-link.active { color: var(--acc-1); }

.lang-switcher .lang-sep { color: rgba(255, 255, 255, .3); }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(58rem 30rem at 82% -18%, rgba(255, 108, 0, .16), transparent 60%),
    radial-gradient(40rem 26rem at -8% 110%, rgba(255, 186, 0, .10), transparent 60%),
    var(--dark);
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.hero h1 {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.05rem, 4.6vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.hero-sub {
  margin: 0 0 2rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: #c9c9d4;
  max-width: 34em;
  text-wrap: pretty;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .95rem 1.9rem;
  background: var(--grad);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 108, 0, .32);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 108, 0, .42);
}
.btn-cta svg { width: 15px; height: 15px; }

.hero-media {
  margin: 0;
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  padding: 4px;
  background: linear-gradient(135deg, rgba(255, 186, 0, .85), rgba(255, 108, 0, .25) 45%, rgba(255, 255, 255, .06));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.hero-media img {
  border-radius: var(--radius);
  width: 100%;
}

/* ---------- Layout principale ---------- */

.main-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  column-gap: clamp(2rem, 4vw, 3.5rem);
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
}

.breadcrumb { grid-column: 1 / -1; margin-bottom: 1.75rem; }

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0;
  padding: 0;
  font-size: .85rem;
  color: var(--muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: .35rem;
  color: #b9b9c4;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--acc-2); text-decoration: underline; }

/* ---------- Indice ---------- */

.toc {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.toc::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--grad);
  margin-bottom: 1.1rem;
}

.toc h2 {
  margin: 0 0 .9rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  border-top: 1px solid var(--line);
}
.toc li:first-child { border-top: 0; }

.toc a {
  display: flex;
  gap: .7rem;
  align-items: baseline;
  padding: .55rem .1rem;
  color: var(--body);
  font-size: .92rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color .15s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  color: var(--link);
  flex: none;
}

.toc a:hover { color: var(--acc-2); }

/* ---------- Articolo ---------- */

.article-section {
  scroll-margin-top: 92px;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.article-section:last-child { margin-bottom: 0; }

.article-section.band {
  background: var(--band);
  border: 1px solid #efeff8;
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
}

.article-section.band-dark {
  background:
    radial-gradient(36rem 20rem at 110% -30%, rgba(255, 108, 0, .14), transparent 60%),
    var(--dark);
  border: 0;
  color: #d6d6de;
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.article-section p {
  margin: 0 0 1.15rem;
  max-width: 70ch;
  text-wrap: pretty;
}
.article-section p:last-child { margin-bottom: 0; }

.article-section h2 {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
}

.band-dark h2 { color: #fff; }

.sec-num {
  font-size: .9rem;
  letter-spacing: .05em;
  color: var(--link);
  flex: none;
}

.band-dark .sec-num {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.article-section a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(255, 108, 0, .45);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

.article-section a:hover {
  color: var(--acc-2);
  text-decoration-color: var(--acc-2);
}

.band-dark a { color: var(--acc-1); text-decoration-color: rgba(255, 186, 0, .5); }
.band-dark a:hover { color: #ffd257; text-decoration-color: #ffd257; }

.article-figure {
  margin: 1.75rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-figure img { width: 100%; }

/* ---------- Footer ---------- */

.footer {
  background: var(--dark);
  color: #9a9aa5;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-block: clamp(2.75rem, 6vw, 4.25rem) clamp(2rem, 4vw, 3rem);
}

.footer-col p { margin: 0; font-size: .95rem; max-width: 36em; }

.footer-title {
  margin: 0 0 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--acc-1);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
}

.footer-brand .brand-icon { width: 30px; height: 30px; }

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

.footer-links li { margin-bottom: .55rem; }

.footer-links a {
  color: #b9b9c4;
  text-decoration: none;
  font-size: .95rem;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.footer-links a:hover { color: #fff; border-bottom-color: var(--acc-1); }

.footer-privacy {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-block: 1.75rem 2.25rem;
}

.footer-privacy p {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  margin: 0;
  font-size: .8rem;
  line-height: 1.65;
  color: #8f8f9a;
  max-width: 75rem;
}

.footer-privacy strong { color: #c6c6cf; }

.privacy-icon { width: 20px; height: 20px; flex: none; margin-top: .15rem; color: var(--acc-1); }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .main-grid { grid-template-columns: 1fr; }

  .toc-col { margin-bottom: 2rem; }

  .toc { position: static; }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    padding-block: clamp(2.75rem, 8vw, 4rem);
  }

  .hero-copy, .hero-media { min-width: 0; }

  .hero-media { max-width: 640px; }

  .footer-grid { grid-template-columns: 1fr; gap: 2.25rem; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }

  .topbar-link { display: none; }

  .article-section.band,
  .article-section.band-dark { margin-inline: calc(-1 * clamp(1.25rem, 4vw, 2.5rem)); border-radius: 0; border-left: 0; border-right: 0; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
