/* ==========================================================================
   FA Digital Lab – Design system v2
   Tema chiaro/scuro, linguaggio "blueprint" (griglie a filo, angoli tecnici,
   intestazioni editoriali), portfolio con cornici browser, UX mobile.
   ========================================================================== */

/* ---------- Token ---------- */
:root, [data-theme="dark"] {
  --ink-rgb: 255, 255, 255;
  --field-bg: #020c19;
  --card-hover: #0d2342;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 0 rgba(var(--ink-rgb), .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);
  --grid-line: rgba(var(--ink-rgb), 0.035);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-deep: #e8eef6;
  --bg-deep-rgb: 245, 248, 252;
  --bg: #f6f9fc;
  --bg-2: #edf2f8;
  --surface: #ffffff;
  --surface-2: #eef4fb;
  --line: rgba(10, 40, 80, 0.10);
  --line-strong: #d2ddeb;
  --ink-rgb: 6, 22, 42;

  --text-strong: #06162a;
  --text: #1d2e46;
  --text-muted: #4b5f7b;
  --text-dim: #6f839f;

  --accent: #0868cc;
  --accent-rgb: 8, 120, 230;
  --accent-strong: #0757aa;
  --accent-soft: #0a58a8;
  --accent-2: #0b8bc4;
  --accent-2-rgb: 11, 139, 196;

  --field-bg: #ffffff;
  --card-hover: #f3f8ff;
  --shadow-card: 0 1px 2px rgba(6, 22, 42, .04), 0 18px 40px -28px rgba(6, 22, 42, .35);
  --grid-line: rgba(6, 22, 42, 0.05);
  color-scheme: light;
}

.theme-anim, .theme-anim * { transition: background-color .3s ease, border-color .3s ease, color .3s ease !important; }

/* Logo per tema */
.logo--on-light { display: none !important; }
[data-theme="light"] .logo--on-dark { display: none !important; }
[data-theme="light"] .logo--on-light { display: block !important; }

/* Hero/pagine: la griglia di fondo usa il token */
.hero, .page-hero { background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    radial-gradient(ellipse 40% 40% at 85% 30%, rgba(var(--accent-2-rgb), 0.08), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) !important; }
.page-hero { background-color: var(--bg) !important; }

/* ---------- Header ---------- */
.site-header { transition: box-shadow .25s ease, background .25s ease; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .5); }
[data-theme="light"] .site-header.is-scrolled { box-shadow: 0 10px 30px -20px rgba(6, 22, 42, .35); }

.theme-toggle {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  cursor: pointer; transition: border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle .theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle .theme-toggle__moon { display: inline-block; }

.menu-toggle { position: relative; padding: 0; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--text-strong); }
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 20px; right: 17px; }
.menu-toggle span:nth-child(3) { top: 26px; }

