/* ==========================================================================
   davidebalzano.it — tema "Evoluzione"
   Colori, font e componenti. Tema chiaro di default, scuro con [data-theme="dark"].
   ========================================================================== */

/* Font self-hosted (nessuna richiesta a Google: più veloce e senza problemi GDPR) */
@font-face { font-family: "Dosis"; src: url("../fonts/dosis-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("../fonts/pt-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("../fonts/pt-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("../fonts/pt-sans-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F4F5F5;
  --surface: #FFFFFF;
  --surface-alt: #F4F5F5;
  --ink: #1E2326;
  --text: #50585C;
  --muted: #646C70;
  --faint: #8A9397;
  --line: #E3E7E9;
  --line-strong: #D5DCDF;
  --ghost-bg: #E6EAEB;
  --ghost-surface: #EEF1F2;
  --teal: #319FB9;
  --teal-ink: #1C7A91;
  --teal-hover: #145E70;
  --teal-tint: #E6F3F6;
  --teal-tint-2: #DCEFF4;
  --teal-tint-text: #145E70;
  --accent-btn: #1C7A91;
  --accent-btn-text: #FFFFFF;
  --accent-btn-hover: #145E70;
  --invert-bg: #1E2326;
  --invert-text: #FFFFFF;
  --code-bg: #1E2326;
  --code-text: #E8EEF0;
  --code-kw: #7FD0E2;
  --code-str: #F2C77C;
  --shard-a: #E8ECED;
  --shard-b: #EBEEEF;
  --shard-teal: rgba(49, 159, 185, 0.08);
  --photo-bg: #DCEFF4;
  --photo-s1: #E8F4F7;
  --photo-s2: #CBE7EE;
  --photo-s3: rgba(49, 159, 185, 0.3);
  --tabbar-bg: #1E2326;
  --tabbar-text: #C3CCD0;
  --tabbar-active-bg: #2D3438;
  --tabbar-active-text: #7FD0E2;
  --danger: #B4380B;
  --shadow-lg: 0 40px 80px -40px rgba(30, 35, 38, 0.35);
  --shadow-md: 0 20px 40px -20px rgba(30, 35, 38, 0.35);
  --radius-lg: 32px;
  --radius-md: 24px;
  --font-display: "Dosis", "PT Sans", system-ui, sans-serif;
  --font-body: "PT Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 32px);
  --header-h: 92px;          /* altezza testata in cima alla pagina */
  --header-h-compact: 64px;  /* altezza testata compatta, durante lo scroll */
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1518;
  --surface: #141D21;
  --surface-alt: #1A252A;
  --ink: #E8EEF0;
  --text: #A9B8BD;
  --muted: #8FA0A6;
  --faint: #6E8189;
  --line: #22313A;
  --line-strong: #2E414A;
  --ghost-bg: #152127;
  --ghost-surface: #1A272D;
  --teal: #3DB0CB;
  --teal-ink: #5CC3DB;
  --teal-hover: #8FDDEE;
  --teal-tint: #16303A;
  --teal-tint-2: #183A45;
  --teal-tint-text: #9BE2F1;
  --accent-btn: #319FB9;
  --accent-btn-text: #06181D;
  --accent-btn-hover: #4FC3DD;
  --invert-bg: #E8EEF0;
  --invert-text: #0E1518;
  --code-bg: #0A1013;
  --shard-a: #111A1E;
  --shard-b: #121C20;
  --shard-teal: rgba(61, 176, 203, 0.1);
  --photo-bg: #16303A;
  --photo-s1: #1B3A45;
  --photo-s2: #12303A;
  --photo-s3: rgba(61, 176, 203, 0.25);
  --tabbar-bg: #1A252A;
  --tabbar-text: #A9B8BD;
  --tabbar-active-bg: #23343B;
  --tabbar-active-text: #8FDDEE;
  --danger: #FF9B6A;
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.65);
  --shadow-md: 0 20px 40px -20px rgba(0, 0, 0, 0.65);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  padding-top: var(--header-h); /* spazio per la testata fissa */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--teal-ink); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--teal-hover); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); color: var(--ink); line-height: 1.1; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 100;
  padding: 12px 18px; border-radius: 12px; background: var(--invert-bg); color: var(--invert-text);
  font-family: var(--font-display); font-weight: 700;
}
.skip-link:focus { top: 16px; color: var(--invert-text); }

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

