/* ============================================================
   KOLAY LANDING v2 — design.md tokens
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --red:        #E8431A;
  --red-hover:  #CF3A14;
  --cream:      #FFF8F2;
  --cream-alt:  #FFF0E6;
  --ink:        #1A1A1A;
  --smoke:      #6B6B6B;
  --pewter:     #9B9B9B;
  --silver:     #D8D0C8;
  --white:      #FFFFFF;
  --shadow-card: rgba(26,26,26,0.08) 0px 0px 32px 0px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --max-w: 1200px;
  --r-full: 100px;
  --r-card: 20px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s, transform .12s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--red);
  color: var(--white);
  padding: 12px 28px;
}
.btn-primary:hover { background: var(--red-hover); }

.btn-ghost {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
  padding: 11px 26px;
}
.btn-ghost:hover { background: var(--red); color: var(--white); }

.btn-white {
  background: var(--white);
  color: var(--red);
  padding: 14px 36px;
  font-size: 17px;
}
.btn-white:hover { background: var(--cream); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--silver);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  flex-shrink: 0;
}
.nav-logo img { width: 28px; height: 28px; }
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: color .15s;
}
.nav-links a:hover { color: var(--red); }
.nav-cta { flex-shrink: 0; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink);
}
.nav-toggle i { font-size: 24px; }
.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--silver);
  background: var(--cream);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 10px 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--silver);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile .btn-primary { margin-top: 8px; justify-content: center; }

/* ============================================================
   HERO — split: testo sx, cluster dispositivi dx
   ============================================================ */
.hero {
  background: var(--cream);
  padding: 72px 48px 0;
  overflow: hidden;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 6fr;
  align-items: center;
  gap: 64px;
  min-height: 520px;
}

/* Testo sx */
.hero-text { text-align: left; }
.hero-headline {
  font-size: clamp(44px, 5vw, 70px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin: 12px 0 24px;
}
.hero-headline span { color: var(--red); }
.hero-subtitle {
  font-size: 18px;
  color: var(--smoke);
  line-height: 1.6;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero-micro {
  font-size: 14px;
  color: var(--pewter);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.hero-micro i { color: var(--red); font-size: 15px; }

/* ---- Cluster dispositivi (colonna dx) ---- */
.hero-devices {
  position: relative;
  height: 480px;
  overflow: visible;
}
.device { position: absolute; }

/* Laptop — sfondo dietro tutti i telefoni */
.device-laptop {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 490px;
  z-index: 2;
  opacity: 0.88;
}
.laptop-frame {
  background: #1D1D1F;
  border-radius: 10px 10px 0 0;
  padding: 8px 8px 0;
  box-shadow: 0 24px 64px rgba(26,26,26,0.28);
}
.laptop-screen {
  border-radius: 5px;
  overflow: hidden;
  background: #000;
  line-height: 0;
}
.laptop-screen img { width: 100%; display: block; }
.laptop-base {
  height: 16px;
  background: #2C2C2E;
  border-top: 2px solid #3C3C3E;
  border-radius: 0 0 5px 5px;
  margin: 0 -8px;
}

/* Telefono centrale — primo piano */
.device-center-phone {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 175px;
  z-index: 10;
}

/*
  Inner phones: 158px, 70% visibile (110px), 30% nascosto (48px) dietro centrale
  centro half = 87.5px
  inner-L left = 50% - 87.5 - 110 = 50% - 197.5 ≈ 50% - 198px
  inner-R left = 50% + 87.5 - 48 = 50% + 39.5 ≈ 50% + 40px
*/
.device-inner-l,
.device-inner-r {
  bottom: 0;
  width: 158px;
  z-index: 8;
}
.device-inner-l { left: calc(50% - 198px); }
.device-inner-r { left: calc(50% + 40px); }

/*
  Outer phones: 140px, 70% visibile (98px), 30% nascosto (42px) dietro inner
  outer-L: inner-L-left + 42 = 50% - 156 → left = 50% - 156 - 140 = 50% - 296px
  outer-R: inner-R-right - 42 = 50%+40+158-42 = 50% + 156px
*/
.device-outer-l,
.device-outer-r {
  bottom: 0;
  width: 140px;
  z-index: 6;
}
.device-outer-l { left: calc(50% - 296px); }
.device-outer-r { left: calc(50% + 156px); }

/* Phone frames */
.phone-frame {
  background: #111;
  border-radius: 50px;
  padding: 12px;
  box-shadow:
    0 40px 80px rgba(26,26,26,0.22),
    inset 0 0 0 1px rgba(255,255,255,0.06);
}
.phone-screen {
  border-radius: 40px;
  overflow: hidden;
  background: var(--cream);
  position: relative;
  line-height: 0;
}
.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #111;
  border-radius: 20px;
  z-index: 2;
}
.phone-screen img {
  width: 100%;
  display: block;
  border-radius: 40px;
}

/* Variante piccola — tutti i telefoni dell'hero e le feature rows */
.phone-sm {
  border-radius: 40px;
  padding: 9px;
}
.phone-sm .phone-screen { border-radius: 33px; }
.phone-sm .phone-screen img { border-radius: 33px; }
.phone-sm .phone-island {
  width: 86px;
  height: 24px;
  top: 8px;
}

/* ============================================================
   SECTION UTILITIES
   ============================================================ */
.section-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.section-heading {
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 20px;
}
.section-body {
  font-size: 18px;
  color: var(--smoke);
  line-height: 1.65;
  max-width: 600px;
}

/* ============================================================
   FEATURE ROWS (alternating)
   ============================================================ */
.feature-row {
  background: var(--cream);
  padding: 96px 32px;
}
.feature-row-alt {
  background: var(--cream-alt);
}
.feature-row-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 80px;
}
.feature-row-content { flex: 1; }
.feature-row-title {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.18;
  color: var(--ink);
  margin: 12px 0 18px;
}
.feature-row-body {
  font-size: 17px;
  color: var(--smoke);
  line-height: 1.7;
  max-width: 460px;
  margin-bottom: 28px;
}
.feature-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--cream-alt);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--silver);
}
.feature-row-alt .tag { background: var(--cream); }
.tag i { color: var(--red); font-size: 14px; }
.feature-row-phone {
  flex-shrink: 0;
  width: min(36%, 260px);
}

