/* =========================================================
   IMPACT STUDIO 360 - Full d'estils net i optimitzat
   ========================================================= */

/* =============== Design tokens =============== */
:root {
  --brand: #8C1E2C;
  --ink: #111111;
  --muted: #6B7280;
  --bg: #FFFFFF;
  --bg-alt: #F6F6F6;
  --border: #EAEAEA;
  --radius: 14px;
  --shadow: 0 6px 16px rgba(17, 17, 17, .06);
}

/* =============== Base =============== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* =============== Utilities =============== */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin: 0 auto 32px; text-align: center; }
.section-head h2 { font-size: 2rem; margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; }

/* =============== Header =============== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  backdrop-filter: saturate(1.2) blur(6px);
}
.logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
  background: transparent;
}
.main-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.main-nav a {
  padding: 8px 10px;
  border-radius: 10px;
}
.main-nav a:hover {
  background: var(--bg-alt);
}

/* Botons */
.btn {
  display: inline-block;
  border: 1px solid var(--brand);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  transition: .2s;
  box-shadow: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(.95); box-shadow: var(--shadow); }
.btn-outline { color: var(--brand); background: #fff; }
.btn-outline:hover { background: var(--brand); color: #fff; }

/* =============== Mobile Nav =============== */
.nav-toggle {
  display: none;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
}
@media (max-width: 920px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: #fff;
    border-top: 1px solid var(--border);
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    transform: translateY(-120%);
    transition: .25s;
  }
  .main-nav.open { transform: translateY(0); }
}

/* =============== HERO =============== */
.hero {
  background: linear-gradient(135deg, #ffffff 60%, #f9f4f4);
  position: relative;
  overflow: hidden;
  border: none !important;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 24px;
}

/* Títol amb logo al costat */
.hero-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-heading h1 {
  flex: 1;
  font-size: 3rem;
  line-height: 1.2;
  margin: 0;
}

/* =============== Cards & grids =============== */
.grid { display: grid; gap: 22px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(17, 17, 17, .08);
}
.card .icon {
  width: 36px;
  height: 36px;
  color: var(--brand);
  margin-bottom: 10px;
}

/* =============== Stats =============== */
.stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: stretch; }
.stat {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
}
.stat-label { color: var(--muted); }

/* =============== Projects =============== */
/* =============== Projects (cards) =============== */
.projects {
  padding: 4rem 0;
  background: var(--bg, #f7f7f7);
}

.projects .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch; /* todas igual de altas */
}

/* Tarjeta base */
.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Contenedor de imagen con proporción fija */
.project-media {
  margin: 0;
  aspect-ratio: 16 / 9;      /* mantiene proporción sin crecer en exceso */
  overflow: hidden;
  background: #f0f0f0;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* recorta sin deformar */
  display: block;
}

/* Contenido textual y botón */
.project-content {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.project-content.center {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.project-title {
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--ink, #222);
  margin: 0 0 .25rem 0;
  font-weight: 700;
}

.project-text {
  color: rgba(0,0,0,.65);
  line-height: 1.55;
  margin: 0 0 1rem 0;
  flex: 1;                   /* empuja el botón al borde inferior */
}

.project-card .btn {
  align-self: flex-start;    /* sigue estilo de botones del sitio */
}

/* Tarjeta “Projecte en curs” (sin imagen) */
.project-card.is-ghost {
  grid-template-rows: 1fr;   /* solo contenido */
  border-style: dashed;
  background: #fafafa;
}

/* Responsive */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}



/* =============== Quote =============== */
.quote {
  max-width: 760px;
  margin: 28px auto 0;
  padding: 16px 18px;
  border-left: 4px solid var(--brand);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: #333;
}
.quote cite {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

/* =============== Footer =============== */
.footer {
  background: #1A1A1A;
  color: #fff;
  padding: 28px 0;
  margin-top: 12px;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-nav a { color: #ddd; }
.footer-nav a:hover { color: #fff; }
.footer-brand img { filter: invert(1); opacity: .9; }
@media (max-width: 780px) {
  .footer-grid { flex-direction: column; align-items: flex-start; }
}

/* --- Hover efectes a icones --- */
.service .icon { transition: all 0.25s ease; }
.service:hover .icon { transform: scale(1.2); color: var(--brand); }
.service:hover h3 { color: var(--brand); }

/* --- HERO layout i proporcions --- */
.hero {
  background: linear-gradient(135deg, #ffffff 60%, #f9f4f4);
  border: none !important;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero .lead {
  color: var(--muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- LOGO DRETA --- */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-right {
  width: 100%;
  max-width: 500px;
  height: auto;
  object-fit: contain;
  background: transparent;
  animation: fadeIn 1.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-visual {
    margin-top: 2rem;
  }
  .hero-logo-right {
    max-width: 400px;
  }
} /* ✅ CIERRE CORRECTO DEL MEDIA QUERY */

/* Navegación móvil: botón hamburguesa horizontal */
.nav-toggle {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;    /* barras apiladas verticalmente */
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
}

/* =============== Contact Section (versión encapsulada y sin duplicados) =============== */
.contact-section {
  padding: 5rem 0;
  background-color: #f8f8f8;
}
.contact-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: flex-start;
}

/* Tarjeta izquierda (formulario) */
.contact-form {
  background: #fff;
  padding: 2.5rem 3rem;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.contact-form .section-title { margin-bottom: .5rem; }
.contact-form .section-subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ✅ Encapsula el formulario dentro de la tarjeta (evita conflictos globales) */
.contact-form form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
}
.contact-form .form-group {
  display: flex;
  flex-direction: column;
}
.contact-form .form-group.full {
  grid-column: 1 / -1;
}
.contact-form label {
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #222;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #7b0d1e;
  box-shadow: 0 0 0 3px rgba(123, 13, 30, 0.15);
}
.contact-form textarea {
  min-height: 130px;
  resize: vertical;
}
.contact-form .btn,
.contact-form input[type="submit"],
.contact-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: center;
  background-color: #7b0d1e;
  color: #fff;
  border: none;
  padding: 0.9rem 2.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}
.contact-form .btn:hover,
.contact-form input[type="submit"]:hover,
.contact-form button[type="submit"]:hover {
  background-color: #a51228;
  transform: translateY(-2px);
}

/* Tarjeta derecha (información de contacto) */
.contact-info {
  background: #fff;
  padding: 2.5rem 3rem;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.contact-info h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: #222;
}
.contact-info ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}
.contact-info li {
  margin-bottom: 1rem;
  color: #444;
  line-height: 1.6;
  font-size: 1rem;
}
.contact-info strong { color: #7b0d1e; }
.contact-info .note {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 920px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-form form {
    grid-template-columns: 1fr;
  }
  .contact-form .btn,
  .contact-form input[type="submit"],
  .contact-form button[type="submit"] {
    grid-column: 1;
  }
}

/* Responsive */
@media (max-width: 920px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  form {
    grid-template-columns: 1fr;
  }

  form .btn {
    grid-column: 1;
  }
}
