/* ==========================================================================
   Megatelas RD — one-page presentation demo
   Palette: oxblood family only, from the logo background (#4b0102), over ivory.
   base.css owns the reset, nav, buttons, reveals and marquee.
   This file owns the tokens and the layout of each section.
   ========================================================================== */

:root {
  --surface: #f6f1e8;        /* ivory, from the jacquard field */
  --surface-deep: #ece3d6;   /* sand */
  --brand: #5c0a11;          /* oxblood, lifted from the logo background */
  --brand-deep: #3e0309;
  --brand-wash: #f0e3e0;
  --ink: #241618;            /* warm near-black, red undertone */
  --ink-soft: #6e5b58;
  --line: rgba(36, 22, 24, 0.12);

  --font-display: "Bodoni Moda", "Didot", Georgia, serif;
  --font-body: "Jost", system-ui, sans-serif;
}

/* The wordmark is the client's PNG used as a mask, so it follows currentColor:
   ivory over the hero, ink on the scrolled nav, ivory in the footer. */

.brandmark {
  display: block;
  height: 30px;
  aspect-ratio: 792 / 170;
  background-color: currentColor;
  -webkit-mask: url("assets/img/logo.png") center / contain no-repeat;
  mask: url("assets/img/logo.png") center / contain no-repeat;
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--brand-deep);
}
.hero__media { position: absolute; inset: 0; }
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 112%;
  top: -6%;
  object-fit: cover;
  will-change: transform;
}
/* 90deg scrim sits UNDER the 180deg scrim: first background paints on top. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(46, 2, 7, 0.82) 0%, rgba(46, 2, 7, 0.22) 72%, rgba(46, 2, 7, 0.34) 100%),
    linear-gradient(180deg, rgba(46, 2, 7, 0.30) 0%, rgba(46, 2, 7, 0.62) 100%);
}
.hero__content {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 1.15rem;
  padding-block: clamp(3.4rem, 10vh, 7.5rem);
}
.hero__title {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7.2vw, 5.8rem);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.012em;
  color: var(--on-ink);
  text-wrap: balance;
}
.hero__sub { max-width: 44ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.4rem; }

.hero__content > * {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  animation: hero-in 0.95s var(--ease-out) forwards;
}
.hero__content > *:nth-child(1) { animation-delay: 0.05s; }
.hero__content > *:nth-child(2) { animation-delay: 0.16s; }
.hero__content > *:nth-child(3) { animation-delay: 0.27s; }
.hero__content > *:nth-child(4) { animation-delay: 0.38s; }

@keyframes hero-in {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ------------------------------------------------------------------- story */

.story__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.story__copy { display: grid; gap: 1rem; align-content: start; padding-top: clamp(0.5rem, 3vw, 2.4rem); }
.story__media { margin: 0; }
.story__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 38%;
}

.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vw, 3.6rem);
  padding-top: 1.7rem;
  border-top: 1px solid var(--line);
}
.stat { display: grid; gap: 0.3rem; }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 600;
  line-height: 1;
  color: var(--brand);
}
.stat__label { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------------------------------------------------------- tipos de telas */

.types { padding-block: clamp(4.5rem, 10vw, 9rem); }
.types__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
  gap: clamp(2.4rem, 5vw, 5rem);
  align-items: start;
}
.types__head { display: grid; gap: 1rem; position: sticky; top: calc(var(--nav-h) + 2rem); }
.types__title { max-width: 18ch; }
.types__note { font-size: 0.95rem; }
.types__list { display: grid; }
.types__item {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  align-items: baseline;
  padding-block: clamp(0.7rem, 1.8vw, 1.2rem);
  border-top: 1px solid rgba(247, 243, 237, 0.16);
}
.types__item:last-child { border-bottom: 1px solid rgba(247, 243, 237, 0.16); }
.types__index {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--on-ink-soft);
}
.types__word {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 7.4vw, 5.4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--on-ink);
  transition: transform 0.6s var(--ease-out);
}
.types__item:nth-child(even) .types__word { transform: translateX(clamp(0.5rem, 4vw, 3.2rem)); }
.types__item:hover .types__word { transform: translateX(clamp(1rem, 6vw, 4.4rem)); }

/* ----------------------------------------------------------------- catalog */

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.4rem, 3vw, 2.4rem);
}
.catalog__item { display: grid; gap: 0.75rem; align-content: start; }
.catalog__item figure { margin: 0; }
.catalog__item img { width: 100%; height: 100%; object-fit: cover; }
.catalog__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.catalog__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.1;
}
.catalog__note { color: var(--ink-soft); font-size: 0.92rem; text-align: right; max-width: 26ch; }

.catalog__item--a { grid-column: 1 / span 5; }
.catalog__item--a img { aspect-ratio: 4 / 5; }
.catalog__item--b { grid-column: 7 / span 4; margin-top: clamp(2rem, 6vw, 5rem); }
.catalog__item--b img { aspect-ratio: 3 / 4; }
.catalog__item--c { grid-column: 3 / span 7; margin-top: clamp(1rem, 3vw, 2.4rem); }
.catalog__item--c img { aspect-ratio: 16 / 9; }
.catalog__item--d { grid-column: 2 / span 4; }
.catalog__item--d img { aspect-ratio: 1 / 1; }
.catalog__item--e { grid-column: 7 / span 5; margin-top: clamp(2.4rem, 7vw, 6rem); }
.catalog__item--e img { aspect-ratio: 4 / 5; }
.catalog__item--f { grid-column: 4 / span 3; }
.catalog__item--f img { aspect-ratio: 287 / 567; }

