:root {
  /* Colors */
  --color-mercury-blue: #5266eb;
  --color-ghost-blue: #cdddff;
  --color-deep-space: #171721;
  --color-midnight-slate: #1e1e2a;
  --color-graphite: #272735;
  --color-lead: #70707d;
  --color-starlight: #ededf3;
  --color-silver: #c3c3cc;
  --color-pure-white: #ffffff;

  /* Typography */
  --font-arcadiadisplay: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arcadia: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing */
  --spacing-4: 4px;
  --spacing-8: 8px;
  --spacing-16: 16px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-40: 40px;
  --spacing-80: 80px;
  --spacing-120: 120px;

  /* Border Radius */
  --radius-buttons: 32px;
  --radius-containers: 4px;
}

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

body {
  background-color: var(--color-deep-space);
  color: var(--color-starlight);
  font-family: var(--font-arcadia);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scroll Animation Container */
#video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  opacity: 0.6; /* Dim the background — applies to both video and canvas */
}

#scroll-video,
#video-container canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-32);
}

/* --- Scroll Arrow --- */
.scroll-arrow-container {
  position: absolute;
  bottom: var(--spacing-40);
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 10;
  animation: bounce 2.5s infinite ease-in-out;
  /* Fade out subtly so it doesn't distract forever, or keep it */
  opacity: 0.8;
  transition: opacity 0.3s;
}

.scroll-arrow-container:hover {
  opacity: 1;
}

.glass-arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05); /* Very subtle white tint */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2); /* Glass edge */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: var(--color-pure-white);
  transition: all 0.3s ease;
}

.glass-arrow:hover {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.glass-arrow svg {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

@keyframes bounce {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 12px);
  }
}

.hero-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Use negative margin on the logo instead of gap to compensate for image padding */
  margin-bottom: var(--spacing-24);
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  /* Scale up to remove the effect of transparent padding inside the image file */
  transform: scale(2.2);
  /* Pull the logo much closer to the text */
  margin-right: -100px;
  /* Push down slightly to align the star's center with the text */
  margin-top: 14px;
}

h1 {
  font-family: var(--font-arcadiadisplay);
  font-weight: 360;
  font-size: 65px;
  line-height: 1.1;
  letter-spacing: 0.65px;
}

.subheading {
  font-size: 21px;
  font-weight: 400;
  color: var(--color-silver);
  max-width: 800px;
  margin-bottom: var(--spacing-40);
}

.btn-primary {
  display: inline-block;
  background-color: var(--color-mercury-blue);
  color: var(--color-pure-white);
  padding: var(--spacing-16) var(--spacing-24);
  border-radius: var(--radius-buttons);
  text-decoration: none;
  font-weight: 480;
  font-size: 16px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.content-section {
  padding: var(--spacing-120) var(--spacing-32);
  margin-top: 15vh; /* Start showing earlier so it's visible on scroll sooner */
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h2 {
  font-family: var(--font-arcadiadisplay);
  font-weight: 360;
  font-size: 49px;
  margin-bottom: var(--spacing-80);
  text-align: center;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-32);
}

.feature-item {
  background-color: rgba(30, 30, 42, 0.65); /* Transparent Midnight Slate */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--spacing-40);
  border: 1px solid rgba(112, 112, 125, 0.3); /* Transparent Lead */
  border-radius: 0px; /* Zero radius for cards per DESIGN.md */
  transition: background-color 0.3s ease;
}

.feature-item:hover {
  background-color: rgba(39, 39, 53, 0.8); /* Slightly brighter Interactive Surface on hover */
}

.feature-item h3 {
  font-family: var(--font-arcadiadisplay);
  font-size: 28px;
  font-weight: 480;
  color: var(--color-starlight);
  margin-bottom: var(--spacing-16);
}

.feature-item p {
  color: var(--color-silver);
  font-size: 16px;
}

/* --- Video Background Card --- */
.feature-video-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  padding: 0; /* Remove padding — content div handles it */
}

.card-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
  opacity: 0.45;
}

.feature-video-card:hover .card-bg-video {
  transform: scale(1.08);
  opacity: 0.6;
}