/* Menu mobile a tutto schermo */
.mobile-menu {
  width: 100%; max-width: 420px; padding: 20px 22px 28px;
  display: flex !important; flex-direction: column; gap: 18px;
  background: var(--bg);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .35);
}
.mobile-menu__top { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu__label { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.mobile-menu .close-btn { position: static; width: 44px; height: 44px; font-size: 2rem; line-height: 1; border: 1px solid var(--line-strong) !important; border-radius: var(--radius-sm); cursor: pointer; }
.mobile-menu ul { padding: 0; margin: 0; border-top: 1px solid var(--line); }
.mobile-menu ul li { margin: 0; border-bottom: 1px solid var(--line); }
.mobile-menu ul a { display: flex; align-items: baseline; gap: 14px; padding: 16px 2px; font-size: 1.5rem; font-weight: 600; color: var(--text-strong); }
.mobile-menu__idx { font-family: var(--font-mono); font-size: .75rem; color: var(--text-dim); }
.mobile-menu ul a[aria-current="page"] .mobile-menu__idx { color: var(--accent); }
.mobile-menu__contacts { display: grid; gap: 10px; margin-top: auto; }
.mobile-menu__contacts a { display: flex; align-items: center; gap: 12px; color: var(--text-muted); text-decoration: none; font-size: .98rem; }
.mobile-menu__contacts i { width: 18px; color: var(--accent); }
.mobile-menu__theme { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.mobile-menu__cta { margin-top: 0; }
body.menu-open { overflow: hidden; }

/* ---------- Bottoni: angoli più tecnici ---------- */
.btn { border-radius: var(--radius-sm); }
.btn-secondary { background: var(--surface); }
[data-theme="dark"] .btn-secondary, :root:not([data-theme]) .btn-secondary { background: transparent; }

/* ---------- Etichette: [ STILE ] ---------- */
.page-kicker::before, .section-heading .eyebrow::before { content: "["; color: var(--text-dim); }
.page-kicker::after, .section-heading .eyebrow::after { content: "]"; color: var(--text-dim); }

/* ---------- Intestazioni di sezione editoriali ---------- */
@media (min-width: 900px) {
  .section-heading:not(.section-heading--left) {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    column-gap: 56px;
    align-items: end;
    max-width: none;
    margin: 0 0 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }
  .section-heading:not(.section-heading--left) .eyebrow { grid-column: 1 / -1; justify-self: start; }
  .section-heading:not(.section-heading--left) h2 { grid-column: 1; margin: 0; max-width: 20ch; }
  .section-heading:not(.section-heading--left) p { grid-column: 2; margin: 0; }
  .section-heading:not(.section-heading--left):not(:has(p)) { grid-template-columns: 1fr; }
  .section-heading:not(.section-heading--left):not(:has(p)) h2 { max-width: 28ch; }
}
.section-action { justify-content: flex-start; }

/* ---------- Griglie "blueprint": celle unite da un filo sottile ---------- */
.feature-grid, .faq-grid, .home-summary__grid {
  gap: 1px !important;
  padding: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-grid > *, .faq-grid > *, .home-summary__grid > * {
  position: relative;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--bg) !important;
  box-shadow: none !important;
  transition: background .25s ease;
}
.page-section--contrast .feature-grid > *, .page-section--contrast .faq-grid > * { background: var(--bg-2) !important; }
.feature-grid > *:hover, .faq-grid > *:hover, .home-summary__grid > *:hover { background: var(--card-hover) !important; }
.feature-card, .faq-item { padding: 30px 28px !important; }
.home-summary__card { padding: 32px 28px !important; }
.feature-card h3, .faq-item h3, .home-summary__summary h3 { font-size: 1.15rem; }

/* Numero/indice in alto a destra delle celle */
.home-summary__grid { counter-reset: cell; }
.home-summary__card::after {
  counter-increment: cell; content: "0" counter(cell);
  position: absolute; top: 22px; right: 24px;
  font-family: var(--font-mono); font-size: .78rem; color: var(--text-dim);
}

/* Angoli "a squadra" su card singole */
.story-card, .service-panel, .contact-form-shell, .home-contact__intro, .page-cta, .stat-strip, .contact-card {
  position: relative;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-card) !important;
}
.story-card::before, .service-panel::before, .contact-form-shell::before, .page-cta::before,
.story-card::after, .service-panel::after, .contact-form-shell::after, .page-cta::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--accent); border-style: solid; opacity: .7;
}
.story-card::before, .service-panel::before, .contact-form-shell::before, .page-cta::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.story-card::after, .service-panel::after, .contact-form-shell::after, .page-cta::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }

.page-cta { background: var(--surface) !important; }
.page-cta h2 { max-width: 26ch; }

.service-panel { grid-template-columns: 88px minmax(0, 1fr); }
.service-panel__icon { width: 88px; height: 88px; padding: 0; align-items: center; border-radius: var(--radius-sm); }

.stat-item { padding: 22px 24px; }

/* Pillole più sobrie */
.pill { border-radius: 6px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .01em; padding: 6px 10px; }
.contact-proof span { border-radius: 6px; }