/* ------------------------------------------------------ para ti y tu hogar */

.band--brand { background: var(--brand); color: var(--on-ink); }

.homeband { display: grid; gap: clamp(2.4rem, 5vw, 3.8rem); }
.homeband__lead {
  display: grid;
  gap: 1rem;
  justify-items: start;
}
.homeband__title {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  max-width: 16ch;
}
.homeband__strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  width: var(--shell);
  margin-inline: auto;
}
.homeband__strip li { overflow: hidden; }
.homeband__strip img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.homeband__strip li:nth-child(even) { transform: translateY(clamp(0.8rem, 2.5vw, 2rem)); }

/* --------------------------------------------------------------- para quién */

.who__list { display: grid; }
.who__row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 0.9fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.4rem);
  padding-block: clamp(1.2rem, 3vw, 1.9rem);
  border-top: 1px solid var(--line);
}
.who__row:last-child { border-bottom: 1px solid var(--line); }
.who__index { font-size: 0.78rem; letter-spacing: 0.16em; color: var(--ink-soft); }
.who__name {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  font-weight: 500;
  line-height: 1.05;
  transition: transform 0.6s var(--ease-out);
}
.who__note { color: var(--ink-soft); font-size: 0.98rem; max-width: 34ch; }
.who__row:hover .who__name { transform: translateX(8px); }
.who__thumb { display: block; width: 88px; }
.who__thumb img { width: 88px; height: 88px; object-fit: cover; }

/* ----------------------------------------------------------------- marquee */

.marquee-band { padding-block: clamp(2.6rem, 5vw, 4.2rem); }
.marquee__track li {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 3.2vw, 2.5rem);
  line-height: 1.2;
  white-space: nowrap;
}
.marquee__track li::after {
  content: "";
  flex: none;
  width: 0.34em;
  height: 0.34em;
  margin-left: 1em;
  border: 1px solid var(--brand);
  background: var(--brand);
  transform: rotate(45deg);
}

/* --------------------------------------------------------------- visitanos */

.visit__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.4rem, 5vw, 5rem);
  align-items: start;
}
.visit__lead { display: grid; gap: 1rem; }
.visit__address { font-size: clamp(2.2rem, 5.4vw, 4.2rem); max-width: 14ch; }
.visit__actions { display: grid; }
.visit__action,
.visit__hours {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}
.visit__actions li:last-child .visit__hours,
.visit__actions li:last-child .visit__action { border-bottom: 1px solid var(--line); }
.visit__action { min-height: 64px; align-items: center; }
.visit__action-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.visit__action-value {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  line-height: 1.2;
  transition: transform 0.5s var(--ease-out), color 0.5s var(--ease-out);
}
.visit__action:hover .visit__action-value { transform: translateX(8px); color: var(--brand); }

/* ------------------------------------------------------------------ footer */

.footer { padding-block: clamp(3rem, 6vw, 5rem); }
.footer__grid { display: grid; gap: 1.2rem; }
.footer__logo {
  display: block;
  height: 40px;
  aspect-ratio: 792 / 170;
  background-color: var(--on-ink);
  -webkit-mask: url("assets/img/logo.png") center / contain no-repeat;
  mask: url("assets/img/logo.png") center / contain no-repeat;
}
.footer__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--on-ink);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem; }
.footer__legal { font-size: 0.84rem; color: var(--on-ink-soft); }
.footer__demo { font-size: 0.78rem; color: var(--on-ink-soft); opacity: 0.75; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .story__grid { grid-template-columns: 1fr; }
  .story__media img { aspect-ratio: 3 / 4; }
  .types__grid { grid-template-columns: 1fr; }
  .types__head { position: static; }
  .catalog__item,
  .catalog__item--a,
  .catalog__item--b,
  .catalog__item--c,
  .catalog__item--d,
  .catalog__item--e,
  .catalog__item--f {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .catalog__item--f { max-width: 287px; }
  .homeband__strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .homeband__strip li:nth-child(even) { transform: none; }
  .who__row {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    grid-template-areas:
      "index name thumb"
      "index note thumb";
    row-gap: 0.4rem;
  }
  .who__index { grid-area: index; }
  .who__name { grid-area: name; }
  .who__note { grid-area: note; }
  .who__thumb { grid-area: thumb; width: 64px; }
  .who__thumb img { width: 64px; height: 64px; }
  .visit__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .stat__label { font-size: 0.78rem; }
  .homeband__strip {
    grid-template-columns: repeat(4, 72vw);
    width: 100%;
    padding-inline: max(1rem, calc((100% - var(--shell)) / 2));
    padding-bottom: 0.6rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .homeband__strip li { scroll-snap-align: start; }
  .catalog__meta { flex-direction: column; gap: 0.25rem; }
  .catalog__note { text-align: left; }
  .visit__action,
  .visit__hours { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (max-width: 420px) {
  .brandmark { height: 26px; }
  .nav__chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__content > * { opacity: 1; transform: none; animation: none; }
  .types__word,
  .types__item:nth-child(even) .types__word,
  .who__name,
  .visit__action-value { transition: none; }
}