/* ============================================================
   LANGUAGES
   ============================================================ */
.languages {
  background: var(--cream-alt);
  padding: 96px 32px;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 760px;
  margin: 48px auto 0;
}
.lang-card {
  background: var(--white);
  border-radius: var(--r-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 20px;
}
.lang-flag { flex-shrink: 0; }
.lang-flag .fi {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.lang-info h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.lang-info p {
  font-size: 14px;
  color: var(--smoke);
  margin-bottom: 12px;
  line-height: 1.5;
}
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
}
.lang-badge.available { background: #E8FFEE; color: #1A8C3A; }

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band {
  background: var(--red);
  padding: 100px 32px;
  text-align: center;
}
.cta-band h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
  margin-bottom: 16px;
}
.cta-band p {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  max-width: 500px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  color: var(--pewter);
  padding: 48px 32px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}
.footer-links { display: flex; gap: 28px; }
.footer-links a {
  font-size: 14px;
  color: var(--pewter);
  transition: color .15s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy {
  font-size: 13px;
  width: 100%;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   RESPONSIVE — TABLET (< 1024px): stack hero a colonna singola
   ============================================================ */
@media (max-width: 1023px) {
  .hero { padding: 64px 32px 0; }
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 48px;
  }
  .hero-text { text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-micro { justify-content: center; }

  .hero-devices {
    height: 400px;
    max-width: 580px;
    margin: 0 auto;
  }

  /* Tablet: solo 3 telefoni (nascondi outer) */
  .device-outer-l,
  .device-outer-r { display: none; }

  /* Ricalcola inner per container 580px (50% = 290px) */
  /* center: 175px half=87.5; inner 150px, 70%=105px nascosto=45px */
  .device-inner-l { left: calc(50% - 193px); width: 150px; }
  .device-inner-r { left: calc(50% + 43px); width: 150px; }

  .device-laptop { width: 420px; }

  .feature-row-inner { gap: 52px; }
  .feature-row-phone { width: min(40%, 240px); }
}

/* ============================================================
   RESPONSIVE — MOBILE (< 680px)
   ============================================================ */
@media (max-width: 679px) {
  /* Nav */
  .nav-inner { padding: 0 20px; grid-template-columns: auto 1fr auto; }
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; justify-self: end; }

  /* Hero */
  .hero { padding: 56px 20px 0; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
  }
  .hero-text { text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-micro { justify-content: center; font-size: 13px; }

  /* Mobile: solo telefono centrale */
  .hero-devices { height: 380px; max-width: 100%; }
  .device-outer-l,
  .device-outer-r,
  .device-inner-l,
  .device-inner-r,
  .device-laptop { display: none; }
  .device-center-phone {
    width: 180px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Feature rows */
  .feature-row { padding: 64px 20px; }
  .feature-row-inner {
    flex-direction: column;
    gap: 40px;
  }
  .feature-row-alt .feature-row-inner {
    flex-direction: column;
  }
  .feature-row-alt .feature-row-phone { order: 2; }
  .feature-row-alt .feature-row-content { order: 1; }
  .feature-row-phone { width: min(75%, 240px); margin: 0 auto; }
  .feature-row-body { max-width: 100%; }

  /* Languages */
  .languages { padding: 64px 20px; }
  .lang-grid { grid-template-columns: 1fr; max-width: 100%; margin-top: 32px; }
  .lang-card { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* CTA */
  .cta-band { padding: 72px 20px; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { flex-wrap: wrap; gap: 16px; }

  /* Section utils */
  .section-wrap { padding: 0 20px; }
}