/* ---------- Hero home con finestra codice ---------- */
.hero-overlay { padding-bottom: clamp(56px, 8vh, 96px); }
@media (min-width: 1080px) {
  .hero-content--home.hero-content--split {
    max-width: 1240px; width: 100%;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 56px; align-items: center; text-align: left; padding: 0 20px;
  }
  .hero-content--split .hero-title, .hero-content--split .hero-subtitle { margin-left: 0 !important; margin-right: 0 !important; }
  .hero-content--split .hero-title { max-width: 15ch !important; }
  .hero-content--split .page-kicker { justify-content: flex-start; }
  .hero-content--split .hero-actions { justify-content: flex-start; }
  .hero-content--split .hero-trust { justify-content: flex-start; margin-left: 0; }
}
.code-window { display: none; }
@media (min-width: 1080px) {
  .code-window {
    display: block; position: relative;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--surface); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .55);
    font-family: var(--font-mono); font-size: .86rem; line-height: 1.75; text-align: left;
    overflow: hidden;
  }
  .code-window__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim); font-size: .75rem; }
  .code-window__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
  .code-window__bar span { margin-left: 8px; }
  .code-window pre { margin: 0; padding: 20px 22px 24px; color: var(--text); white-space: pre; overflow: hidden; }
  .code-window .c-k { color: #c792ea; } .code-window .c-s { color: #7fd8a6; } .code-window .c-n { color: var(--accent); }
  .code-window .c-c { color: var(--text-dim); } .code-window .c-f { color: #82aaff; } .code-window .c-b { color: #f78c6c; }
  [data-theme="light"] .code-window .c-k { color: #8e3fc9; } [data-theme="light"] .code-window .c-s { color: #1b7f4b; }
  [data-theme="light"] .code-window .c-f { color: #2f5fd0; } [data-theme="light"] .code-window .c-b { color: #c4521f; }
  .code-window__status { display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: .78rem; }
  .code-window__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2bd47d; box-shadow: 0 0 0 4px rgba(43, 212, 125, .15); }
  .code-cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}

/* ---------- Form: leggibilità in entrambi i temi ---------- */
.form-contatto, .contact-form-shell .form-contatto { background: transparent !important; border: 0 !important; padding: 0 !important; }
.form-contatto--home { padding: 28px !important; background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: var(--radius) !important; }
.form-group { margin-bottom: 16px; }
.form-contatto--page { gap: 0 !important; }
.form-contatto--page label, .form-group label {
  display: block; margin-bottom: 8px;
  color: var(--text-strong) !important; font-size: .92rem; font-weight: 600;
}
.form-group input, .form-group textarea, .form-group select,
.form-contatto--page input, .form-contatto--page textarea, .form-contatto--page select,
.form-contatto--home input, .form-contatto--home textarea, .form-contatto--home select {
  width: 100%; min-height: 52px;
  padding: 14px 16px !important;
  background: var(--field-bg) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-strong) !important;
  font-family: var(--font-body); font-size: 16px !important; line-height: 1.5;
  -webkit-appearance: none; appearance: none;
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-dim) !important; opacity: 1; }
.form-group select {
  padding-right: 44px !important; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%) !important;
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50% !important;
  background-size: 6px 6px, 6px 6px !important; background-repeat: no-repeat !important;
}
.form-group select:invalid { color: var(--text-dim) !important; }
.form-group select option, .form-contatto--home select option, .form-contatto--page select option {
  background: var(--surface) !important; color: var(--text-strong) !important;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none !important; border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2) !important;
}
.form-group [aria-invalid="true"] { border-color: #ff6b6b !important; box-shadow: 0 0 0 3px rgba(255, 107, 107, .18) !important; }
.form-privacy { color: var(--text-muted); }
.contact-form-shell { padding: 32px !important; }
.contact-card { padding: 24px !important; }
.contact-card a { font-weight: 700; color: var(--accent); text-decoration: none; }

/* ---------- FAQ ---------- */
.faq-entry { border-radius: var(--radius-sm); background: var(--surface); }

/* ==========================================================================
   PORTFOLIO
   ========================================================================== */
.works-hero-stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; width: fit-content; max-width: 100%; }
.works-hero-stats div { padding: 14px 22px; border-right: 1px solid var(--line); background: var(--surface); }
.works-hero-stats div:last-child { border-right: 0; }
.works-hero-stats strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--text-strong); line-height: 1.1; }
.works-hero-stats span { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }

