/* ============================================================
   ESTUDIO MARTINI — Home Page
   Hero · Intro · Portfolio Highlights · CTA Band
   ============================================================ */

/* ─── Intro curtain — one-time loader on page entry ─────── */
.curtain { display: none; }

html.js-anim .curtain {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

.curtain__panel {
  flex: 1;
  background: var(--color-black);
  transition: transform 1s cubic-bezier(.83, 0, .17, 1);
}

.curtain__mark {
  position: absolute;
  top: 50%; left: 50%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
}

.curtain__word {
  height: clamp(22px, 3.2vw, 32px);
  width: auto;
  color: var(--color-white);
  transition: transform .7s cubic-bezier(.83, 0, .17, 1), opacity .5s var(--ease-out);
}

.curtain.is-showing .curtain__mark { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.curtain.is-open .curtain__panel--left  { transform: translateX(-100%); }
.curtain.is-open .curtain__panel--right { transform: translateX(100%); }
.curtain.is-open .curtain__word--left  { transform: translateX(-170%); opacity: 0; }
.curtain.is-open .curtain__word--right { transform: translateX(170%); opacity: 0; }
.curtain.is-done { display: none; }

@media (prefers-reduced-motion: reduce) {
  .curtain { display: none !important; }
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  --hero-ember: #e2874a;
  --hero-ember-dim: rgba(226, 135, 74, .35);
  --hero-stone-dim: rgba(247, 245, 241, .62);
  --hero-wa: #1fae63;
  --hero-wa-light: #2bcb79;
  --hero-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Carousel slides — wipe transition between photos */
.hero__slide {
  position: absolute;
  inset: 0;
}

.hero__slide--active { z-index: 1; }

.hero__slide--entering {
  animation: hero-wipe-in .9s cubic-bezier(.65, 0, .35, 1) forwards;
}

@keyframes hero-wipe-in {
  from { clip-path: polygon(118% 0%, 148% 0%, 108% 100%, 78% 100%); }
  to   { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
}

.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.04);
  animation: hero-kenburns 26s ease-in-out infinite alternate;
}

@keyframes hero-kenburns {
  from { transform: scale(1.04); }
  to   { transform: scale(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide--entering { animation: none; }
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__scrim--main {
  background:
    linear-gradient(115deg, rgba(6,6,5,.94) 0%, rgba(6,6,5,.82) 22%, rgba(6,6,5,.4) 46%, rgba(6,6,5,.08) 62%, rgba(6,6,5,0) 75%),
    linear-gradient(0deg, rgba(4,4,3,.88) 0%, rgba(4,4,3,.35) 30%, rgba(4,4,3,0) 55%);
}

.hero__scrim--top {
  background: linear-gradient(180deg, rgba(3,3,3,.55) 0%, rgba(3,3,3,0) 22%);
}

/* Content layer */
.hero__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Topbar: brand mark + location chip */
.hero__topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: clamp(var(--space-4), 4vh, var(--space-8)) var(--space-10) 0;
}

.hero__brand { display: flex; align-items: center; }

.hero__brand-logo {
  width: clamp(120px, 11vw, 150px);
  height: auto;
  filter: invert(1) brightness(1.15);
}

.hero__chip {
  font-family: var(--hero-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-stone-dim);
  border: 1px solid rgba(247, 245, 241, .22);
  background: rgba(15, 14, 12, .62);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Main block — bottom-anchored */
.hero__main {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: clamp(var(--space-4), 4vh, var(--space-8)) var(--space-10) clamp(var(--space-6), 5vh, var(--space-12));
  min-height: 0;
}

.hero__inner { max-width: 660px; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--hero-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hero-stone-dim);
  margin-bottom: clamp(0.5rem, 2vh, var(--space-5));
}

.hero__eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--hero-ember);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 var(--hero-ember-dim);
  animation: hero-pulse-dot 2.4s ease-out infinite;
}

@keyframes hero-pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(226,135,74,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(226,135,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,135,74,0); }
}

.hero__headline {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw + 3vh, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--color-white);
  margin-bottom: clamp(0.75rem, 2.5vh, var(--space-6));
}

.hero__headline-line { display: block; }
.hero__accent { font-style: italic; font-weight: 500; color: var(--hero-ember); }

.hero__subhead {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  color: var(--hero-stone-dim);
  max-width: 46ch;
  margin-bottom: clamp(1.25rem, 7vh, 5.5rem);
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: clamp(1rem, 3vh, var(--space-8));
}

