/* ============================================
   CERTA ENERGIA CASE STUDY · prefix: ce-
   palette arancione brand su dark soul
   SIGNATURE: sticker mascotte fluttuanti
   ============================================ */

:root {
  --ce-bg: #0a0a0a;
  --ce-text: #f5f5f5;
  --ce-text-muted: #c4c4c4;
  --ce-text-soft: rgba(245, 245, 245, 0.65);
  --ce-orange: #FF6B1A;
  --ce-orange-dark: #D54E0F;
  --ce-orange-light: #FF8C42;
  --ce-yellow: #FFC83D;
  --ce-glow-warm: rgba(255, 107, 26, 0.55);
  --ce-glow-soft: rgba(255, 140, 66, 0.25);
  --ce-glow-hot: rgba(255, 107, 26, 0.5);
  --ce-bg-soft: rgba(255, 107, 26, 0.12);
  --ce-bg-orange: rgba(255, 107, 26, 0.08);
  --ce-border: rgba(255, 140, 66, 0.4);
  --ce-divider: rgba(255, 140, 66, 0.22);
}

.ce-main {
  background: var(--ce-bg);
  color: var(--ce-text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}
.ce-main * { box-sizing: border-box; }

/* SECTIONS */
.ce-section {
  position: relative;
  padding: 100px 0;
  overflow: hidden;
}
.ce-section + .ce-section {
  border-top: 1px solid var(--ce-divider);
}

/* GLOW */
.ce-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  height: 65%;
  background: radial-gradient(ellipse, var(--ce-glow-warm) 0%, var(--ce-glow-soft) 35%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
  z-index: 0;
}
.ce-glow--center { width: 85%; height: 80%; }
.ce-glow--hot {
  background: radial-gradient(ellipse, rgba(255, 107, 26, 0.6) 0%, var(--ce-glow-soft) 40%, transparent 70%);
}

/* ============================================
   STICKER VOLANTI (signature unica di Certa)
   ============================================ */
.ce-fly {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0.85;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 20px rgba(255, 107, 26, 0.2));
  will-change: transform;
}
.ce-fly--a { animation: ce-fly-a 12s ease-in-out infinite; }
.ce-fly--b { animation: ce-fly-b 14s ease-in-out infinite; }
.ce-fly--c { animation: ce-fly-c 10s ease-in-out infinite; }
.ce-fly--d { animation: ce-fly-d 16s ease-in-out infinite; }

@keyframes ce-fly-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(8deg); }
  50% { transform: translate(-10px, -50px) rotate(-6deg); }
  75% { transform: translate(-25px, -20px) rotate(5deg); }
}
@keyframes ce-fly-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-30px, -20px) rotate(-8deg); }
  66% { transform: translate(15px, -40px) rotate(10deg); }
}
@keyframes ce-fly-c {
  0%, 100% { transform: translate(0, 0) rotate(-3deg); }
  50% { transform: translate(25px, 25px) rotate(8deg); }
}
@keyframes ce-fly-d {
  0%, 100% { transform: translate(0, 0) rotate(5deg); }
  20% { transform: translate(-15px, 20px) rotate(-6deg); }
  40% { transform: translate(20px, 10px) rotate(8deg); }
  60% { transform: translate(-10px, -25px) rotate(-5deg); }
  80% { transform: translate(15px, -15px) rotate(7deg); }
}

/* CONTENT */
.ce-content { position: relative; z-index: 2; }

/* KICKER */
.ce-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ce-orange-light);
  margin-bottom: 20px;
}
.ce-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ce-orange);
  box-shadow: 0 0 14px var(--ce-orange);
}

/* TITLE */
.ce-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--ce-text);
  margin: 0 0 20px;
}
.ce-title__orange {
  background: linear-gradient(135deg, var(--ce-orange-dark), var(--ce-orange), var(--ce-orange-light), var(--ce-yellow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ce-title__emoji {
  display: inline-block;
  font-size: 0.85em;
  transform: rotate(-12deg);
  margin-left: 6px;
  -webkit-text-fill-color: initial;
  background: none;
  -webkit-background-clip: initial;
  color: initial;
}

/* COPY */
.ce-copy {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ce-text-muted);
  max-width: 640px;
  margin: 0;
}
.ce-copy--lead {
  font-size: 19px;
  margin-bottom: 32px;
}

/* SECTION HEAD */
.ce-section-head {
  text-align: center;
  margin-bottom: 50px;
}
.ce-section-head .ce-copy {
  margin: 20px auto 0;
}

/* ============================================
   HERO con foto a destra
   ============================================ */
.ce-hero {
  padding: 140px 0 100px;
}
/* HERO centrato: testo sopra, foto orizzontale grande sotto */
.ce-hero-text {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 60px;
}
.ce-hero-text .ce-title { margin: 0 0 20px; }
.ce-hero-text .ce-copy {
  margin: 0 auto 32px;
  max-width: 600px;
}
.ce-hero-text .ce-kpi-row {
  margin: 0 auto 24px;
}
.ce-hero-text .ce-pills {
  justify-content: center;
}

.ce-hero-photo {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--ce-border);
  box-shadow:
    0 0 0 1px rgba(255, 140, 66, 0.15),
    0 0 120px var(--ce-glow-warm),
    0 40px 80px rgba(0, 0, 0, 0.6);
  max-width: 1100px;
  margin: 0 auto;
}
.ce-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HERO KPI ROW */
.ce-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  max-width: 540px;
}
.ce-kpi {
  padding: 16px 10px;
  border: 1px solid var(--ce-border);
  border-radius: 12px;
  background: var(--ce-bg-orange);
  text-align: center;
}
.ce-kpi__num {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ce-orange-dark), var(--ce-yellow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.ce-kpi__label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ce-text-muted);
  margin-top: 6px;
}

