/* ============================================================
   Algorithmo Theme — Main Stylesheet
   ============================================================ */


/* ── Reset & Base ───────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Geist', sans-serif;
  background: #fff;
  color: #0d1a24;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { transition: color 0.2s ease; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #f5f7fa; }
::-webkit-scrollbar-thumb { background: var(--accent, #1e8bb5); border-radius: 2px; }


/* ── CSS Variable Fallbacks (overridden by wp_head) ─────────── */

:root {
  --accent:        #1e8bb5;
  --cta:           #e04e2a;
  --text:          #0d1a24;
  --text-muted:    #5a7080;
  --bg:            #ffffff;
  --bg-alt:        #f5f9fc;
  --border:        #e4edf4;
  --accent-05:     #edf6fa;
  --accent-08:     #e1f0f6;
  --accent-12:     #d0e8f2;
  --accent-20:     #b8d8eb;
  --accent-25:     #aad2e8;
  --accent-40:     #88bfd8;
  --accent-border: rgba(30,139,181,0.20);
  --accent-glow:   rgba(30,139,181,0.15);
  --cta-05:        #fdf0ec;
  --cta-glow:      rgba(224,78,42,0.08);
}


/* ── Scroll Reveal ──────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible       { opacity: 1; transform: translateY(0); }
.reveal-delay-1       { transition-delay: 0.1s; }
.reveal-delay-2       { transition-delay: 0.2s; }
.reveal-delay-3       { transition-delay: 0.3s; }
.reveal-delay-4       { transition-delay: 0.45s; }


/* ── Logo ───────────────────────────────────────────────────── */

.algo-logo       { height: 36px; width: auto; display: block; }
.algo-logo--small { height: 28px; }


/* ── Section label ──────────────────────────────────────────── */

.algo-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 18px;
  display: block;
}


/* ============================================================
   NAV
   ============================================================ */

.algo-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 60px;
  justify-content: space-between;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.algo-nav.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: #e8eef4;
}

.algo-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.algo-nav__links-wrap {
  display: flex;
  align-items: center;
  gap: 40px;
}

.algo-nav__links {
  display: flex;
  gap: 40px;
  align-items: center;
  list-style: none;
}