.hero__whatsapp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: linear-gradient(180deg, var(--hero-wa-light), var(--hero-wa));
  color: #08150d;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 1.05rem 1.7rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgba(31,174,99,.55), 0 0 0 0 rgba(43,203,121,.5);
  --mx: 0px; --my: 0px;
  animation: hero-pulse-btn 1.6s var(--ease-out) 1.8s 2;
  transition: transform 0.4s var(--ease-out), box-shadow 0.35s var(--ease-out);
  transform: translate(var(--mx), var(--my));
  will-change: transform;
}

.hero__whatsapp-btn:hover {
  transform: translate(var(--mx), calc(var(--my) - 2px)) scale(1.02);
  box-shadow: 0 12px 28px -8px rgba(31,174,99,.65);
}

.hero__whatsapp-btn:active {
  transform: translate(var(--mx), var(--my)) scale(.955);
  transition: transform 0.12s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

@keyframes hero-pulse-btn {
  0%, 100% { box-shadow: 0 8px 24px -8px rgba(31,174,99,.55), 0 0 0 0 rgba(43,203,121,.45); }
  50%      { box-shadow: 0 8px 24px -8px rgba(31,174,99,.55), 0 0 0 10px rgba(43,203,121,0); }
}

.hero__whatsapp-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.hero__whatsapp-btn-arrow { transition: transform 0.35s var(--ease-out); }
.hero__whatsapp-btn:hover .hero__whatsapp-btn-arrow { transform: translateX(4px); }

.hero__link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--hero-stone-dim);
  border-bottom: 1px solid rgba(247,245,241,.28);
  padding-bottom: 2px;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.hero__link-secondary:hover { color: var(--color-white); border-color: var(--color-white); }
.hero__link-secondary-arrow { transition: transform 0.35s var(--ease-out); }
.hero__link-secondary:hover .hero__link-secondary-arrow { transform: translate(2px, -2px); }

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  font-family: var(--hero-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--hero-stone-dim);
}

.hero__trust li:not(.hero__trust-sep)::before {
  content: '✓';
  color: var(--hero-wa-light);
  margin-right: 0.5rem;
  font-weight: 600;
}

.hero__trust-sep { color: rgba(247,245,241,.25); }

/* Technical stamp — bottom right */
.hero__stamp {
  position: absolute;
  z-index: 2;
  right: var(--space-10);
  bottom: var(--space-8);
  font-family: var(--hero-font-mono);
  font-size: 0.62rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--hero-stone-dim);
  background: rgba(8,8,7,.72);
  border: 1px solid rgba(247,245,241,.18);
  padding: 0.75rem 1rem;
}

.hero__stamp b { color: var(--color-white); font-weight: 500; }
.hero__stamp-rule { width: 100%; height: 1px; background: rgba(247,245,241,.18); margin: 0.4rem 0; }

/* Scroll indicator — centered bottom */
.hero__scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--hero-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hero-stone-dim);
}

.hero__scroll-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(247,245,241,.7), rgba(247,245,241,0));
  animation: hero-scrolldrop 2s ease-in-out infinite;
}

@keyframes hero-scrolldrop {
  0%   { opacity: .2; transform: scaleY(.3); transform-origin: top; }
  50%  { opacity: 1;  transform: scaleY(1); }
  100% { opacity: .2; transform: scaleY(.3); }
}

/* Reveal engine — staggered entrance on load */
.hero.is-ready .r { opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.hero.is-ready .hero__chip                       { transition-delay: .05s; }
.hero.is-ready .hero__brand                      { transition-delay: 0s;   }
.hero.is-ready .hero__eyebrow                    { transition-delay: .15s; }
.hero.is-ready .hero__headline-line:nth-child(1) { transition-delay: .28s; }
.hero.is-ready .hero__headline-line:nth-child(2) { transition-delay: .4s;  }
.hero.is-ready .hero__subhead                    { transition-delay: .56s; }
.hero.is-ready .hero__cta-row                    { transition-delay: .72s; }
.hero.is-ready .hero__trust                      { transition-delay: .86s; }
.hero.is-ready .hero__stamp                      { transition-delay: 1.9s; }
.hero.is-ready .hero__scroll                     { transition-delay: 1.1s; }
.r { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .hero__slide img { animation: none; }
  .hero__whatsapp-btn { animation: none; transition: box-shadow .35s var(--ease-out); }
  .hero__whatsapp-btn:hover, .hero__whatsapp-btn:active { transform: none; }
  .hero__eyebrow-dot { animation: none; }
  .hero__scroll-line { animation: none; }
  .r, .hero.is-ready .r { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ─── Intro ──────────────────────────────────────────────── */
.intro {
  padding-block: var(--space-32);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-24);
  align-items: center;
}

.intro-text h2   { margin-bottom: var(--space-6); }
.intro-text p    { margin-bottom: var(--space-5); }
.intro-text p:last-of-type { margin-bottom: 0; }

.intro-cta {
  margin-top: var(--space-10);
}

.intro-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-top: var(--space-10);
  padding-top: var(--space-10);
  border-top: var(--border-thin);
}

.stat__number {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 400;
  color: var(--color-dark);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat__label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gray-400);
}