/* --------------------------------------------------------------------------
   Bottoni e piccoli componenti
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1;
  cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-btn); color: var(--accent-btn-text); }
.btn-primary:hover { background: var(--accent-btn-hover); color: var(--accent-btn-text); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--teal); color: var(--ink); }
.btn-secondary svg { color: var(--teal-ink); }

.pill-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
}
.pill-link:hover { border-color: var(--teal); color: var(--ink); }
.pill-link svg { width: 20px; height: 20px; color: var(--teal-ink); }

.icon-box {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 58px; height: 58px; border-radius: 18px; background: var(--teal-tint); color: var(--teal-ink);
}
.icon-box svg { width: 30px; height: 30px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(49, 159, 185, 0.22); flex: none; }

/* --------------------------------------------------------------------------
   Header — fisso in alto; quando la pagina scorre (<html class="is-scrolled">)
   diventa compatto: logo senza testo, menu, tema chiaro/scuro e "Scrivimi".
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: var(--header-h); transition: min-height .3s ease;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); transition: gap .3s ease; }
.brand:hover { color: var(--ink); }
.brand svg { width: 28px; height: auto; transition: width .3s ease; }
.brand-name {
  display: flex; flex-direction: column; line-height: 1.15; max-width: 260px; overflow: hidden; white-space: nowrap;
  transition: max-width .35s ease, opacity .2s ease;
}
.brand-name strong { font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--ink); }
.brand-name small { font-size: 14px; color: var(--muted); }

.main-nav { display: none; transition: padding .3s ease; }
.main-nav a {
  padding: 10px 18px; border-radius: 999px; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 16px; transition: background-color .2s ease, color .2s ease, padding .3s ease, font-size .3s ease;
}
.main-nav a:hover { background: var(--surface-alt); color: var(--ink); }
.main-nav a[aria-current="true"] { background: var(--invert-bg); color: var(--invert-text); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-cta { display: none; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; transition: border-color .2s ease, background-color .3s ease, width .3s ease, height .3s ease;
}
.theme-toggle:hover { border-color: var(--teal); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (min-width: 960px) {
  :root { --header-h: 104px; }
  .main-nav { display: flex; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
  .header-cta { display: inline-flex; min-height: 48px; padding: 0 22px; font-size: 17px; }
}

/* Testata compatta */
.is-scrolled .site-header {
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
  box-shadow: 0 14px 34px -26px rgba(0, 0, 0, 0.5);
}
.is-scrolled .header-inner { min-height: var(--header-h-compact); }
.is-scrolled .brand { gap: 0; }
.is-scrolled .brand svg { width: 24px; }
.is-scrolled .brand-name { max-width: 0; opacity: 0; }
.is-scrolled .main-nav { padding: 4px; }
.is-scrolled .main-nav a { padding: 8px 15px; font-size: 15px; }
.is-scrolled .theme-toggle { width: 42px; height: 42px; }
.is-scrolled .header-cta {
  display: inline-flex; min-height: 42px; padding: 0 18px; font-size: 16px; gap: 8px;
  animation: header-pop .3s ease both;
}
.is-scrolled .header-cta svg { width: 18px; height: 18px; }
.is-scrolled .header-back { min-height: 42px; }
@media (max-width: 479px) { .is-scrolled .header-back { width: 42px; } }
@keyframes header-pop { from { opacity: 0; transform: translateY(-4px); } }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
body { position: relative; }
.page-shards { position: absolute; left: 0; right: 0; top: 0; height: 1380px; overflow: hidden; pointer-events: none; z-index: 0; }
@media (min-width: 960px) { .page-shards { height: 960px; } }
.hero { position: relative; z-index: 1; }
.shards { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.shards .sa { fill: var(--shard-a); }
.shards .sb { fill: var(--shard-b); }
.shards .st { fill: var(--shard-teal); }
.shards polygon { transition: fill .3s ease; }

.hero-grid { position: relative; z-index: 1; display: grid; gap: 56px; align-items: center; padding-block: 32px 96px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--ink);
}
.hero h1 { margin-top: 24px; font-weight: 700; font-size: clamp(60px, 8.4vw, 112px); line-height: .92; letter-spacing: -0.02em; }
.hero h1 span { color: var(--teal); }
.chips { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 16px;
}
.chip.is-strong { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-text); }
.lead { margin-top: 28px; max-width: 560px; font-size: clamp(18px, 1.9vw, 20px); line-height: 1.55; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-media { position: relative; width: calc(100% - 44px); max-width: 440px; justify-self: center; }
.bracket { position: absolute; width: clamp(84px, 10vw, 130px); aspect-ratio: 1; border: 0 solid var(--teal); pointer-events: none; }
.bracket-tl { left: -22px; top: -22px; border-top-width: 3px; border-left-width: 3px; }
.bracket-br { right: -22px; bottom: -22px; border-bottom-width: 3px; border-right-width: 3px; }
.photo-card { position: relative; padding: 12px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.photo-frame { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: var(--photo-bg); }
.photo-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-frame .s1 { fill: var(--photo-s1); }
.photo-frame .s2 { fill: var(--photo-s2); }
.photo-frame .s3 { fill: var(--photo-s3); }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }

.float-card {
  position: absolute; left: -12px; bottom: 24px; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 10px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-md);
}
.float-card .num {
  display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 13px;
  background: var(--teal-tint); color: var(--teal-tint-text); font-family: var(--font-display); font-weight: 800; font-size: 19px;
}
.float-card strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.2; }
.float-card small { font-size: 13px; color: var(--muted); }
.code-chip {
  position: absolute; right: -36px; top: 48px; display: none; padding: 12px 16px; border-radius: 14px;
  background: var(--code-bg); color: var(--code-text); font-family: var(--font-mono); font-size: 14px; white-space: nowrap; box-shadow: var(--shadow-md);
}
.code-chip .kw { color: var(--code-kw); }
.code-chip .str { color: var(--code-str); }

