/* ==========================================================================
   NEXTSITE DESIGN SYSTEM — DARK MODE PREMIUM & TECHNICAL PERFORMANCE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Syne:wght@700;800&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #0a0a0a;
  --bg-card: #121215;
  --bg-card-hover: #18181e;
  --bg-input: #151519;
  --border-color: #24242c;
  --border-focus: #e3242b;
  
  --primary-red: #e3242b;
  --primary-red-hover: #ff2a33;
  --primary-red-glow: rgba(227, 36, 43, 0.25);
  --primary-red-glow-strong: rgba(227, 36, 43, 0.5);

  --text-main: #f5f5f5;
  --text-muted: #9e9ea8;
  --text-dim: #60606e;

  --accent-green: #10b981;
  --accent-blue: #3b82f6;

  /* Typography */
  --font-heading: 'Syne', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Effects */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-red-glow);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(227, 36, 43, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-position: 0 0, -1px -1px, -1px -1px;
}

h1, h2, h3, h4, h5, h6, p, span, a {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Selection */
::selection {
  background: var(--primary-red);
  color: #ffffff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #2a2a35;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red);
}

/* Typography Helpers */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 30%, var(--primary-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-red {
  color: var(--primary-red);
}

/* Layout Elements */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 6rem 0;
  position: relative;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(18, 18, 21, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-red);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--primary-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 35px var(--primary-red-glow-strong);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #3f3f4e;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1.1rem 2.4rem;
  font-size: 1.05rem;
}

/* Header & Nav */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0.8rem 0;
  transition: var(--transition-normal);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.header.scrolled {
  padding: 0.6rem 0;
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

img.logo, .brand-logo-img {
  max-height: 72px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
  transition: var(--transition-fast);
}

.logo:hover img.logo, .logo:hover .brand-logo-img {
  transform: scale(1.04);
}

.brand-name-text {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-navy {
  color: #2C3A4B;
}

.brand-red {
  color: #E3242B;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-red);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.logo-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  background: rgba(227, 36, 43, 0.15);
  color: var(--primary-red);
  border: 1px solid rgba(227, 36, 43, 0.3);
  border-radius: 4px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: #1e293b;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-red);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-red);
  transition: var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #1e293b;
  font-size: 1.5rem;
  cursor: pointer;
}

/* HERO SECTION */
.hero {
  padding-top: 10rem;
  padding-bottom: 6rem;
  min-height: 90vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.08;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.hero-metrics-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.metric-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #ffffff;
}

.metric-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tech Dashboard Mockup */
.tech-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.tech-dashboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-red), transparent);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.2rem;
}

.dashboard-dots {
  display: flex;
  gap: 6px;
}

.dashboard-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a2a35;
}