/* Intro visual */
.intro-visual {
  position: relative;
}

.intro-image-wrap {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.intro-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.intro-image-wrap:hover img {
  transform: scale(1.03);
}

/* Decorative frame offset */
.intro-accent {
  position: absolute;
  bottom: calc(-1 * var(--space-6));
  left: calc(-1 * var(--space-6));
  width: 160px;
  height: 160px;
  border: 1px solid var(--color-gray-200);
  z-index: -1;
  pointer-events: none;
}

/* ─── Portfolio Highlights ───────────────────────────────── */
.portfolio-section {
  padding-block: var(--space-24);
  background-color: var(--color-off-white);
}

.portfolio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

/* Asymmetric grid: big left, three small right */
.portfolio-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: var(--space-3);
  height: 780px;
}

.portfolio-grid .project-card:first-child {
  grid-row: 1 / 4;
}

.portfolio-grid .project-card:first-child .project-card__image-wrap {
  aspect-ratio: unset;
  height: 100%;
}

.portfolio-grid .project-card:not(:first-child) .project-card__image-wrap {
  aspect-ratio: unset;
  height: 100%;
}

.portfolio-grid .project-card {
  height: 100%;
}

/* ─── Services Teaser ────────────────────────────────────── */
.services-teaser {
  padding-block: var(--space-24);
}

.services-teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-16);
}

.services-teaser-grid .service-teaser-card:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-8);
  align-items: start;
}

.service-teaser-card {
  background: var(--color-off-white);
  padding: var(--space-10) var(--space-8);
  border: var(--border-thin);
  transition: border-color var(--dur-base) var(--ease-out);
  color: inherit;
  text-decoration: none;
}

a.service-teaser-card {
  display: block;
}

.service-teaser-card:hover {
  border-color: var(--color-gray-400);
}

.service-teaser-card__num {
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  letter-spacing: 0.2em;
  margin-bottom: var(--space-6);
}

.service-teaser-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-dark);
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.service-teaser-card__text {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  line-height: 1.8;
}

/* ─── CTA Band — see components.css ─────────────────────── */

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .intro-visual { order: -1; }

  .intro-image-wrap {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .portfolio-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    height: auto;
  }

  .portfolio-grid .project-card:first-child {
    grid-row: auto;
    grid-column: 1 / 3;
  }

  .portfolio-grid .project-card:first-child .project-card__image-wrap,
  .portfolio-grid .project-card:not(:first-child) .project-card__image-wrap {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .portfolio-grid .project-card { height: auto; }
}

@media (max-width: 768px) {
  .intro        { padding-block: var(--space-20); }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid .project-card:first-child {
    grid-column: auto;
  }

  .portfolio-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .intro-stats {
    grid-template-columns: 1fr 1fr;
  }

  .services-teaser-grid {
    grid-template-columns: 1fr;
  }

  .hero__stamp, .hero__scroll { display: none; }
}

@media (max-width: 640px) {
  .hero__scrim--main {
    background: linear-gradient(180deg, rgba(4,4,3,.55) 0%, rgba(4,4,3,.35) 30%, rgba(4,4,3,.55) 55%, rgba(4,4,3,.92) 78%, rgba(4,4,3,.97) 100%);
  }

  .hero__topbar {
    justify-content: center;
    padding: var(--space-8) var(--space-6) 0;
  }

  .hero__main { padding: var(--space-6) var(--space-6) var(--space-10); }

  .hero__brand-logo { width: 250px; }

  .hero__chip { display: none; }

  .hero__cta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .hero__whatsapp-btn { width: 100%; justify-content: center; }
}

@media (max-height: 640px) {
  .hero { height: 100vh; }
}