@media (min-width: 600px) {
  .float-card { left: -48px; bottom: 48px; gap: 14px; padding: 12px 20px 12px 12px; border-radius: 20px; }
  .float-card .num { width: 52px; height: 52px; border-radius: 14px; font-size: 21px; }
  .float-card strong { font-size: 18px; }
  .float-card small { font-size: 14px; }
  .code-chip { display: block; }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.25fr 1fr; gap: 72px; padding-block: 56px 120px; }
}

/* --------------------------------------------------------------------------
   Collaborazioni
   -------------------------------------------------------------------------- */
.collab { position: relative; z-index: 1; background: var(--surface); border-block: 1px solid var(--line); }
.collab .container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 48px; padding-block: 24px; }
.collab p { max-width: 200px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.collab ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; flex: 1 1 560px; justify-content: space-between; gap: 6px 36px; }
.collab li { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2vw, 24px); letter-spacing: .02em; color: var(--faint); }

/* --------------------------------------------------------------------------
   Sezioni
   -------------------------------------------------------------------------- */
.section { position: relative; overflow: hidden; padding-block: clamp(72px, 9vw, 112px); }
.section--surface { background: var(--surface); }
.section-head { position: relative; padding-top: clamp(40px, 5vw, 64px); }
.ghost {
  position: absolute; left: -0.04em; top: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(84px, 13vw, 160px); line-height: 1; letter-spacing: -0.03em; white-space: nowrap;
  color: var(--ghost-bg); pointer-events: none; user-select: none; transition: color .3s ease;
}
.section--surface .ghost, .contact-card .ghost { color: var(--ghost-surface); }
.section-head h2 { position: relative; font-weight: 700; font-size: clamp(38px, 5vw, 54px); line-height: 1.05; }
.tag { position: relative; display: inline-block; margin-top: 14px; padding: 6px 14px; background: var(--accent-btn); color: var(--accent-btn-text); font-size: 16px; line-height: 1.4; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-intro { max-width: 400px; font-size: 18px; }

/* Chi sono */
.about-grid { display: grid; gap: 48px; margin-top: 56px; }
.about-text h3 { font-weight: 700; font-size: 28px; }
.about-text h3 span { color: var(--teal-ink); }
.about-text p { margin-top: 18px; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.7; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-self: start; }
.fact { padding: 22px; border-radius: 20px; background: var(--surface-alt); }
.fact dt { font-size: 14px; color: var(--muted); }
.fact dd { margin: 6px 0 0; display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.8vw, 21px); color: var(--ink); overflow-wrap: anywhere; }
.fact dd a { color: var(--teal-ink); }
@media (max-width: 599px) { .fact--wide { grid-column: 1 / -1; } }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.3fr 1fr; gap: 64px; } }