.works-toolbar {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; margin-bottom: 28px;
  background: rgba(var(--bg-deep-rgb), .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.works-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px; }
.works-filters::-webkit-scrollbar { display: none; }
.works-filters button {
  flex: 0 0 auto; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--text-muted); font: 500 .9rem var(--font-body); cursor: pointer; white-space: nowrap;
  transition: all .2s ease;
}
.works-filters button:hover { color: var(--text-strong); border-color: var(--text-dim); }
.works-filters button[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: #fff; }
.works-count { flex: 0 0 auto; font-family: var(--font-mono); font-size: .8rem; color: var(--text-dim); }

.works-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.works-grid > [hidden] { display: none !important; }

/* Card lavoro */
.work-card { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.work-card__visual { position: relative; display: block; text-decoration: none; padding: 26px 26px 0; border-radius: var(--radius); background:
    radial-gradient(ellipse 80% 70% at 50% 100%, rgba(var(--accent-rgb), .22), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px), var(--surface-2);
  background-size: auto, 28px 28px, 28px 28px, auto;
  border: 1px solid var(--line); overflow: hidden; }
.browser { position: relative; border-radius: 10px 10px 0 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-bottom: 0; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55); transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.browser__bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.browser__dots i:nth-child(1) { background: #ff5f57; } .browser__dots i:nth-child(2) { background: #febc2e; } .browser__dots i:nth-child(3) { background: #28c840; }
.browser__url { flex: 1; min-width: 0; height: 22px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border-radius: 6px; background: var(--bg); color: var(--text-dim); font-family: var(--font-mono); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser__url i { font-size: .62rem; color: #28c840; }
.browser__screen { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.browser__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform 2.4s ease, object-position 2.4s ease; }
.work-card__visual:hover .browser { transform: translateY(-6px); }
.work-card__visual:hover .browser__screen img { object-position: bottom center; }

.phone { position: absolute; right: 18px; bottom: -18px; width: 22%; min-width: 86px; max-width: 130px; padding: 6px; border-radius: 18px; background: #0b1424; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .7); transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.phone img { display: block; width: 100%; aspect-ratio: 9 / 19; object-fit: cover; object-position: top; border-radius: 13px; }
.work-card__visual:hover .phone { transform: translateY(-14px); }

.work-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-family: var(--font-mono); font-size: .76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.work-card__meta span + span::before { content: "·"; margin-right: 14px; }
.work-card h3 { margin: 8px 0 8px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); letter-spacing: -.02em; }
.work-card h3 a { color: var(--text-strong); text-decoration: none; }
.work-card h3 a:hover { color: var(--accent); }
.work-card p { color: var(--text-muted); margin: 0 0 14px; }
.work-card__types { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.work-card__types li { padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 6px; font-family: var(--font-mono); font-size: .72rem; color: var(--text-muted); }
.work-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.work-card__link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-strong); font-weight: 700; text-decoration: none; }
.work-card__link i { color: var(--accent); transition: transform .2s ease; }
.work-card__link:hover i { transform: translateX(4px); }
.work-card__link--ext { color: var(--text-muted); font-weight: 500; }

/* Primo progetto in evidenza (desktop) */
@media (min-width: 1000px) {
  .works-grid .work-card--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 40px; align-items: center; }
  .work-card--wide h3 { font-size: 2.1rem; }
}

/* Carosello orizzontale (home, landing) */
.rail { position: relative; }
.rail__track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, calc((100% - 32px) / 2.15)); gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; -webkit-overflow-scrolling: touch; }
.rail__track > * { scroll-snap-align: start; }
.rail__nav { display: flex; gap: 8px; }
.rail__nav button { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-strong); cursor: pointer; }
.rail__nav button:disabled { opacity: .35; cursor: default; }
.rail__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }

/* Pagina caso studio */
.case-browser { margin-bottom: 24px; }
.case-browser .work-card__visual { padding: 32px 32px 0; }

/* ==========================================================================
   MOBILE
   ========================================================================== */
.mobile-actions { display: none; }