.card-content {
  position: relative;
  z-index: 1;
  padding: var(--spacing-40);
}

.card-play-hint {
  display: inline-block;
  margin-top: var(--spacing-16);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ghost-blue);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  letter-spacing: 0.5px;
}

.feature-video-card:hover .card-play-hint {
  opacity: 1;
  transform: translateY(0);
}

/* --- Image Background Card (no click) --- */
.feature-image-card {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.card-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.4;
  transition: opacity 0.6s ease;
  transform-origin: top center; /* Focus movement from the top */
  /* Continuous Ken Burns: slow zoom + pan */
  animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.15) translateY(2%);
  }
  100% {
    transform: scale(1.25) translateY(0);
  }
}

.feature-image-card:hover .card-bg-image {
  opacity: 0.55;
}

/* --- Video Lightbox Modal --- */
.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .video-modal-content {
  transform: translateY(0) scale(1);
}

.video-modal-content .close-btn {
  z-index: 10;
  top: var(--spacing-8);
  right: var(--spacing-16);
  color: var(--color-pure-white);
  font-size: 32px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.video-modal-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

footer {
  background-color: var(--color-deep-space);
  padding: var(--spacing-80) var(--spacing-32);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-link {
  color: var(--color-silver);
  text-decoration: none;
  font-size: 14px;
}

/* --- Contact Section --- */
.contact-section {
  text-align: center;
  padding-top: var(--spacing-40); /* Less padding top since it follows content-section */
}

.contact-card {
  background-color: rgba(30, 30, 42, 0.65); /* Transparent Midnight Slate */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(112, 112, 125, 0.3);
  padding: var(--spacing-40);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-40);
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.contact-info {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-24);
  font-size: 18px;
  color: var(--color-silver);
}

.contact-item strong {
  color: var(--color-starlight);
  font-weight: 480;
}

.contact-actions {
  display: flex;
  gap: var(--spacing-16);
  flex-wrap: wrap;
  margin-top: var(--spacing-8);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-graphite);
  color: var(--color-starlight);
  padding: var(--spacing-16) var(--spacing-32);
  border-radius: 40px; /* Header Pill Button style */
  text-decoration: none;
  font-weight: 480;
  font-size: 18px;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--color-lead);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.contact-btn:hover {
  background-color: var(--color-ghost-blue);
  color: var(--color-deep-space);
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.map-container {
  flex: 1;
  min-width: 300px;
  height: 250px;
  overflow: hidden;
  filter: grayscale(0.8) opacity(0.65) contrast(1.2); /* Blend into dark theme */
  transition: filter 0.3s ease;
}

.map-container:hover {
  filter: grayscale(0.4) opacity(0.9) contrast(1.1);
}

.legal-links {
  display: flex;
  gap: var(--spacing-24);
  justify-content: center;
  margin: var(--spacing-24) 0;
  flex-wrap: wrap;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(23, 23, 33, 0.85); /* Deep Space with opacity */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background-color: var(--color-midnight-slate);
  padding: var(--spacing-40);
  border-radius: 12px; /* Radius XL */
  border: 1px solid var(--color-lead);
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.close-btn {
  position: absolute;
  top: var(--spacing-16);
  right: var(--spacing-24);
  background: none;
  border: none;
  color: var(--color-silver);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--color-starlight);
}

.modal-content h3 {
  font-family: var(--font-arcadiadisplay);
  font-weight: 360;
  font-size: 32px;
  color: var(--color-starlight);
  margin-bottom: var(--spacing-8);
}

.modal-content p {
  color: var(--color-silver);
  margin-bottom: var(--spacing-24);
}

.presupuesto-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-16);
}