.algo-nav__link {
  font-size: 14px;
  color: #445566;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.algo-nav__link:hover { color: var(--accent); }

.algo-nav__cta {
  background: var(--accent);
  color: #fff;
  padding: 9px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.2s;
}
.algo-nav__cta:hover { background: var(--cta); color: #fff; }

.algo-nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.algo-nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #0d1a24;
  border-radius: 2px;
  transition: all 0.25s;
}


/* ============================================================
   HERO
   ============================================================ */

.algo-hero {
  padding-top: 110px;
  position: relative;
  overflow: hidden;
  background: #fafbfc;
  border-bottom: 1px solid #e8edf2;
}

.algo-hero__watermark {
  position: absolute;
  bottom: -6%;
  right: -2%;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(280px, 32vw, 520px);
  font-weight: 400;
  line-height: 0.82;
  color: #0d1a24;
  opacity: 0.035;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

.algo-hero__dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(13,26,36,0.094) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, black 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.algo-hero__glow {
  position: absolute;
  top: 0; right: 0;
  width: 55%; height: 60%;
  background: radial-gradient(ellipse at top right, var(--cta-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.algo-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
}

.algo-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-top: 8px;
}
.algo-hero__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cta);
  flex-shrink: 0;
}
.algo-hero__eyebrow-text {
  font-size: 12px;
  color: #5a7080;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.algo-hero__content { margin-bottom: 80px; }

.algo-hero__headline {
  font-family: 'Geist', sans-serif;
  font-size: clamp(56px, 7.5vw, 128px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: #0d1a24;
  margin-bottom: 56px;
  max-width: 15ch;
}
.algo-hero__headline-accent {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.algo-hero__body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 80px;
  align-items: end;
}

.algo-hero__body {
  font-size: 22px;
  color: #2a3f4e;
  line-height: 1.5;
  font-weight: 450;
  letter-spacing: -0.015em;
  max-width: 640px;
}
.algo-hero__body-accent-serif {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 1.14em;
}
.algo-hero__body-accent-cta {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--cta);
  font-size: 1.14em;
}

.algo-hero__ctas {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.algo-hero__cta-primary {
  background: #0d1a24;
  color: #fff;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.22s;
}
.algo-hero__cta-primary:hover { background: var(--accent); color: #fff; }

.algo-hero__cta-secondary {
  color: #0d1a24;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 22px;
  border-bottom: 1px solid #0d1a24;
  transition: color 0.2s, border-color 0.2s;
}
.algo-hero__cta-secondary:hover { color: var(--accent); border-color: var(--accent); }

.algo-hero__stats {
  margin-top: 16px;
  margin-bottom: 80px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}
.algo-hero__stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.algo-hero__stat + .algo-hero__stat {
  border-left: 1px solid var(--border);
  padding-left: 32px;
}
.algo-hero__stat-number {
  font-size: clamp(48px, 5vw, 72px);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: #0d1a24;
  letter-spacing: -0.02em;
  line-height: 1;
  font-weight: 400;
}
.algo-hero__stat-label {
  font-size: 13px;
  color: #5a7080;
  margin-top: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}


/* ============================================================
   LOGO TICKER
   ============================================================ */

.algo-ticker {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 60px;
  overflow: hidden;
}
.algo-ticker__inner {
  display: flex;
  gap: 80px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.algo-ticker__label {
  font-size: 11px;
  color: #9ab4c0;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.algo-ticker__divider {
  width: 1px;
  height: 20px;
  background: #d8e8f0;
  flex-shrink: 0;
}
.algo-ticker__item {
  font-size: 16px;
  font-weight: 600;
  color: #b8ccd8;
  letter-spacing: -0.02em;
  transition: color 0.2s;
  cursor: default;
}
.algo-ticker__item:hover { color: var(--accent); }


/* ============================================================
   CHI SIAMO
   ============================================================ */

.algo-chi-siamo {
  padding: 120px 60px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.algo-chi-siamo__watermark {
  position: absolute;
  top: 8%; left: -3%;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(220px, 24vw, 380px);
  font-weight: 400;
  line-height: 0.82;
  color: #0d1a24;
  opacity: 0.028;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

.algo-chi-siamo__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: center;
}

.algo-chi-siamo__visual {
  background: linear-gradient(140deg, var(--accent-08) 0%, var(--accent-05) 100%);
  border: 1px solid var(--accent-border);
  border-radius: 24px;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.algo-chi-siamo__arc {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.algo-chi-siamo__arc--1 {
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  border: 2px solid var(--accent-border);
}
.algo-chi-siamo__arc--2 {
  top: -30px; right: -30px;
  width: 150px; height: 150px;
  border: 1px solid var(--accent-12);
}

.algo-chi-siamo__skills {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.algo-chi-siamo__skill { }
.algo-chi-siamo__skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.algo-chi-siamo__skill-name { font-size: 13px; font-weight: 500; color: #334455; }
.algo-chi-siamo__skill-pct  { font-size: 12px; color: var(--accent); font-weight: 600; }

.algo-chi-siamo__skill-track {
  height: 4px;
  background: #e8f0f6;
  border-radius: 100px;
  overflow: hidden;
}
.algo-chi-siamo__skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-40));
  border-radius: 100px;
}

.algo-chi-siamo__badge {
  margin-top: 32px;
  padding: 20px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8f0f6;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(30,139,181,0.08);
}
.algo-chi-siamo__badge-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--cta-05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cta);
  flex-shrink: 0;
}
.algo-chi-siamo__badge-title { font-size: 14px; font-weight: 600; color: #0d1a24; letter-spacing: -0.01em; }
.algo-chi-siamo__badge-sub   { font-size: 12px; color: #8aabb8; margin-top: 2px; }

.algo-chi-siamo__title {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0d1a24;
  margin-bottom: 32px;
}

.algo-chi-siamo__body {
  font-size: 17px;
  color: #5a7080;
  line-height: 1.78;
  margin-bottom: 20px;
}
.algo-chi-siamo__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 13px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-top: 20px;
  transition: background 0.2s, transform 0.2s;
}
.algo-chi-siamo__cta:hover { background: var(--cta); transform: translateY(-2px); color: #fff; }


/* ============================================================
   SERVIZI
   ============================================================ */

.algo-servizi {
  padding: 120px 60px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.algo-servizi__inner { max-width: 1200px; margin: 0 auto; }

.algo-servizi__title {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0d1a24;
  margin-bottom: 20px;
}

.algo-servizi__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.algo-servizi__intro {
  font-size: 17px;
  color: #5a7080;
  line-height: 1.75;
  margin-bottom: 48px;
}

/* Accordion */
.algo-servizi__accordion { display: flex; flex-direction: column; }

.algo-servizi__item {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.algo-servizi__item-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.algo-servizi__item-num {
  font-size: 12px;
  color: #b0c4d0;
  font-weight: 700;
  min-width: 24px;
  transition: color 0.2s;
}
.algo-servizi__item-title {
  font-size: 17px;
  font-weight: 500;
  color: #5a7080;
  letter-spacing: -0.01em;
  transition: color 0.2s, font-weight 0.2s;
}
.algo-servizi__item-arrow {
  margin-left: auto;
  color: #b0c4d0;
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}
.algo-servizi__item-body {
  font-size: 14px;
  color: #6a8898;
  line-height: 1.7;
  margin-top: 12px;
  padding-left: 40px;
  display: none;
}

/* Active state */
.algo-servizi__item.is-active .algo-servizi__item-num   { color: var(--accent); }
.algo-servizi__item.is-active .algo-servizi__item-title { font-weight: 700; color: #0d1a24; }
.algo-servizi__item.is-active .algo-servizi__item-arrow { transform: rotate(90deg); color: var(--accent); }
.algo-servizi__item.is-active .algo-servizi__item-body  { display: block; }

/* Right sticky panel */
.algo-servizi__panel {
  position: sticky;
  top: 100px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 56px 48px;
  box-shadow: 0 8px 48px rgba(30,139,181,0.08);
}
.algo-servizi__panel-icon {
  width: 64px; height: 64px;
  background: var(--accent-12);
  border: 1px solid var(--accent-25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 28px;
}
.algo-servizi__panel-counter {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
}
.algo-servizi__panel-title   { font-size: 28px; font-weight: 800; color: #0d1a24; letter-spacing: -0.02em; margin-bottom: 16px; }
.algo-servizi__panel-desc    { font-size: 16px; color: #5a7080; line-height: 1.75; }
.algo-servizi__panel-tip {
  margin-top: 36px;
  padding: 18px 20px;
  background: var(--accent-08);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  font-size: 13px;
  color: #4a6878;
  line-height: 1.6;
}

/* CTA strip */
.algo-servizi__cta-strip {
  margin-top: 80px;
  background: var(--accent);
  border-radius: 20px;
  padding: 52px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}
.algo-servizi__cta-title { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 8px; }
.algo-servizi__cta-body  { font-size: 16px; color: rgba(255,255,255,0.75); line-height: 1.6; }
.algo-servizi__cta-btn {
  background: #fff;
  color: var(--accent);
  padding: 15px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}
.algo-servizi__cta-btn:hover { background: var(--cta); color: #fff; }


/* ============================================================
   PORTFOLIO
   ============================================================ */

.algo-portfolio { padding: 120px 60px; background: #fff; }
.algo-portfolio__inner { max-width: 1200px; margin: 0 auto; }
.algo-portfolio__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 64px;
}

.algo-portfolio__title {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0d1a24;
  margin-top: 4px;
}

.algo-portfolio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.algo-portfolio__card {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--card-primary, #1e8bb5) 8%, white),
    color-mix(in srgb, var(--card-secondary, #3ab8e0) 5%, white)
  );
}
.algo-portfolio__card--wide    { grid-column: span 2; min-height: 280px; }
.algo-portfolio__card--regular { min-height: 200px; }

.algo-portfolio__card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-primary, #1e8bb5) 38%, transparent);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--card-primary, #1e8bb5) 13%, transparent);
}

.algo-portfolio__deco-1,
.algo-portfolio__deco-2 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.5s ease;
}
.algo-portfolio__deco-1 {
  top: -50px; right: -50px;
  width: 220px; height: 220px;
  border: 2px solid color-mix(in srgb, var(--card-primary, #1e8bb5) 12%, transparent);
}
.algo-portfolio__card:hover .algo-portfolio__deco-1 { transform: scale(1.15); }
.algo-portfolio__deco-2 {
  top: -20px; right: -20px;
  width: 130px; height: 130px;
  border: 1px solid color-mix(in srgb, var(--card-secondary, #3ab8e0) 9%, transparent);
}

.algo-portfolio__card-body {
  padding: 36px 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}
.algo-portfolio__card--regular .algo-portfolio__card-body { padding: 28px; }

.algo-portfolio__card-logo {
  position: absolute;
  top: 28px;
  left: 36px;
  z-index: 2;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  max-height: 56px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.algo-portfolio__card--regular .algo-portfolio__card-logo {
  top: 20px;
  left: 24px;
  max-height: 46px;
  padding: 6px 10px;
  border-radius: 8px;
}
.algo-portfolio__card-logo img {
  max-height: 38px;
  max-width: 140px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.algo-portfolio__card--regular .algo-portfolio__card-logo img {
  max-height: 28px;
  max-width: 110px;
}

.algo-portfolio__card-tag {
  display: inline-block;
  background: color-mix(in srgb, var(--card-primary, #1e8bb5) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-primary, #1e8bb5) 25%, transparent);
  color: var(--card-primary, #1e8bb5);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  width: fit-content;
}
.algo-portfolio__card-name {
  font-size: 36px;
  font-weight: 800;
  color: #0d1a24;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.algo-portfolio__card--regular .algo-portfolio__card-name { font-size: 24px; }
.algo-portfolio__card-desc { font-size: 14px; color: #7a9ab0; }


/* ============================================================
   PERCHÉ SCEGLIERCI
   ============================================================ */

.algo-perche {
  padding: 120px 60px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.algo-perche__inner { max-width: 1200px; margin: 0 auto; }
.algo-perche__header { text-align: center; margin-bottom: 72px; }
.algo-perche__title {
  font-family: 'Geist', sans-serif;
  font-size: clamp(32px, 3.5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #0d1a24;
}
.algo-perche__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.algo-perche__card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 36px;
  box-shadow: 0 2px 16px rgba(30,139,181,0.05);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
}
.algo-perche__card:hover {
  box-shadow: 0 8px 32px var(--accent-glow);
  border-color: var(--accent-border);
  transform: translateY(-4px);
}
.algo-perche__card-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--accent-12);
  border: 1px solid var(--accent-25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 24px;
}
.algo-perche__card-title { font-size: 22px; font-weight: 700; color: #0d1a24; letter-spacing: -0.02em; margin-bottom: 12px; }
.algo-perche__card-desc  { font-size: 15px; color: #5a7080; line-height: 1.7; }


/* ============================================================
   BLOG
   ============================================================ */

.algo-blog {
  padding: 120px 60px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.algo-blog__inner { max-width: 1200px; margin: 0 auto; }
.algo-blog__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
}
.algo-blog__title {
  font-family: 'Geist', sans-serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0d1a24;
}
.algo-blog__all-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--accent-border);
  padding: 10px 20px;
  border-radius: 6px;
  transition: all 0.2s;
}
.algo-blog__all-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.algo-blog__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.algo-blog__card {
  display: block;
  padding: 40px 36px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.28s;
}
.algo-blog__card:hover {
  border-color: var(--accent-border);
  background: var(--accent-05);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--accent-glow);
}
.algo-blog__card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.algo-blog__card-tag {
  background: var(--accent-12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
}
.algo-blog__card-date   { font-size: 12px; color: #9ab4c0; }
.algo-blog__card-title  { font-size: 20px; font-weight: 700; color: #0d1a24; line-height: 1.4; letter-spacing: -0.02em; margin-bottom: 12px; }
.algo-blog__card-excerpt { font-size: 14px; color: #6a8898; line-height: 1.65; }
.algo-blog__card-read {
  margin-top: 24px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ============================================================
   CONTATTI
   ============================================================ */

.algo-contatti {
  padding: 120px 60px;
  background: #fff;
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.algo-contatti__watermark {
  position: absolute;
  bottom: -8%; right: -3%;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(240px, 26vw, 420px);
  font-weight: 400;
  line-height: 0.82;
  color: #0d1a24;
  opacity: 0.03;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}
.algo-contatti__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 100px;
  align-items: start;
}
.algo-contatti__title {
  font-size: clamp(32px, 3.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0d1a24;
  margin-bottom: 20px;
}

.algo-contatti__info { }
.algo-contatti__body {
  font-size: 17px;
  color: #5a7080;
  line-height: 1.78;
  margin-bottom: 56px;
}
.algo-contatti__info-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.algo-contatti__info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.algo-contatti__info-icon {
  width: 40px; height: 40px;
  background: var(--accent-12);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.algo-contatti__info-label {
  font-size: 11px;
  color: #9ab4c0;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.algo-contatti__info-value {
  font-size: 15px;
  color: #334455;
  text-decoration: none;
  transition: color 0.2s;
}
.algo-contatti__info-value:hover { color: var(--accent); }

.algo-contatti__form-wrap {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 44px;
}
.algo-contatti__form-title {
  font-size: 20px;
  font-weight: 700;
  color: #0d1a24;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

/* ── Contact Form 7 ─────────────────────────────────────────── */

.wpcf7 form               { display: flex; flex-direction: column; gap: 20px; }
.wpcf7 .wpcf7-form-control-wrap { display: block; width: 100%; }

.wpcf7 label {
  display: block;
  font-size: 13px;
  color: #556677;
  font-weight: 500;
  margin-bottom: 7px;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #dce8f0;
  border-radius: 8px;
  padding: 13px 16px;
  color: #0d1a24;
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 textarea:focus       { border-color: var(--accent); }
.wpcf7 textarea              { resize: vertical; min-height: 120px; }

.wpcf7 .wpcf7-acceptance     { display: flex; gap: 10px; align-items: flex-start; }
.wpcf7 .wpcf7-acceptance label {
  font-size: 13px;
  color: #7a9ab0;
  line-height: 1.5;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.wpcf7 .wpcf7-acceptance a   { color: var(--accent); text-decoration: none; }
.wpcf7 input[type="checkbox"] { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

.wpcf7 input[type="submit"] {
  background: var(--cta);
  color: #fff;
  border: none;
  padding: 15px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  box-shadow: 0 4px 20px rgba(224,78,42,0.25);
  width: 100%;
}
.wpcf7 input[type="submit"]:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(224,78,42,0.35); }

.wpcf7 .wpcf7-not-valid-tip {
  font-size: 12px;
  color: var(--cta);
  margin-top: 4px;
  display: block;
}
.wpcf7 .wpcf7-response-output {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: none;
}
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok {
  background: var(--accent-08);
  color: #1a6e8a;
  border: 1px solid var(--accent-border);
}
.wpcf7 .wpcf7-response-output.wpcf7-validation-errors,
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ng {
  background: #fff0ec;
  color: #b03010;
  border: 1px solid rgba(224,78,42,0.25);
}


/* ============================================================
   FOOTER
   ============================================================ */

.algo-footer {
  background: #0d1a24;
  padding: 72px 60px 36px;
  color: #fff;
}
.algo-footer__inner { max-width: 1200px; margin: 0 auto; }

.algo-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 60px;
}
.algo-footer__tagline {
  margin-top: 20px;
  font-size: 14px;
  color: #4a6a7e;
  line-height: 1.75;
  max-width: 280px;
}
.algo-footer__socials { display: flex; gap: 10px; margin-top: 28px; }
.algo-footer__social {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #4a6a7e;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.algo-footer__social:hover { background: var(--accent-border); color: var(--accent); }

.algo-footer__col-title {
  font-size: 11px;
  font-weight: 600;
  color: #7a9ab0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.algo-footer__col-links { display: flex; flex-direction: column; gap: 11px; list-style: none; }
.algo-footer__col-link  { font-size: 14px; color: #4a6070; text-decoration: none; transition: color 0.2s; }
.algo-footer__col-link:hover { color: #d0e4ef; }

.algo-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.algo-footer__copyright { font-size: 13px; color: #2a4050; }
.algo-footer__legal     { display: flex; gap: 24px; list-style: none; }
.algo-footer__legal-link { font-size: 12px; color: #2a4050; text-decoration: none; transition: color 0.2s; }
.algo-footer__legal-link:hover { color: #7a9ab0; }


/* ============================================================
   SINGLE POST
   ============================================================ */

.algo-single__hero {
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  padding: 120px 60px 72px;
}
.algo-single__hero-inner {
  max-width: 780px;
  margin: 0 auto;
}

.algo-single__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.algo-single__cat {
  background: var(--accent-12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.algo-single__cat:hover { background: var(--accent-20); }
.algo-single__sep  { color: #c0d4e0; }
.algo-single__date,
.algo-single__read { font-size: 13px; color: #8aabb8; font-weight: 500; }

.algo-single__title {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0d1a24;
  margin-bottom: 24px;
}
.algo-single__excerpt {
  font-size: 18px;
  color: #5a7080;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 680px;
}

.algo-single__author {
  display: flex;
  align-items: center;
  gap: 14px;
}
.algo-single__author-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-12);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.algo-single__author-name { font-size: 14px; font-weight: 600; color: #0d1a24; }
.algo-single__author-role { font-size: 12px; color: #8aabb8; margin-top: 2px; }

/* Body */
.algo-single__body-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 72px 60px 100px;
}

.algo-single__content {
  font-size: 17px;
  line-height: 1.8;
  color: #334455;
}
.algo-single__content h2 {
  font-size: 26px;
  font-weight: 700;
  color: #0d1a24;
  letter-spacing: -0.02em;
  margin: 48px 0 18px;
}
.algo-single__content h3 {
  font-size: 20px;
  font-weight: 700;
  color: #0d1a24;
  margin: 36px 0 14px;
}
.algo-single__content p { margin-bottom: 22px; }
.algo-single__content ul,
.algo-single__content ol {
  padding-left: 24px;
  margin-bottom: 22px;
}
.algo-single__content li { margin-bottom: 8px; }
.algo-single__content strong { color: #0d1a24; font-weight: 600; }
.algo-single__content em { font-style: italic; color: var(--accent); }
.algo-single__content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.algo-single__content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--accent-05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #5a7080;
}

/* Tags */
.algo-single__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.algo-single__tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: #5a7080;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s;
}
.algo-single__tag:hover { background: var(--accent-12); border-color: var(--accent-border); color: var(--accent); }

/* Prev/Next nav */
.algo-single__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}
.algo-single__nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}
.algo-single__nav-item:hover { border-color: var(--accent-border); background: var(--accent-05); }
.algo-single__nav-item--next { text-align: right; }
.algo-single__nav-dir { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.algo-single__nav-ttl { font-size: 14px; color: #0d1a24; font-weight: 600; line-height: 1.4; }

/* Back link */
.algo-single__back {
  display: inline-block;
  margin-top: 40px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.algo-single__back:hover { color: var(--cta); }

@media (max-width: 768px) {
  .algo-single__hero   { padding: 100px 24px 48px; }
  .algo-single__body-wrap { padding: 48px 24px 72px; }
  .algo-single__nav    { grid-template-columns: 1fr; }
}


/* ============================================================
   LEGAL PAGES (Privacy Policy, Cookie Policy)
   ============================================================ */

.algo-legal {
  background: var(--bg);
}
.algo-legal__hero {
  padding: 120px 40px 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.algo-legal__hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.algo-legal__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: var(--heading);
  margin: 0 0 12px;
}
.algo-legal__meta {
  font-size: 13px;
  color: var(--text-muted);
}
.algo-legal__body {
  padding: 56px 40px 96px;
}
.algo-legal__content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}
.algo-legal__content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  margin: 2.4em 0 0.6em;
  padding-top: 2em;
  border-top: 1px solid var(--border);
}
.algo-legal__content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.algo-legal__content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin: 1.6em 0 0.5em;
}
.algo-legal__content p  { margin: 0 0 1.2em; }
.algo-legal__content a  { color: var(--accent); text-decoration: underline; }
.algo-legal__content ul,
.algo-legal__content ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.algo-legal__content li { margin-bottom: 0.4em; }
.algo-legal__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 14px;
}
.algo-legal__content th,
.algo-legal__content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.algo-legal__content th {
  font-weight: 600;
  color: var(--heading);
  background: var(--surface);
}

@media (max-width: 768px) {
  .algo-legal__hero { padding: 100px 20px 40px; }
  .algo-legal__body { padding: 40px 20px 64px; }
  .algo-legal__content { font-size: 14px; }
}

/* ── CF7 acceptance checkbox ──────────────────────────────── */
.wpcf7-acceptance {
  margin: 16px 0 4px;
}
.wpcf7-acceptance .wpcf7-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}
.wpcf7-acceptance .wpcf7-list-item-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}
.wpcf7-acceptance .wpcf7-list-item-label a {
  color: var(--accent);
  text-decoration: underline;
}
.wpcf7-acceptance input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.wpcf7-acceptance .wpcf7-not-valid-tip {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
  display: block;
}

/* ============================================================
   ARCHIVE PAGES (Progetti & Blog)
   ============================================================ */

/* Hero */
.algo-archive-page__hero {
  padding: 120px 40px 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.algo-archive-page__hero-inner {
  max-width: 860px;
  margin: 0 auto;
}
.algo-archive-page__title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.1;
  margin: 10px 0 18px;
}
.algo-archive-page__intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 640px;
}

/* Filter bar */
.algo-archive__filters {
  position: sticky;
  top: 68px;
  z-index: 90;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}
.algo-archive__filters-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.algo-archive__filters-inner::-webkit-scrollbar { display: none; }

.algo-archive__filter {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 7px 18px;
  cursor: pointer;
  transition: all 0.18s;
}
.algo-archive__filter:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-05);
}
.algo-archive__filter.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* Body wrapper */
.algo-archive-page__body {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 40px 96px;
}

/* ── Project cards (archive) */
.algo-archive-proj__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.algo-pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--card-primary)   14%, white) 0%,
    color-mix(in srgb, var(--card-secondary) 10%, white) 100%);
  border: 1px solid color-mix(in srgb, var(--card-primary) 20%, transparent);
  min-height: 220px;
  transition: transform 0.22s, box-shadow 0.22s;
}
.algo-pcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--card-primary) 18%, transparent);
}
.algo-pcard__deco-1,
.algo-pcard__deco-2 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.algo-pcard__deco-1 {
  width: 180px; height: 180px;
  top: -60px; right: -60px;
  background: radial-gradient(circle, color-mix(in srgb, var(--card-primary) 25%, transparent), transparent 70%);
}
.algo-pcard__deco-2 {
  width: 120px; height: 120px;
  bottom: -40px; left: -30px;
  background: radial-gradient(circle, color-mix(in srgb, var(--card-secondary) 20%, transparent), transparent 70%);
}
.algo-pcard__body {
  position: relative;
  z-index: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.algo-pcard__logo {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 6px 10px;
  width: fit-content;
  max-height: 44px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 4px;
}
.algo-pcard__logo img {
  max-height: 28px;
  max-width: 110px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.algo-pcard__tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-primary);
  opacity: 0.85;
}
.algo-pcard__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.25;
}
.algo-pcard__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.algo-pcard__terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.algo-pcard__term {
  font-size: 11px;
  font-weight: 600;
  color: var(--card-primary);
  background: color-mix(in srgb, var(--card-primary) 10%, white);
  border: 1px solid color-mix(in srgb, var(--card-primary) 18%, transparent);
  border-radius: 100px;
  padding: 3px 10px;
}
.algo-pcard__arrow {
  margin-top: auto;
  padding-top: 16px;
  font-size: 16px;
  color: var(--card-primary);
  transition: transform 0.2s;
}
.algo-pcard:hover .algo-pcard__arrow { transform: translateX(4px); }

/* ── Blog cards (archive) */
.algo-archive-blog__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.algo-bcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.algo-bcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--accent-border);
}
.algo-bcard__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}
.algo-bcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.algo-bcard:hover .algo-bcard__img { transform: scale(1.04); }

.algo-bcard__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.algo-bcard__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.algo-bcard__tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-08);
  border-radius: 100px;
  padding: 3px 10px;
}
.algo-bcard__date,
.algo-bcard__read {
  font-size: 12px;
  color: var(--text-muted);
}
.algo-bcard__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.3;
}
.algo-bcard__excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.algo-bcard__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s;
}
.algo-bcard:hover .algo-bcard__cta { gap: 10px; }

/* Empty message */
.algo-archive__empty-msg {
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
  font-size: 16px;
}

/* Responsive archive */
@media (max-width: 1100px) {
  .algo-archive-proj__grid,
  .algo-archive-blog__grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .algo-archive-page__hero  { padding: 100px 20px 48px; }
  .algo-archive__filters    { padding: 0 20px; top: 60px; }
  .algo-archive-page__body  { padding: 40px 20px 64px; }
  .algo-archive-proj__grid,
  .algo-archive-blog__grid  { grid-template-columns: 1fr; }
}

/* ============================================================
   SINGLE PROGETTO
   ============================================================ */

.algo-progetto {
  --proj-primary:   var(--card-primary,   var(--accent));
  --proj-secondary: var(--card-secondary, var(--accent));
  background: var(--bg);
}

/* Hero */
.algo-progetto__hero {
  position: relative;
  overflow: hidden;
  padding: 120px 40px 80px;
}
.algo-progetto__hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--proj-primary) 0%, var(--proj-secondary) 100%);
  opacity: 0.12;
  z-index: 0;
}
.algo-progetto__hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, var(--proj-primary) 0%, transparent 65%);
  opacity: 0.18;
}
.algo-progetto__hero-inner {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
}
.algo-progetto__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--proj-primary);
  text-decoration: none;
  margin-bottom: 40px;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.algo-progetto__back:hover { opacity: 1; }

.algo-progetto__hero-body {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.algo-progetto__logo-wrap {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  background: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.algo-progetto__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.algo-progetto__hero-text { flex: 1; }
.algo-progetto__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--proj-primary);
  background: color-mix(in srgb, var(--proj-primary) 12%, white);
  border: 1px solid color-mix(in srgb, var(--proj-primary) 20%, transparent);
  border-radius: 100px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.algo-progetto__title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.15;
  margin: 0 0 10px;
}
.algo-progetto__subtitle {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.algo-progetto__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.algo-progetto__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.algo-progetto__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--proj-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: filter 0.2s, transform 0.15s;
}
.algo-progetto__cta:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.algo-progetto__cta--large {
  padding: 14px 32px;
  font-size: 15px;
  border-radius: 10px;
}

/* Body sections */
.algo-progetto__body {
  padding-bottom: 96px;
}
.algo-progetto__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Intro */
.algo-progetto__intro {
  padding: 64px 0 0;
}
.algo-progetto__intro-text {
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
  max-width: 720px;
}

/* Section title */
.algo-progetto__section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--proj-primary);
  margin: 0 0 20px;
}

/* Tech pills */
.algo-progetto__tech {
  padding: 56px 0 0;
}
.algo-progetto__tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.algo-progetto__tech-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  transition: border-color 0.2s, color 0.2s;
}
.algo-progetto__tech-pill:hover {
  border-color: var(--proj-primary);
  color: var(--proj-primary);
}

/* Challenge / Solution */
.algo-progetto__cs {
  padding: 56px 0 0;
}
.algo-progetto__cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.algo-progetto__cs-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}
.algo-progetto__cs-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--proj-primary);
  margin-bottom: 12px;
}
.algo-progetto__cs-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

/* Results */
.algo-progetto__results {
  padding: 56px 0 0;
}
.algo-progetto__results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}
.algo-progetto__result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.algo-progetto__result-card:hover {
  border-color: color-mix(in srgb, var(--proj-primary) 30%, transparent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--proj-primary) 10%, transparent);
}
.algo-progetto__result-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--proj-primary);
  line-height: 1;
  margin-bottom: 8px;
}
.algo-progetto__result-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* WP content */
.algo-progetto__content-section { padding: 56px 0 0; }
.algo-progetto__wp-content { font-size: 16px; line-height: 1.75; color: var(--text); }
.algo-progetto__wp-content h2 { font-size: 24px; font-weight: 700; color: var(--heading); margin: 2em 0 0.6em; }
.algo-progetto__wp-content h3 { font-size: 19px; font-weight: 600; color: var(--heading); margin: 1.6em 0 0.5em; }
.algo-progetto__wp-content p  { margin: 0 0 1.4em; }
.algo-progetto__wp-content a  { color: var(--proj-primary); text-decoration: underline; }
.algo-progetto__wp-content ul,
.algo-progetto__wp-content ol { margin: 0 0 1.4em; padding-left: 1.6em; }
.algo-progetto__wp-content li { margin-bottom: 0.4em; }

/* Footer CTA bar */
.algo-progetto__footer-cta {
  padding: 56px 0 0;
}
.algo-progetto__footer-cta .algo-progetto__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}
.algo-progetto__back-bottom {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.algo-progetto__back-bottom:hover { color: var(--proj-primary); }

/* Responsive */
@media (max-width: 768px) {
  .algo-progetto__hero       { padding: 100px 20px 60px; }
  .algo-progetto__hero-body  { flex-direction: column; gap: 24px; }
  .algo-progetto__logo-wrap  { width: 72px; height: 72px; }
  .algo-progetto__inner      { padding: 0 20px; }
  .algo-progetto__cs-grid    { grid-template-columns: 1fr; }
  .algo-progetto__results-grid { grid-template-columns: 1fr 1fr; }
  .algo-progetto__footer-cta .algo-progetto__inner { flex-direction: column; align-items: flex-start; }
}

/* ── Thank You page ──────────────────────────────────────── */

.algo-thankyou {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.algo-thankyou__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 120px 40px 80px;
  max-width: 640px;
  margin: 0 auto;
}

.algo-thankyou__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
  pointer-events: none;
}

/* Checkmark icon */
.algo-thankyou__icon {
  width: 80px;
  height: 80px;
  color: var(--accent);
  margin-bottom: 32px;
}

.algo-thankyou__check {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.algo-thankyou__check-circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: algo-ty-circle 0.6s ease forwards 0.2s;
}

.algo-thankyou__check-tick {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: algo-ty-tick 0.4s ease forwards 0.8s;
}

@keyframes algo-ty-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes algo-ty-tick {
  to { stroke-dashoffset: 0; }
}

.algo-thankyou__title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.algo-thankyou__body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 40px;
}

.algo-thankyou__ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.algo-thankyou__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 9px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.algo-thankyou__cta--primary {
  background: var(--cta);
  color: #fff;
}

.algo-thankyou__cta--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(224,78,42,0.35);
}