/* PILLS */
.ce-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ce-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--ce-bg-soft);
  border: 1px solid var(--ce-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--ce-orange-light);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* MEDIA + HOVER GLOW */
.ce-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
  background: linear-gradient(160deg, #2a1408, #1a0c04);
}
.ce-media::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.4s ease;
  pointer-events: none;
  z-index: -1;
}
.ce-media:hover {
  transform: translateY(-6px) scale(1.03);
}
.ce-media:hover::after {
  box-shadow:
    0 0 60px 8px var(--ce-glow-warm),
    0 0 140px 24px var(--ce-glow-soft);
}
.ce-media img,
.ce-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* REEL GRID 3x2 (6 video) */
.ce-reel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 580px;
  margin: 0 auto;
}
.ce-reel-card { aspect-ratio: 9/16; }

/* GRAFICHE GRID 4x2 (8 grafiche, formato quadrato) */
.ce-grafiche-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.ce-grafica-card { aspect-ratio: 1/1; }

/* ============================================
   STICKER SHOWCASE (sezione mascotte)
   ============================================ */
.ce-sticker-showcase {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
}
.ce-sticker-card {
  position: relative;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 107, 26, 0.18), rgba(255, 140, 66, 0.06));
  border: 1px solid var(--ce-border);
  padding: 18px;
  transition: all 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}
.ce-sticker-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--ce-glow-warm) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.ce-sticker-card:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--ce-orange);
  box-shadow:
    0 0 60px var(--ce-glow-warm),
    0 0 0 1px var(--ce-orange);
}
.ce-sticker-card:hover::before { opacity: 0.5; }
.ce-sticker-card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s ease;
}
.ce-sticker-card:hover img {
  transform: rotate(-5deg) scale(1.08);
}

/* CTA */
.ce-cta {
  text-align: center;
  padding: 120px 0;
}
.ce-cta .ce-title { max-width: 720px; margin: 0 auto 32px; }
.ce-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--ce-orange-dark), var(--ce-orange));
  color: #ffffff !important;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
  box-shadow:
    0 0 60px var(--ce-glow-warm),
    0 0 0 1px rgba(255, 140, 66, 0.3);
  transition: all 0.3s ease;
}
.ce-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 0 80px var(--ce-glow-warm),
    0 0 0 1px var(--ce-orange-light);
}
.ce-btn__arrow { transition: transform 0.3s ease; }
.ce-btn:hover .ce-btn__arrow { transform: translateX(4px); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .ce-section { padding: 70px 0; }
  .ce-hero { padding: 100px 0 70px; }
  .ce-cta { padding: 90px 0; }

  .ce-hero-text { margin-bottom: 40px; }
  .ce-hero-photo {
    max-width: 100%;
  }

  .ce-kpi-row { gap: 6px; }
  .ce-kpi { padding: 12px 4px; }
  .ce-kpi__num { font-size: 22px; }
  .ce-kpi__label { font-size: 9px; }

  .ce-sticker-showcase {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }
  .ce-sticker-card { padding: 12px; }

  .ce-fly { width: 65px !important; opacity: 0.7; }
}

@media (max-width: 540px) {
  .ce-section { padding: 60px 0; }
  .ce-hero { padding: 80px 0 60px; }
  .ce-cta { padding: 70px 0; }

  .ce-title { font-size: 32px; }
  .ce-copy { font-size: 15px; }
  .ce-copy--lead { font-size: 16px; }

  .ce-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ce-kpi { padding: 14px 8px; }

  .ce-sticker-showcase {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-width: 360px;
  }
  .ce-sticker-card:nth-child(1) { grid-column: 1 / span 2; }
  .ce-sticker-card:nth-child(2) { grid-column: 3 / span 2; }
  .ce-sticker-card:nth-child(3) { grid-column: 5 / span 2; }
  .ce-sticker-card:nth-child(4) { grid-column: 2 / span 2; }
  .ce-sticker-card:nth-child(5) { grid-column: 4 / span 2; }

  .ce-pills { justify-content: flex-start; }
  .ce-section-head { margin-bottom: 32px; }
  .ce-btn { padding: 16px 28px; font-size: 14px; }

  .ce-hero-photo { max-width: 100%; }

  .ce-fly { width: 50px !important; opacity: 0.6; }
}


/* CE MOBILE CAROUSELS — reel + grafiche scroll orizzontale (<=768px) */
@media (max-width: 768px){
  .ce-reel-grid, .ce-grafiche-grid{
    display:flex; grid-template-columns:none;
    overflow-x:auto; gap:12px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    padding:4px 16px 14px; margin:0 -16px;
    cursor:grab;
  }
  .ce-reel-grid.is-drag, .ce-grafiche-grid.is-drag{ cursor:grabbing; scroll-snap-type:none; }
  .ce-reel-grid::-webkit-scrollbar, .ce-grafiche-grid::-webkit-scrollbar{ height:4px; }
  .ce-reel-grid::-webkit-scrollbar-thumb, .ce-grafiche-grid::-webkit-scrollbar-thumb{ background:rgba(255,140,66,.5); border-radius:4px; }
  .ce-reel-card{ flex:0 0 60vw; max-width:230px; scroll-snap-align:start; }
  .ce-grafica-card{ flex:0 0 66vw; max-width:280px; scroll-snap-align:start; }
}
/* ============================================================ */