@media (max-width: 960px) {
  .theme-toggle { margin-left: auto; }
  .menu-toggle { margin-left: 8px; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }
  body { padding-bottom: 76px; }
  .site-header { padding: 0 16px; }
  .logo { height: 32px; }
  .brand__text strong { font-size: 1rem; }
  .brand__text small { font-size: .52rem; letter-spacing: .16em; }
  .container { width: calc(100% - 32px); }

  /* Barra azioni fissa in basso */
  .mobile-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(var(--bg-deep-rgb), .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .mobile-actions a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
    color: var(--text-strong); text-decoration: none; font-size: .72rem; font-weight: 600;
  }
  .mobile-actions a i { font-size: 1.1rem; color: var(--accent); }
  .mobile-actions a:nth-child(2) i { color: #25d366; }
  .mobile-actions__cta { flex-direction: row !important; gap: 8px !important; background: var(--btn); border-color: var(--btn) !important; color: #fff !important; font-size: .9rem !important; }
  .mobile-actions__cta i { color: #fff !important; font-size: .95rem !important; }
  .whatsapp-float { display: none !important; }
  #scrollToTopBtn { display: none !important; }
  body.menu-open .mobile-actions { display: none; }

  /* Ritmo verticale più compatto */
  .hero-overlay { padding: 48px 0 40px !important; }
  .hero-content--home .hero-title, .hero h1 { font-size: clamp(2.1rem, 9vw, 2.6rem) !important; margin-bottom: 18px; }
  .hero p, .hero-content--home .hero-subtitle { font-size: 1.02rem !important; margin-bottom: 24px !important; }
  .hero-trust { margin-top: 24px !important; align-items: flex-start !important; padding-left: 4px; }
  .page-hero { padding: 40px 0 36px !important; }
  .page-title { font-size: clamp(1.9rem, 8vw, 2.4rem) !important; }
  .page-lead { font-size: 1rem !important; }
  .page-section { padding: 52px 0 !important; }
  .page-section--compact { padding: 40px 0 !important; }
  .home-summary { padding: 52px 0 24px !important; }
  .section-heading { margin-bottom: 24px !important; text-align: left !important; }
  .section-heading h2 { font-size: clamp(1.6rem, 7vw, 2rem) !important; }
  .section-action { justify-content: stretch; }

  .feature-card, .faq-item, .home-summary__card { padding: 22px 20px !important; }
  .story-card, .contact-form-shell, .home-contact__intro, .page-cta { padding: 22px !important; }
  .form-contatto--home { padding: 20px !important; }
  .service-panel { grid-template-columns: 1fr; padding: 22px; gap: 16px; }
  .service-panel__icon { width: 64px; height: 64px; }
  .contact-grid { grid-template-columns: 1fr !important; }
  .page-cta { flex-direction: column; align-items: stretch !important; }
  .page-cta .btn { width: 100%; }

  /* Home: niente scorrimento automatico, carosello a scorrimento con il dito */
  .home-summary__summary { padding: 0 !important; }
  .home-summary__card::after { display: none; }

  /* Portfolio */
  .works-grid { grid-template-columns: 1fr; gap: 44px; }
  .works-toolbar { top: var(--header-h); margin: 0 -16px 24px; padding: 10px 16px; }
  .works-count { display: none; }
  .work-card__visual { padding: 16px 16px 0; }
  .phone { right: 10px; width: 26%; min-width: 72px; }
  .works-hero-stats { width: 100%; }
  .works-hero-stats div { flex: 1; padding: 12px 14px; }
  .works-hero-stats strong { font-size: 1.3rem; }
  .rail__track { grid-auto-columns: 86%; gap: 16px; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; }
  .rail__nav { display: none; }
  .case-browser .work-card__visual { padding: 16px 16px 0; }

  .footer-modern { padding-top: 48px; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand__text small { display: none; }
  .mobile-actions { grid-template-columns: 1fr 1fr 1.3fr; }
  .mobile-actions__cta span { font-size: .82rem; }
}

/* ---------- Pagine legali (Privacy, Cookie): seguono il tema ---------- */
.privacy-container { padding: 64px 20px 80px !important; }
.privacy-container h1 { text-align: left !important; color: var(--text-strong) !important; font-size: clamp(2rem, 4vw, 2.8rem) !important; border-bottom: 1px solid var(--line) !important; padding-bottom: 18px !important; }
.privacy-container h2 { color: var(--text-strong) !important; font-size: 1.3rem !important; }
.privacy-container strong { color: var(--text-strong); }

/* Link area riservata nel footer */
.footer-admin { display: inline-flex; align-items: center; gap: 6px; }
.footer-admin i { font-size: .75em; }

/* Titoli con a capo manuale: niente limite di larghezza, decide l'autore */
.page-title:has(br), .hero-title:has(br) { max-width: none !important; }
