/* VOLUM, direction "Cinema". Light-only by design: every render is baked on a light studio backdrop. */

@font-face {
  font-family: "Clash Display";
  src: url("../assets/fonts/ClashDisplay-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display";
  src: url("../assets/fonts/ClashDisplay-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #F7F7F5;
  --paper: #FFFFFF;
  --ink: #131313;
  --ink-2: #5C5C60;
  --line: rgba(19, 19, 19, 0.10);
  --night: #0E0E0F;
  --night-2: #17181A;
  --cobalt: #1F3BFF;
  --cobalt-room: #0037AC; /* median of room-cobalt.webp left/right edge columns so the render melts into the band */
  --lime: #D8F542;
  --lime-room: #DCE209; /* median edge tone of the six pattern renders */
  --lime-ink: #1B1F0A;

  --display: "Clash Display", "Helvetica Neue", Arial, sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: clamp(1.25rem, 5vw, 5rem);
  --section: clamp(5rem, 11vw, 9rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-tile: 16px;
  --nav-h: 64px;
  --max: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
canvas { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -100%; z-index: 100;
  background: var(--ink); color: var(--ground); padding: 0.6rem 1rem; border-radius: 999px;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

/* ---------- type ---------- */
.statement, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}
.statement, h2 { font-size: clamp(2.6rem, 6vw, 5rem); }
h1 { font-size: clamp(2.8rem, 5.8vw, 5.4rem); }
h3 { font-weight: 500; font-size: 1.4rem; letter-spacing: -0.01em; line-height: 1.15; }
p { max-width: 60ch; }
.label {
  font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--ink-2);
  display: flex; align-items: baseline; gap: 0.6rem;
}
.label-value { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 500; font-size: 15px; line-height: 1;
  text-decoration: none;
  transition: transform 0.35s var(--ease), background-color 0.25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn-ink { background: var(--ink); color: var(--ground); }
.btn-ink:hover { background: var(--cobalt); }
.btn-ground { background: var(--ground); color: var(--night); }
.btn-ground:hover { background: var(--paper); }
.link {
  font-weight: 500; font-size: 15px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s;
}
.link:hover { color: var(--cobalt); border-color: var(--cobalt); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: var(--pad);
  transition: background-color 0.3s, backdrop-filter 0.3s;
}
.nav.is-solid {
  background: rgba(247, 247, 245, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav-brand {
  font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: 0.08em;
  text-decoration: none; justify-self: start;
}
.nav-links { display: flex; gap: 2rem; justify-self: center; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink); opacity: 0.8; transition: opacity 0.25s; }
.nav-links a:hover { opacity: 1; }
.nav-cta { justify-self: end; padding-block: 0.65rem; }
@media (max-width: 1023px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; height: 320vh; padding: 0; background: var(--ground); }
.hero-sticky { position: sticky; top: 0; height: 100dvh; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.js .hero-canvas { display: block; }
/* No-JS fallback only: the open box, anchored bottom-right so it clears the copy. */
.hero-static { position: absolute; right: 0; bottom: 0; width: min(100%, 64vw); height: auto; }
.js .hero-static { display: none; }
@media (max-width: 767px) { .hero-static { width: 100%; } }
.hero-copy {
  position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--nav-h) + 4rem);
  z-index: 2; max-width: 36rem;
  will-change: opacity;
}
.hero-copy-b, .hero-copy-c { opacity: 0; pointer-events: none; }
.hero-copy h1 { margin-bottom: 1.2rem; }
.hero-sub { color: var(--ink-2); font-size: clamp(1rem, 1.3vw, 1.2rem); max-width: 34ch; margin-bottom: 1.8rem; }
.hero-actions { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
@media (max-width: 767px) {
  .hero-copy { top: calc(var(--nav-h) + 2rem); max-width: none; }
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- sections shared ---------- */
section { padding-block: var(--section); }
section .statement { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

/* ---------- detalles rail ---------- */
.detalles { padding-bottom: var(--section); }
.rail {
  display: flex; gap: 1.4rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  --rail-pad: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
  padding-inline: var(--rail-pad);
  scroll-padding-inline: var(--rail-pad);
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.tile { flex: 0 0 320px; scroll-snap-align: start; }
.tile img { border-radius: var(--radius-tile); background: var(--paper); aspect-ratio: 3 / 4; object-fit: cover; }
.tile figcaption { display: grid; gap: 0.2rem; margin-top: 1rem; }
.tile figcaption strong { font-weight: 500; font-size: 1.05rem; }
.tile figcaption span { color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 767px) { .tile { flex-basis: 78vw; } }

/* ---------- cajas bento ---------- */
.bento {
  display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto auto;
  gap: clamp(1.4rem, 3vw, 2.5rem);
}
.cell-tall { grid-row: 1 / span 2; }
.tile-img { border-radius: var(--radius-tile); overflow: hidden; background: var(--paper); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }
.cell h3 { margin-top: 1.1rem; margin-bottom: 0.35rem; }
.cell p { color: var(--ink-2); font-size: 1rem; }
.cell:not(.cell-tall) { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; column-gap: 1.4rem; }
.cell:not(.cell-tall) .tile-img { grid-row: 1 / span 2; height: 100%; }
.cell:not(.cell-tall) .tile-img img { aspect-ratio: auto; height: 100%; }
.cell:not(.cell-tall) h3 { grid-column: 2; margin-top: 0; align-self: end; }
.cell:not(.cell-tall) p { grid-column: 2; align-self: start; }
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .cell-tall { grid-row: auto; }
  .cell:not(.cell-tall) { display: block; }
  .cell:not(.cell-tall) .tile-img { height: auto; }
  .cell:not(.cell-tall) .tile-img img { aspect-ratio: 3 / 4; height: auto; }
  .cell:not(.cell-tall) h3 { margin-top: 1.1rem; }
}

/* ---------- rooms ---------- */
.room { padding-block: clamp(5rem, 12vw, 9rem) 0; }
.room .wrap { margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.room-cobalt { background: var(--cobalt-room); color: #FFFFFF; padding-bottom: 0; }
.room-cobalt .statement { margin-bottom: 1.4rem; }
.room-sub { color: rgba(255, 255, 255, 0.8); font-size: 1.1rem; }
.room-img-wrap { position: relative; }
.room-img-wrap::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 22%; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, var(--cobalt-room), rgba(0, 55, 172, 0));
}
.room-img {
  width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.room-lime { background: var(--lime-room); color: var(--lime-ink); padding-bottom: clamp(5rem, 12vw, 9rem); }
.room-lime .statement { margin-bottom: 0; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; width: 100%; }
.marquee-track {
  display: flex; gap: 1.4rem; width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track img {
  width: 280px; height: 280px; flex: 0 0 auto; border-radius: var(--radius-tile); object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(27, 31, 10, 0.14);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 0.7rem)); } }
@media (max-width: 767px) { .marquee-track img { width: 200px; height: 200px; } }

/* ---------- configurador ---------- */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.config-visual { position: sticky; top: calc(var(--nav-h) + 2rem); }
.config-stack {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius-tile); overflow: hidden; background: var(--paper);
  box-shadow: 0 30px 60px -40px rgba(19, 19, 19, 0.25);
}
.config-stack img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s; /* hide inactive layers once the crossfade ends */
}
.config-stack img.is-active { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
.config-controls { display: grid; gap: 2.2rem; padding-top: 0.5rem; }
.group { display: grid; gap: 0.9rem; }
.swatches { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.swatch {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--sw);
  border: 1px solid var(--line);
  outline: 2px solid transparent; outline-offset: 3px;
  transition: outline-color 0.2s, transform 0.2s;
}
.swatch:hover { transform: scale(1.06); }
.swatch[aria-pressed="true"] { outline-color: var(--cobalt); }
.swatch-pattern { background: linear-gradient(135deg, #1F3BFF 0 42%, #FFFFFF 42% 58%, #1F3BFF 58% 100%); }
.segmented { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.seg {
  display: grid; gap: 0.15rem; text-align: left;
  padding: 0.7rem 1rem; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 0.2s, background-color 0.2s;
  min-width: 4.2rem;
}
.seg strong { font-weight: 500; font-size: 15px; }
.seg span { font-size: 12px; color: var(--ink-2); }
.seg:hover { border-color: var(--ink); }
.seg[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--ground); }
.seg[aria-pressed="true"] span { color: rgba(247, 247, 245, 0.7); }
.price { display: grid; gap: 0.3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.price-unit { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 5vw, 4rem); letter-spacing: -0.03em; line-height: 1; margin-top: 0.4rem; }
.price-total { font-size: 1rem; color: var(--ink-2); }
.price-total strong { font-weight: 500; color: var(--ink); }
.price-note { font-size: 13px; color: var(--ink-2); }
.config-cta { justify-self: start; }
@media (max-width: 900px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-visual { position: static; }
}
@media (max-width: 480px) {
  .seg { flex: 1 1 auto; min-width: 0; padding: 0.65rem 0.75rem; }
  .seg span { font-size: 11px; }
}

/* ---------- cifras ---------- */
.cifras { padding-block: var(--section); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); }
.fact { padding: 1rem clamp(1rem, 3vw, 3rem); border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact dt { font-family: var(--display); font-weight: 600; font-size: clamp(3rem, 7vw, 5.5rem); letter-spacing: -0.03em; line-height: 1; }
.fact dd { color: var(--ink-2); margin-top: 0.6rem; font-size: 1rem; }
@media (max-width: 700px) {
  .facts { grid-template-columns: 1fr; }
  .fact { border-left: 0; padding-inline: 0; border-top: 1px solid var(--line); padding-block: 1.6rem; }
  .fact:first-child { border-top: 0; padding-top: 0; }
}

/* ---------- comparativa ---------- */
.compara { background: var(--paper); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
.compare th, .compare td { padding: 1.1rem 1rem 1.1rem 0; vertical-align: top; font-weight: 400; }
.compare thead th { padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.compare thead th img { width: 120px; height: auto; border-radius: var(--radius-tile); background: var(--ground); margin-bottom: 0.9rem; }
.compare thead th span { font-family: var(--display); font-weight: 500; font-size: 1.3rem; letter-spacing: -0.01em; }
.compare tbody th { color: var(--ink-2); font-weight: 500; font-size: 14px; width: 18%; }
.compare tbody td { width: 27%; }
.compare tbody tr { border-bottom: 1px solid var(--line); }
.compare tbody tr:last-child { border-bottom: 0; }

/* ---------- presupuesto (dark band) ---------- */
.quote { background: var(--night); color: var(--ground); }
.quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.quote-sub { color: rgba(247, 247, 245, 0.7); font-size: 1.1rem; }
.quote-form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: 0.5rem; }
.field label { font-weight: 500; font-size: 14px; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ground);
  background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  width: 100%;
}
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ground) 50%), linear-gradient(135deg, var(--ground) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-color: var(--cobalt); }
.field textarea { resize: vertical; min-height: 6rem; }
.help { font-size: 13px; color: rgba(247, 247, 245, 0.6); }
.error { font-size: 13px; color: #FF8A7A; }
.field.is-invalid input { border-color: #FF8A7A; }
.success { font-size: 15px; color: var(--lime); }
.quote-form .btn { justify-self: start; }
@media (max-width: 900px) { .quote-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--cobalt); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: 100dvh; }
  .hero-sticky { position: relative; }
  .hero-copy-b, .hero-copy-c { display: none; }
  .hero-copy-a { opacity: 1 !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .swatch, .seg { transition: none; }
  .btn:hover { transform: none; }
  .marquee { overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: var(--pad); }
  .marquee-track { animation: none; width: max-content; }
  .marquee-track img { scroll-snap-align: start; }
  .marquee-track img[aria-hidden="true"] { display: none; }
}