.algo-thankyou__cta--secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.algo-thankyou__cta--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .algo-thankyou__inner { padding: 100px 24px 60px; }
  .algo-thankyou__ctas  { flex-direction: column; width: 100%; }
  .algo-thankyou__cta   { justify-content: center; }
}


/* ── CF7 acceptance error message ──────────────────────── */

.algo-acceptance-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #dc2626;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  .algo-nav              { padding: 0 32px; }
  .algo-nav__links       { gap: 24px; }
  .algo-hero__inner      { padding: 0 32px; }
  .algo-hero__body-grid  { gap: 40px; }

  .algo-chi-siamo,
  .algo-servizi,
  .algo-portfolio,
  .algo-perche,
  .algo-blog,
  .algo-contatti         { padding: 96px 40px; }

  .algo-ticker           { padding: 24px 40px; }
  .algo-footer           { padding: 64px 40px 32px; }
  .algo-servizi__cta-strip { padding: 40px 40px; }
}

@media (max-width: 900px) {
  .algo-chi-siamo__inner { grid-template-columns: 1fr; gap: 48px; }
  .algo-servizi__grid    { grid-template-columns: 1fr; gap: 48px; }
  .algo-servizi__panel   { position: static; }
  .algo-contatti__inner  { grid-template-columns: 1fr; gap: 48px; }

  .algo-portfolio__grid  { grid-template-columns: 1fr 1fr; }
  .algo-portfolio__card--wide { grid-column: span 2; }

  .algo-perche__grid     { grid-template-columns: 1fr 1fr; gap: 20px; }
  .algo-footer__top      { grid-template-columns: 1fr 1fr; gap: 36px; }

  .algo-servizi__cta-strip { flex-direction: column; text-align: center; gap: 24px; }
}