/* Servizi */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 56px; }
.service { position: relative; padding: 34px 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); transition: border-color .2s ease, transform .25s ease; }
.service:hover { border-color: var(--teal); transform: translateY(-3px); }
.service-num { position: absolute; right: 24px; top: 24px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--faint); }
.service h3 { margin-top: 26px; font-weight: 700; font-size: 25px; }
.service p { margin-top: 12px; font-size: 17px; }
@media (max-width: 599px) {
  .services-grid { gap: 12px; margin-top: 40px; }
  .service { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; padding: 22px; }
  .service .icon-box { grid-row: span 2; width: 52px; height: 52px; border-radius: 16px; }
  .service .icon-box svg { width: 26px; height: 26px; }
  .service h3 { margin-top: 0; font-size: 21px; }
  .service p { margin-top: 4px; font-size: 16px; }
  .service-num { display: none; }
}

/* Curriculum */
.cv-grid { display: grid; gap: 56px; margin-top: 56px; }
.cv-grid > div > h3 { font-weight: 700; font-size: 24px; margin-bottom: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 1fr; gap: 2px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-date { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--teal-ink); }
.tl-date.is-past { color: var(--muted); }
.tl-body strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink); }
.tl-body span { font-size: 16px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-group { padding: 26px; border-radius: var(--radius-md); background: var(--surface-alt); }
.stack-group h4 { font-weight: 700; font-size: 19px; }
.tags { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 13px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 15px; }
.tags li.is-core { background: var(--teal-tint-2); color: var(--teal-tint-text); font-weight: 700; }
.cv-download {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 0 26px;
  border-radius: var(--radius-md); background: var(--invert-bg); color: var(--invert-text);
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
}
.cv-download:hover { color: var(--invert-text); opacity: .9; }
.cv-download svg { width: 22px; height: 22px; color: var(--teal); }
@media (min-width: 600px) { .timeline li { grid-template-columns: 140px minmax(0, 1fr); gap: 20px; padding-block: 20px; } }
@media (min-width: 960px) { .cv-grid { grid-template-columns: 1.35fr 1fr; gap: 64px; } }

/* Portfolio */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 16px; cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.filter:hover { border-color: var(--teal); }
.filter[aria-pressed="true"] { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-text); }
.projects { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.project[hidden] { display: none; }
.project-card {
  display: block; height: 100%; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease;
}
a.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); color: var(--ink); }
.browser { display: block; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; background: var(--surface-alt); }
.browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.browser img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: top; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 10px 8px; }
.project-meta strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.25; color: var(--ink); }
.project-meta span { font-size: 15px; color: var(--muted); }
.arrow { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--teal-tint); color: var(--teal-ink); }
.arrow svg { width: 20px; height: 20px; }
.projects-more { display: flex; justify-content: center; margin-top: 44px; }
.projects-more[hidden] { display: none; }
@media (max-width: 599px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
  .projects { grid-template-columns: 1fr; gap: 18px; }
}

