/* ==========================================================================
   Eluvio — foglio di stile unico
   Indice: 1. Font  2. Variabili  3. Base  4. Layout  5. Header e menu
           6. Hero  7. Chi sono  8. Schede progetto  9. Come lavoro
           10. Contatti  11. Footer  12. Pagina progetto
           13. Movimento ridotto
   ========================================================================== */

/* 1. Font (ospitati in locale, licenza OFL in /assets/fonts).
   Sora ha solo il peso 700: i titoli a 600 usano automaticamente il 700. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/sora-latin-700-normal.woff2") format("woff2");
}

/* 2. Variabili */
:root {
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --navy: #0B1B33;
  --navy-2: #12284A;
  --ink: #0B1B33;
  --text: #334155;
  --muted: #526073;
  --line: #E3E8EF;
  --accent: #14B8A6;       /* turchese su fondo scuro */
  --accent-ink: #0F766E;   /* turchese per testi e link su fondo chiaro */
  --on-dark: #E6EDF6;
  --on-dark-muted: #A9B8CC;

  --font-head: "Sora", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 27, 51, .04), 0 8px 24px rgba(11, 27, 51, .06);
  --shadow-hover: 0 2px 4px rgba(11, 27, 51, .06), 0 16px 40px rgba(11, 27, 51, .10);
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(72px, 10vw, 128px);
}

/* 3. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--navy); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible { outline-color: var(--accent); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 16px; }
main:focus { outline: none; }

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

/* 4. Layout */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section) 0; }
.section + .section { padding-top: 0; }
.section-head { max-width: 640px; margin-bottom: clamp(40px, 6vw, 64px); }
.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.on-dark .eyebrow { color: var(--accent); }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.25rem); color: var(--muted); }