@media (max-width: 768px) {
  /* Nav mobile */
  .algo-nav               { padding: 0 20px; }
  .algo-nav__hamburger    { display: flex; }
  .algo-nav__links-wrap {
    display: none;
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: #fff;
    padding: 24px 20px;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    z-index: 199;
  }
  .algo-nav__links-wrap.is-open { display: flex; }
  .algo-nav__links        { flex-direction: column; gap: 0; width: 100%; }
  .algo-nav__link         { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
  .algo-nav__cta          { margin-top: 8px; text-align: center; }

  /* Sections */
  .algo-hero__inner       { padding: 0 20px; }
  .algo-hero__body-grid   { grid-template-columns: 1fr; gap: 32px; }
  .algo-hero__headline    { max-width: none; }

  .algo-hero__stats-grid  { grid-template-columns: 1fr 1fr; }
  .algo-hero__stat + .algo-hero__stat { border-left: none; padding-left: 0; }
  .algo-hero__stat:nth-child(even)   { border-left: 1px solid var(--border); padding-left: 24px; }
  .algo-hero__stat        { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
  .algo-hero__stat:nth-last-child(-n+2) { border-bottom: none; padding-top: 24px; }

  .algo-chi-siamo,
  .algo-servizi,
  .algo-portfolio,
  .algo-perche,
  .algo-blog,
  .algo-contatti          { padding: 80px 20px; }

  .algo-ticker            { padding: 20px; }
  .algo-ticker__inner     { gap: 24px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }

  .algo-portfolio__grid   { grid-template-columns: 1fr; }
  .algo-portfolio__card--wide { grid-column: span 1; }

  .algo-perche__grid      { grid-template-columns: 1fr; }
  .algo-blog__grid        { grid-template-columns: 1fr; }
  .algo-blog__header      { flex-direction: column; align-items: flex-start; gap: 16px; }

  .algo-footer            { padding: 48px 20px 28px; }
  .algo-footer__top       { grid-template-columns: 1fr; gap: 32px; }
  .algo-footer__bottom    { flex-direction: column; align-items: flex-start; }

  .algo-servizi__cta-strip   { padding: 32px 24px; border-radius: 16px; }
  .algo-contatti__form-wrap  { padding: 32px 24px; }
}