/* Contatti */
.contact { padding-top: 0; }
.contact-wrap { position: relative; margin-inline: 14px; }
.contact-wrap .bracket { width: clamp(80px, 10vw, 140px); }
.contact-wrap .bracket-tl { left: -14px; top: -14px; }
.contact-wrap .bracket-br { right: -14px; bottom: -14px; }
.contact-card { position: relative; display: grid; gap: 40px; padding: clamp(26px, 5vw, 64px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.contact-card .section-head h2 { font-size: clamp(34px, 4.6vw, 50px); }
.contact-text > p { margin-top: 26px; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.65; }
.contact-list { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 16px; }
.contact-list .icon-box { width: 48px; height: 48px; border-radius: 14px; }
.contact-list .icon-box svg { width: 22px; height: 22px; }
.contact-list a, .contact-list .value { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2vw, 21px); overflow-wrap: anywhere; }
.contact-list .value { color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
@media (min-width: 960px) { .contact-wrap { margin-inline: 0; } .contact-card { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* Form */
.form { position: relative; display: flex; flex-direction: column; gap: 18px; padding: clamp(22px, 3vw, 36px); border-radius: var(--radius-md); background: var(--surface-alt); }
.form-row { display: grid; gap: 18px; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; font-size: 17px; transition: border-color .2s ease;
}
.field textarea { min-height: 132px; padding: 14px 16px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { border-color: var(--teal); }
.needs { margin: 0; padding: 0; border: 0; min-width: 0; }
.needs legend { padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 16px; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
.check-chip input:checked + span { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-text); }
.check-chip input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.privacy { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--text); }
.privacy input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--teal); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { width: 100%; min-height: 56px; font-size: 19px; }
.form .btn[disabled] { opacity: .7; cursor: progress; }
.form-status { min-height: 1.5em; font-size: 16px; font-weight: 700; }
.form-status.is-ok { color: var(--teal-ink); }
.form-status.is-error { color: var(--danger); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand svg { width: 22px; height: auto; }
.footer-inner p { font-size: 15px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }

/* Tab bar mobile (richiamo alla vecchia navigazione laterale a icone) */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 480px; margin: 0 auto; padding: 6px;
  background: var(--tabbar-bg); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 22px;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.55);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 16px; color: var(--tabbar-text); font-size: 12px; line-height: 1.2; }
.tabbar a:hover { color: var(--tabbar-active-text); }
.tabbar a[aria-current="true"] { background: var(--tabbar-active-bg); color: var(--tabbar-active-text); }
.tabbar svg { width: 22px; height: 22px; }
@media (max-width: 959px) { .site-footer { padding-bottom: 92px; } }
@media (min-width: 960px) { .tabbar { display: none; } }

/* Animazione d'ingresso leggera */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Cookie bar e preferenze
   -------------------------------------------------------------------------- */
.cc-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 200;
  max-width: 440px; padding: 24px 22px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow-lg), 0 12px 32px -12px rgba(0, 0, 0, 0.18);
  animation: cc-in .35s ease both;
}
.cc-banner[hidden] { display: none; }
.cc-banner::before {
  content: ""; position: absolute; left: -8px; top: -8px; width: 56px; height: 56px;
  border-top: 3px solid var(--teal); border-left: 3px solid var(--teal); border-top-left-radius: 6px; pointer-events: none;
}
@keyframes cc-in { from { opacity: 0; transform: translateY(16px); } }
.cc-eyebrow { display: inline-block; padding: 4px 10px; background: var(--accent-btn); color: var(--accent-btn-text); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.cc-title { margin-top: 10px; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.15; color: var(--ink); }
.cc-text { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--text); }
.cc-text a, .cc-small a { text-decoration: underline; text-underline-offset: 3px; }
.cc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px;
  border-radius: 999px; border: 1px solid transparent; font-family: var(--font-display); font-weight: 700; font-size: 16px;
  cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.cc-btn--primary { background: var(--accent-btn); color: var(--accent-btn-text); }