.dashboard-dots span:nth-child(1) { background: #ff5f56; }
.dashboard-dots span:nth-child(2) { background: #ffbd2e; }
.dashboard-dots span:nth-child(3) { background: #27c93f; }

.dashboard-title-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-value {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  margin-top: 0.3rem;
}

.metric-chart-bar {
  height: 4px;
  background: #1f1f28;
  border-radius: 2px;
  margin-top: 0.6rem;
  overflow: hidden;
}

.metric-chart-fill {
  height: 100%;
  background: var(--primary-red);
  border-radius: 2px;
  width: 98%;
  box-shadow: 0 0 10px var(--primary-red);
}

.code-snippet-box {
  background: #09090b;
  border: 1px solid #1a1a22;
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.code-keyword { color: #f43f5e; }
.code-prop { color: #38bdf8; }
.code-string { color: #4ade80; }
.code-num { color: #fbbf24; }

/* SECTION HEADINGS */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 4rem auto;
}

.section-tag {
  font-family: var(--font-mono);
  color: var(--primary-red);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  display: block;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* STRENGTHS / PERCHE NEXTSITE */
.grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.2rem;
  transition: var(--transition-normal);
  position: relative;
}

.feature-card:hover {
  border-color: rgba(227, 36, 43, 0.4);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card);
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: rgba(227, 36, 43, 0.1);
  border: 1px solid rgba(227, 36, 43, 0.2);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--primary-red);
  font-size: 1.3rem;
  margin-bottom: 1.4rem;
}

.feature-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.feature-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* COMPARISON TABLE */
.comparison-box {
  margin-top: 4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.comp-col {
  padding: 2.5rem;
}

.comp-col.traditional {
  background: rgba(255, 255, 255, 0.01);
  border-right: 1px solid var(--border-color);
}

.comp-col.nextsite {
  background: rgba(227, 36, 43, 0.03);
  position: relative;
}

.comp-col.nextsite::before {
  content: 'RABBIA VS RISULTATI';
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--primary-red);
  border: 1px solid rgba(227, 36, 43, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.comp-header {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comp-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.comp-list li i {
  margin-top: 4px;
}

.icon-bad { color: #ef4444; }
.icon-good { color: var(--accent-green); }

/* PORTFOLIO & CASE STUDY SHOWCASE */
.portfolio-filter {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary-red);
  color: #fff;
  border-color: var(--primary-red);
  box-shadow: var(--shadow-glow);
}

/* Featured Case Study: Salento Motor Grill */
.featured-case-card {
  background: linear-gradient(145deg, #15151a 0%, #0d0d10 100%);
  border: 1px solid rgba(227, 36, 43, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.featured-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: var(--primary-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  z-index: 5;
  box-shadow: var(--shadow-glow);
}

.case-preview-visual {
  background: #09090b;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
  border-right: 1px solid var(--border-color);
}

.case-visual-window {
  background: #141418;
  border: 1px solid #2a2a35;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
}

.window-bar {
  background: #1e1e26;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a35;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.window-url {
  background: #121216;
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  color: var(--text-muted);
}

.visual-content-mock {
  padding: 2rem;
  background: radial-gradient(circle at top right, rgba(227, 36, 43, 0.15), transparent 70%), #0d0d10;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.case-content-body {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.case-client-tag {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.case-title {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.case-problem-solution {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.ps-box {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--primary-red);
  padding: 0.8rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.ps-box h5 {
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.ps-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.case-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.8rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.case-stat-num {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-red);
}

.case-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Other Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(227, 36, 43, 0.4);
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}

.project-img-box {
  height: 190px;
  background: #16161d;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(5px);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.project-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  flex: 1;
}

.project-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-bottom: 1rem;
}

/* INTERACTIVE PREVENTIVO / QUOTE CALCULATOR */
.calculator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.calculator-box::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--primary-red-glow-strong), transparent 70%);
  pointer-events: none;
}

.calc-step-group {
  margin-bottom: 2.2rem;
}

.calc-step-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: block;
}

.calc-speed-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .calc-options-grid, .calc-speed-grid {
    grid-template-columns: 1fr;
  }
}

.calc-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.calc-card-icon {
  font-size: 1.2rem;
  color: var(--primary-red);
}

.calc-option-card {
  background: #16161c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  position: relative;
  user-select: none;
}

.calc-option-card:hover, .calc-option-card.selected {
  border-color: var(--primary-red);
  background: rgba(227, 36, 43, 0.06);
}

.calc-option-card.selected {
  box-shadow: 0 0 15px rgba(227, 36, 43, 0.25);
}

.calc-option-card.selected::after {
  content: '✓';
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary-red);
}

.calc-option-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #fff;
}

.calc-option-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.calc-summary-panel {
  margin-top: 3rem;
  background: #09090b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.calc-summary-info {
  flex: 1;
  min-width: 280px;
}

.calc-total-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary-red);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.calc-summary-live {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.calc-details-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.calc-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .calc-summary-actions {
    align-items: stretch;
    width: 100%;
  }
}

.calc-main-cta {
  font-size: 1rem;
  padding: 0.9rem 1.8rem;
  box-shadow: 0 0 20px rgba(227, 36, 43, 0.4);
}

.calc-secondary-contact-links {
  display: flex;
  gap: 1rem;
}

.contact-sub-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition-fast);
}

.contact-sub-link:hover {
  color: var(--text-main);
}

/* CHI SIAMO / METHODOLOGY */
.process-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.process-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  position: relative;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(227, 36, 43, 0.4);
  margin-bottom: 0.8rem;
}

.step-title {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* BLOG / RESOURCES */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  border-color: rgba(227, 36, 43, 0.4);
  transform: translateY(-4px);
}

.blog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.blog-tag {
  color: var(--primary-red);
}

.blog-title {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.blog-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex: 1;
}