/* 5. Header e menu */
.on-dark { background: var(--navy); color: var(--on-dark); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: #fff; }

.site-header {
  position: relative;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header :focus-visible { outline-color: var(--accent-ink); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-logo { display: block; width: 180px; height: auto; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid #CBD5E1;
  border-radius: 999px;
  cursor: pointer;
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease;
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before,
.nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 8px 14px;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  transition: background-color .2s ease, color .2s ease;
}
.site-nav a:hover { background: #EEF2F6; }
.site-nav a[aria-current="page"] { color: var(--accent-ink); }

@media (max-width: 760px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(11, 27, 51, .12);
  }
  .js .site-nav.is-open { display: block; }
  .brand-logo { width: 144px; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { padding: 14px 12px; font-size: 1.0625rem; border-radius: var(--radius-sm); }
  /* Senza JavaScript il menu resta visibile sotto il logo */
  html:not(.js) .site-header .wrap { flex-wrap: wrap; padding-top: 16px; padding-bottom: 12px; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; }
  html:not(.js) .site-nav a { padding: 8px 12px; font-size: .9375rem; }
}

/* 6. Hero */
.top { position: relative; overflow: hidden; }
.hero {
  position: relative;
  padding: clamp(56px, 9vw, 120px) 0 clamp(80px, 12vw, 160px);
}
.top::before {
  /* alone turchese molto discreto */
  content: "";
  position: absolute;
  right: -10%;
  top: -35%;
  width: 70vw;
  max-width: 820px;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(20, 184, 166, .16), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 15ch; margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { max-width: 560px; color: var(--on-dark-muted); margin-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: #2DD4BF; }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-ghost:hover { border-color: #fff; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* 7. Chi sono */
.about {
  display: grid;
  gap: clamp(32px, 6vw, 96px);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .about { grid-template-columns: 5fr 7fr; align-items: start; }
}
.about-text p { font-size: 1.125rem; }
.about-text p:first-child { font-size: clamp(1.25rem, 2vw, 1.5rem); color: var(--ink); line-height: 1.5; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
}
.facts dt { font-size: .875rem; color: var(--muted); }
.facts dd {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }

/* 8. Schede progetto */
.projects-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
}
.projects-head .section-head { margin-bottom: 0; }
.projects-head { margin-bottom: clamp(40px, 6vw, 64px); }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

.project-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .project-grid { grid-template-columns: repeat(6, 1fr); }
  .project-grid > li { grid-column: span 2; }
  .project-grid > li:nth-child(-n+2) { grid-column: span 3; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card:focus-within { box-shadow: var(--shadow-hover); }

.card-art {
  position: relative;
  height: 168px;
  background: var(--tone, var(--navy));
  color: rgba(255, 255, 255, .9);
  overflow: hidden;
}
.project-grid > li:nth-child(-n+2) .card-art { height: 200px; }
.card-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 24px 28px;
}
.card-body h3 { margin: 12px 0 8px; font-size: 1.375rem; }
.card-body p { color: var(--muted); font-size: 1rem; margin-bottom: 20px; }
.card-link { color: inherit; text-decoration: none; }
.card-more {
  margin-top: auto;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--accent-ink);
}
/* l'intera scheda è cliccabile, ma il link resta uno solo */
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.card:hover .card-more { text-decoration: underline; }

/* toni delle schede (testo bianco sopra: contrasto AA verificato) */
.tone-viaggi  { --tone: linear-gradient(135deg, #0B6E99 0%, #075985 100%); }
.tone-market  { --tone: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%); }
.tone-conf    { --tone: linear-gradient(135deg, #C2410C 0%, #9A3412 100%); }
.tone-family  { --tone: linear-gradient(135deg, #9D174D 0%, #831843 100%); }
.tone-homepod { --tone: linear-gradient(135deg, #334155 0%, #1E293B 100%); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 12px 4px 10px;
  font-size: .8125rem;
  font-weight: 600;
  border-radius: 999px;
  background: #EEF2F6;
  color: #334155;
}
.status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-online  { background: #DCFCE7; color: #166534; }
.status-dev     { background: #FEF3C7; color: #92400E; }
.status-private { background: #EEF2F6; color: #334155; }

/* 9. Come lavoro */
.steps {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  counter-increment: step;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 20px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9375rem;
  color: var(--accent-ink);
}
.steps h3 { font-size: 1.125rem; }
.steps p { margin: 0; color: var(--muted); font-size: 1rem; }

/* 10. Contatti */
.contact {
  display: grid;
  gap: 32px;
  padding: clamp(32px, 6vw, 64px);
  background: var(--surface);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
}
@media (min-width: 900px) {
  .contact { grid-template-columns: 7fr 5fr; align-items: center; }
}
.contact h2 { margin-bottom: 12px; }
.contact p { color: var(--muted); margin: 0; }
.contact-box {
  padding: 24px;
  border: 1px dashed #B8C4D3;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.contact-box strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* 11. Footer */
.site-footer { padding: 64px 0 40px; }

/* fascia chiara con il logo completo, sopra il footer */
.brand-band {
  padding: clamp(56px, 8vw, 96px) 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  text-align: center;
}
.brand-band-logo { display: inline-block; width: min(360px, 78vw); height: auto; }
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.footer-top p { max-width: 360px; margin: 16px 0 0; color: var(--on-dark-muted); font-size: .9375rem; }
.footer-nav ul {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-nav a { color: var(--on-dark); text-decoration: none; font-size: .9375rem; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  font-size: .875rem;
  color: var(--on-dark-muted);
}
.footer-bottom p { margin: 0; }

/* 12. Pagina progetto */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  font-size: .875rem;
  color: var(--on-dark-muted);
}
.breadcrumb li + li::before { content: "/"; margin: 0 10px; opacity: .6; }
.breadcrumb a { color: var(--on-dark); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.page-hero { padding: clamp(32px, 5vw, 56px) 0 clamp(64px, 9vw, 112px); }
.page-hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .page-hero-grid { grid-template-columns: 7fr 5fr; gap: 64px; }
}
.page-hero h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); margin: 16px 0 20px; overflow-wrap: break-word; }
.page-hero .lead { color: var(--on-dark-muted); max-width: 560px; margin-bottom: 32px; }
.hero-note { margin: 0; font-size: .9375rem; color: var(--on-dark-muted); }
.project-art {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--tone, var(--navy-2));
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.project-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* immagine che riempie tutto il riquadro (schede e pagina progetto).
   I bordi in eccesso vengono ritagliati; l'angolo in alto a sinistra resta sempre visibile. */
.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}
@media (max-width: 899px) { .project-art { aspect-ratio: 16 / 7; } }

.project-layout {
  display: grid;
  gap: 40px;
}
@media (min-width: 900px) {
  .project-layout { grid-template-columns: 8fr 4fr; gap: 64px; align-items: start; }
}
.prose h2 { font-size: clamp(1.5rem, 2.5vw, 1.875rem); margin-top: 0; }
.prose h2:not(:first-child) { margin-top: 48px; }
.prose p { font-size: 1.125rem; }

.summary {
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 900px) { .summary { position: sticky; top: 24px; } }
.summary h2 { font-size: 1.125rem; margin-bottom: 20px; }
.summary dl { margin: 0; }
.summary dl > div { padding: 14px 0; border-top: 1px solid var(--line); }
.summary dt { font-size: .8125rem; color: var(--muted); margin-bottom: 4px; }
.summary dd { margin: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.summary dd a { font-weight: 600; }

.features {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
.features li {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: #E6F4F2;
  color: var(--accent-ink);
}
.feature-icon svg { width: 22px; height: 22px; }
.features h3 { font-size: 1.125rem; }
.features p { margin: 0; color: var(--muted); font-size: 1rem; }

.disclaimer { margin: 32px 0 0; font-size: .875rem; color: var(--muted); }

.notice {
  max-width: 760px;
  padding: clamp(28px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-ink);
  border-radius: var(--radius);
}
.notice h2 { font-size: 1.25rem; }
.notice p { margin: 0; color: var(--muted); }

.project-nav { display: grid; gap: 24px; }
.pager {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.pager a:hover { border-color: #B8C4D3; box-shadow: var(--shadow); }
@media (min-width: 640px) { .pager .next { text-align: right; } }
.pager-label { font-size: .875rem; color: var(--muted); }
.pager-title { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; color: var(--ink); }

/* 13. Movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .card:hover { transform: none; }
}