.cc-btn--primary:hover { background: var(--accent-btn-hover); }
.cc-btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.cc-btn--secondary:hover { border-color: var(--teal); }
.cc-link {
  display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: none; cursor: pointer;
  color: var(--teal-ink); font-family: var(--font-display); font-weight: 600; font-size: 15px;
}
.cc-link:hover { color: var(--teal-hover); text-decoration: underline; text-underline-offset: 3px; }
.cc-close {
  position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.cc-close:hover { background: var(--surface-alt); color: var(--ink); }
.cc-close--static { position: static; flex: none; }
.cc-banner-open .tabbar { visibility: hidden; }
@media (min-width: 600px) { .cc-banner { left: 24px; right: auto; bottom: 24px; padding: 28px 26px 16px; } }

.cc-dialog {
  width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 28px;
  background: var(--surface); color: var(--text); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.5);
}
.cc-dialog::backdrop { background: rgba(14, 21, 24, 0.55); backdrop-filter: blur(3px); }
.cc-panel { display: flex; flex-direction: column; gap: 14px; padding: 26px 22px 18px; }
.cc-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cc-panel-head .cc-title { margin-top: 4px; font-size: 28px; }
.cc-cat { padding: 16px 18px; border-radius: 18px; background: var(--surface-alt); }
.cc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-cat-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink); cursor: pointer; }
.cc-badge { padding: 2px 9px; border-radius: 999px; background: var(--teal-tint-2); color: var(--teal-tint-text); font-family: var(--font-body); font-size: 12px; font-weight: 700; }
.cc-cat-text { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.cc-switch { position: relative; flex: none; width: 52px; height: 30px; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color .2s ease; }
.cc-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .2s ease; }
.cc-switch input:checked + .cc-track { background: var(--accent-btn); }
.cc-switch input:checked + .cc-track::after { transform: translateX(22px); }
.cc-switch input:disabled + .cc-track { opacity: .55; }
.cc-switch input:focus-visible + .cc-track { outline: 3px solid var(--teal); outline-offset: 2px; }
.cc-panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.cc-panel-actions .cc-btn--primary { grid-column: 1 / -1; order: -1; }
.cc-small { text-align: center; font-size: 14px; }
@media (min-width: 600px) {
  .cc-panel { padding: 32px 30px 22px; }
  .cc-panel-actions { grid-template-columns: repeat(3, 1fr); }
  .cc-panel-actions .cc-btn--primary { grid-column: auto; order: 0; }
}
.footer-links button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--teal-ink); font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.footer-links button:hover { color: var(--teal-hover); }

/* --------------------------------------------------------------------------
   Pagine legali (cookie policy, privacy)
   -------------------------------------------------------------------------- */