.form-input {
  background-color: var(--color-graphite);
  border: 1px solid var(--color-lead);
  color: var(--color-starlight);
  padding: var(--spacing-16) var(--spacing-24);
  border-radius: 32px; /* Inputs radius per DESIGN.md */
  font-family: var(--font-arcadia);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input.textarea-input {
  border-radius: 16px; /* Textareas look better with slightly smaller radius than pills */
  resize: vertical;
}

.form-input:focus {
  border-color: var(--color-mercury-blue);
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(30, 30, 42, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-lead);
  padding: var(--spacing-16) var(--spacing-32);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 900;
  gap: var(--spacing-24);
  transform: translateY(100%);
  transition: transform 0.5s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner p {
  font-size: 14px;
  color: var(--color-silver);
  margin: 0;
  flex: 1;
}

/* --- Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out, background-color 0.3s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 768px)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Hero */
  .hero {
    padding: var(--spacing-24);
    height: 100svh; /* Use svh for mobile browsers that hide/show address bar */
  }

  .hero-title-wrapper {
    /* Keep row layout so the star stays on the LEFT */
    flex-direction: row;
    margin-bottom: var(--spacing-16);
  }

  .hero-logo {
    width: 70px;
    height: 70px;
    transform: scale(1.8);
    margin-right: -50px; /* Pull closer to text */
    margin-top: 8px;
  }

  h1 {
    font-size: 42px;
    letter-spacing: 0.4px;
  }

  .subheading {
    font-size: 17px;
    margin-bottom: var(--spacing-24);
    padding: 0 var(--spacing-8);
  }

  /* Sections */
  .content-section {
    padding: var(--spacing-80) var(--spacing-16);
    margin-top: 10vh;
  }

  h2 {
    font-size: 34px;
    margin-bottom: var(--spacing-40);
  }

  /* Feature Cards — single column on tablet */
  .features {
    grid-template-columns: 1fr;
    gap: var(--spacing-24);
  }

  .feature-item {
    padding: var(--spacing-24);
  }

  .feature-item h3 {
    font-size: 22px;
  }

  .feature-item p {
    font-size: 15px;
  }

  .card-content {
    padding: var(--spacing-24);
  }

  .card-play-hint {
    opacity: 1;
    transform: translateY(0);
  }

  /* Contact */
  .contact-card {
    flex-direction: column;
    padding: var(--spacing-24);
    gap: var(--spacing-24);
  }

  .contact-info {
    min-width: unset;
    width: 100%;
    font-size: 16px;
    text-align: center;
  }

  .contact-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-8);
  }

  .contact-btn {
    width: 100%;
    font-size: 16px;
    padding: var(--spacing-16) var(--spacing-24);
    justify-content: center;
  }

  .map-container {
    min-width: unset;
    width: 100%;
    height: 200px;
  }

  /* Footer */
  footer {
    padding: var(--spacing-40) var(--spacing-16);
  }

  .legal-links {
    flex-direction: column;
    gap: var(--spacing-8);
    align-items: center;
  }

  /* Modal */
  .modal-content {
    padding: var(--spacing-24);
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-content h3 {
    font-size: 26px;
  }

  /* Cookie banner — stack vertically */
  .cookie-banner {
    flex-direction: column;
    padding: var(--spacing-16);
    gap: var(--spacing-16);
    text-align: center;
  }

  .cookie-banner p {
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL PHONE (≤ 480px)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  .hero {
    padding: var(--spacing-16);
  }

  .hero-logo {
    width: 56px;
    height: 56px;
    transform: scale(1.6);
    margin-right: -36px;
    margin-top: 6px;
  }

  h1 {
    font-size: 32px;
  }

  .subheading {
    font-size: 15px;
    line-height: 1.5;
  }

  .btn-primary {
    font-size: 15px;
    padding: 14px 20px;
  }

  .content-section {
    padding: var(--spacing-40) var(--spacing-8);
  }

  h2 {
    font-size: 28px;
    margin-bottom: var(--spacing-24);
  }

  .feature-item {
    padding: var(--spacing-16);
  }

  .feature-item h3 {
    font-size: 20px;
  }

  .feature-item p {
    font-size: 14px;
  }

  .contact-card {
    padding: var(--spacing-16);
  }

  .contact-btn {
    font-size: 14px;
    padding: 12px var(--spacing-16);
  }

  .map-container {
    height: 180px;
  }

  .modal-content {
    padding: var(--spacing-16);
    border-radius: 8px;
  }

  .modal-content h3 {
    font-size: 22px;
  }

  .form-input {
    padding: 12px var(--spacing-16);
    font-size: 15px;
  }
}