.blog-read-link {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.blog-read-link:hover {
  color: var(--primary-red);
}

/* TESTIMONIALS */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonial-quote {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #252530;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary-red);
}

.author-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

.author-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* CONTACT SECTION & FORM */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info-box {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: rgba(227, 36, 43, 0.1);
  border: 1px solid rgba(227, 36, 43, 0.2);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--primary-red);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.contact-val {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.contact-val:hover {
  color: var(--primary-red);
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 10px rgba(227, 36, 43, 0.2);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 3rem;
  position: relative;
  box-shadow: var(--shadow-card);
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
}

/* FLOATING WHATSAPP & COOKIE BANNER */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  z-index: 99;
  text-decoration: none;
  transition: var(--transition-normal);
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

.brand-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.logo-text-brand {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.logo-text-brand span {
  color: var(--primary-red);
}

.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  max-width: 480px;
  background: rgba(18, 18, 22, 0.96);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  z-index: 1000;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition-normal);
}

.cookie-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-text a {
  color: var(--primary-red);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-cookie {
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.btn-cookie-accept {
  background: var(--primary-red);
  color: #ffffff;
}

.btn-cookie-reject {
  background: #1f1f26;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-cookie-prefs {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-cookie-prefs:hover {
  color: var(--text-main);
  border-color: var(--primary-red);
}

/* Cookie Preferences Modal Overlay */
.cookie-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.cookie-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 550px;
  padding: 2.2rem;
  box-shadow: var(--shadow-card);
}

.cookie-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.cookie-pref-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #ffffff;
}

.cookie-pref-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #2a2a35;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-red);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* FOOTER */
.footer {
  background: #060608;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.footer-brand .brand-logo-img {
  max-height: 64px;
}

.footer-brand .brand-navy {
  color: #ffffff;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 320px;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-red);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 1rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .featured-case-card {
    grid-template-columns: 1fr;
  }
  .case-preview-visual {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .process-timeline {
    grid-template-columns: repeat(2, 1fr);
  }
  .calc-options-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  section {
    padding: 3rem 0;
  }

  .hero {
    padding-top: 6.2rem;
    padding-bottom: 3rem;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .hero-title br, .section-title br {
    display: none;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .btn {
    white-space: normal;
  }

  .hero-metrics-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.2rem 1rem;
    width: 100%;
  }

  .metric-item {
    width: 100%;
  }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.6rem;
    display: none;
    z-index: 999;
    overflow-y: auto;
  }

  .nav-menu .nav-link {
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
  }

  .nav-menu .nav-link:hover, .nav-menu .nav-link.active {
    color: var(--primary-red);
  }

  .nav-menu.active {
    display: flex;
  }

  .mobile-toggle {
    display: block;
    font-size: 1.8rem;
    color: #1e293b;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
  }

  .grid-2x2, .projects-grid, .blog-grid, .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .comp-col {
    padding: 1.8rem 1.25rem;
  }

  .comp-col.nextsite::before {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
  }

  .case-content-body {
    padding: 1.8rem 1.25rem;
  }

  .case-title {
    font-size: 1.35rem;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .case-preview-visual {
    padding: 1.5rem 1rem;
  }

  .case-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .calculator-box {
    padding: 1.8rem 1rem;
  }

  .calc-summary-panel {
    padding: 1.25rem 1rem;
  }

  .calc-summary-info {
    min-width: 0;
    width: 100%;
  }

  .calc-summary-live {
    font-size: 1.05rem;
  }

  .calc-summary-actions {
    width: 100%;
  }

  .calc-main-cta {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.9rem 1rem;
  }

  .contact-form {
    padding: 1.5rem 1rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .process-timeline {
    grid-template-columns: 1fr;
  }

  .cookie-banner {
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.8rem;
    max-width: none;
    padding: 1.2rem;
  }

  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-cookie {
    width: 100%;
    text-align: center;
  }

  .cookie-modal-box {
    padding: 1.4rem;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .hero-title {
    font-size: 1.65rem;
    line-height: 1.22;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .case-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  img.logo, .brand-logo-img {
    max-height: 48px;
  }

  .brand-name-text {
    font-size: 1.35rem;
  }

  .featured-case-card {
    padding: 0.5rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .tech-dashboard {
    padding: 1rem 0.75rem;
  }

  .code-snippet-box {
    font-size: 0.72rem;
    padding: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .feature-card {
    padding: 1.5rem 1.2rem;
  }

  .btn {
    padding: 0.85rem 1.2rem;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 0.95rem 1.4rem;
    font-size: 0.95rem;
  }
}