.legal-main { position: relative; z-index: 1; padding-block: 24px 96px; }
.legal { max-width: 860px; margin: 0 auto; padding: clamp(26px, 5vw, 56px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.legal .tag { margin-top: 0; }
.legal h1 { margin-top: 16px; font-weight: 700; font-size: clamp(38px, 5vw, 54px); line-height: 1.05; }
.legal .updated { margin-top: 10px; font-size: 15px; color: var(--muted); }
.legal h2 { margin-top: 40px; font-weight: 700; font-size: clamp(24px, 3vw, 30px); }
.legal p, .legal li { font-size: 17px; line-height: 1.7; }
.legal p { margin-top: 14px; }
.legal ul { margin: 14px 0 0; padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.legal table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal th { background: var(--surface-alt); font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.legal tr:last-child td { border-bottom: 0; }
.legal code { padding: 2px 6px; border-radius: 6px; background: var(--surface-alt); font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.legal .btn { margin-top: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.back-link svg { width: 18px; height: 18px; }

.header-back { min-height: 48px; padding: 0 18px; font-size: 16px; }
@media (max-width: 479px) {
  .header-back { width: 48px; padding: 0; }
  .header-back .hb-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* --------------------------------------------------------------------------
   Pulsanti flottanti: torna su + WhatsApp
   -------------------------------------------------------------------------- */
.fab-stack {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 55;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  transition: opacity .25s ease, visibility .25s;
}
.cc-banner-open .fab-stack { opacity: 0; visibility: hidden; }
.fab {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform .25s ease, background-color .2s ease, opacity .25s ease, visibility .25s;
}
.fab:hover { transform: translateY(-2px); }
.fab-icon { position: relative; width: 24px; height: 24px; }
.fab-top { background: var(--surface); color: var(--ink); opacity: 0; visibility: hidden; transform: translateY(10px) scale(.9); }
.fab-top:hover { color: var(--ink); }
.fab-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.fab-top.is-visible:hover { transform: translateY(-2px); }
.fab-progress { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fab-progress circle { fill: none; stroke-width: 3; }
.fab-progress-track { stroke: var(--line); }
.fab-progress-bar { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.fab-wa { background: #128C7E; color: #FFFFFF; }
.fab-wa:hover { background: #0E7A6E; color: #FFFFFF; }
.fab-label {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%);
  padding: 8px 14px; border-radius: 999px; background: var(--invert-bg); color: var(--invert-text);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
@media (hover: hover) and (pointer: fine) {
  .fab:hover .fab-label, .fab:focus-visible .fab-label { opacity: 1; visibility: visible; transform: translate(0, -50%); }
}
@media (min-width: 960px) {
  .fab-stack { right: 24px; bottom: 24px; }
  .fab { width: 56px; height: 56px; }
}
/* Su mobile i pulsanti stanno sopra la tab bar */
@media (max-width: 959px) {
  body:has(.tabbar) .fab-stack { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

/* --------------------------------------------------------------------------
   Pagina progetto (case study)
   -------------------------------------------------------------------------- */
.case { position: relative; z-index: 1; }
.case-hero { padding-block: 8px clamp(40px, 6vw, 72px); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 15px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--teal-ink); }
.crumbs [aria-current] { color: var(--ink); font-weight: 700; }
.case-hero-grid { display: grid; gap: 40px; align-items: end; margin-top: clamp(24px, 4vw, 44px); }
.case-hero .tag { margin-top: 0; }
.case-hero h1 { margin-top: 18px; font-weight: 700; font-size: clamp(52px, 8vw, 104px); line-height: .92; letter-spacing: -0.02em; }
.case-hero h1 span { color: var(--teal); }
.case-hero .lead { max-width: 620px; }
.case-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.case-facts > div { padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.case-facts dt { font-size: 14px; color: var(--muted); }
.case-facts dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.25; color: var(--ink); }
.case-facts-wide { grid-column: 1 / -1; }
.todo {
  display: inline-block; padding: 1px 10px; border: 1px dashed var(--teal); border-radius: 8px;
  font-family: var(--font-body); font-weight: 400; font-size: 15px; color: var(--teal-ink);
}
@media (min-width: 960px) { .case-hero-grid { grid-template-columns: 1.4fr 1fr; gap: 64px; } }

.case-showcase { padding-bottom: clamp(48px, 7vw, 96px); }
.showcase { position: relative; margin-inline: 14px; padding-bottom: 40px; }
.showcase .bracket-tl { left: -14px; top: -14px; }
.showcase .bracket-br { right: -14px; bottom: 26px; }
.device-desktop {
  position: relative; margin: 0; overflow: hidden; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.device-desktop img, .shot img { width: 100%; height: auto; }
.browser-bar span {
  margin-left: 10px; padding: 3px 12px; border-radius: 999px; background: var(--surface);
  font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.device-desktop .browser-bar { height: 34px; padding: 0 16px; }
.device-phone {
  position: absolute; right: 4%; bottom: 0; width: clamp(110px, 18%, 220px); margin: 0; padding: 7px;
  border-radius: 30px; background: #12191C; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.55);
}
.device-phone img { width: 100%; height: auto; aspect-ratio: 390 / 840; object-fit: cover; object-position: top; border-radius: 24px; }
@media (max-width: 599px) {
  .device-phone { width: 34%; border-radius: 22px; padding: 5px; }
  .device-phone img { border-radius: 18px; }
  .showcase { padding-bottom: 56px; }
}
@media (min-width: 960px) { .showcase { margin-inline: 0; } }

.case-numbers { padding-bottom: clamp(56px, 8vw, 104px); }
.numbers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.numbers li { padding: 22px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.numbers strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(48px, 6vw, 72px); line-height: .9; color: var(--teal); }
.numbers span { display: block; margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--text); }
@media (min-width: 960px) { .numbers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } .numbers li { padding: 28px; } }

.case-columns { display: grid; gap: 32px; margin-top: 48px; }
.case-columns h3 { font-weight: 700; font-size: 24px; }
.case-columns p { margin-top: 12px; font-size: 17px; line-height: 1.7; }
@media (min-width: 960px) { .case-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; } }

.case-features { margin-top: 48px; }
@media (min-width: 960px) { .case-features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.case-gallery { display: grid; gap: 28px; margin-top: 48px; }
.shot { margin: 0; }
.shot .browser-bar { border-radius: 18px 18px 0 0; border: 1px solid var(--line); border-bottom: 0; }
.shot--wide img, .shot--full img { display: block; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; box-shadow: var(--shadow-md); }
.shot--phone img { display: block; max-width: 300px; margin: 0 auto; padding: 6px; border-radius: 28px; background: #12191C; box-shadow: var(--shadow-md); }
.shot figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }
.shot--phone figcaption { text-align: center; }
@media (min-width: 960px) {
  .case-gallery { grid-template-columns: 2.4fr 1fr; align-items: start; gap: 36px; }
  .shot--full { grid-column: 1 / -1; }
}

.case-stack { display: grid; gap: 32px; }
.stack-cards { display: grid; gap: 14px; }
.stack-group h3 { font-weight: 700; font-size: 19px; }
@media (min-width: 960px) {
  .case-stack { grid-template-columns: 1fr 1.6fr; align-items: start; gap: 56px; }
  .stack-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.case-quote { margin: 48px 0 0; padding: 32px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.case-quote blockquote { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; color: var(--ink); }
.case-quote figcaption { margin-top: 14px; color: var(--muted); }

.case-end { padding-top: 0; }
.case-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager-link {
  display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 96px; padding: 20px 22px;
  border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .2s ease, transform .2s ease;
}
.pager-link:hover { border-color: var(--teal); color: var(--ink); transform: translateY(-2px); }
.pager-dir { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pager-dir svg { width: 16px; height: 16px; color: var(--teal-ink); }
.pager-link strong { font-family: var(--font-display); font-weight: 700; font-size: clamp(19px, 2vw, 24px); line-height: 1.2; }
.pager-link--next { text-align: right; align-items: flex-end; }
.pager-link--all { grid-column: 1 / -1; order: 2; min-height: 56px; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--teal-ink); }
@media (min-width: 720px) {
  .case-pager { grid-template-columns: 1fr auto 1fr; }
  .pager-link--all { grid-column: auto; order: 0; padding-inline: 28px; }
}
.case-cta { position: relative; margin: clamp(48px, 7vw, 88px) 14px 0; }
.case-cta .bracket-tl { left: -14px; top: -14px; }
.case-cta .bracket-br { right: -14px; bottom: -14px; }
.case-cta-inner {
  position: relative; display: grid; gap: 24px; align-items: center; padding: clamp(28px, 5vw, 56px);
  border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg);
}
.case-cta h2 { font-weight: 700; font-size: clamp(32px, 4.4vw, 50px); }
.case-cta p { margin-top: 12px; max-width: 560px; font-size: 18px; }
.case-cta .hero-ctas { margin-top: 0; }
@media (min-width: 960px) { .case-cta { margin-inline: 0; } .case-cta-inner { grid-template-columns: 1.4fr auto; gap: 40px; } }
