/* Home – Figma "01 Home" (311:1313) */

/* ---------- Hero: claim + coverflow (Figma 730:11191) ---------- */

.home-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  align-items: center;
  justify-content: center; /* tall screens: claim + coverflow sit in the middle */
  min-height: 100svh;
  overflow: hidden;
  padding: calc(var(--header-height) + var(--space-48)) var(--space-64) var(--space-96);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

.home-hero__title {
  position: relative;
  z-index: 0;
  color: var(--color-interactive-primary);
  text-align: center;
}

/* 3D coverflow on a 1040 × 480 stage; claim sits behind it. data-offset: 0 = front, ±1/±2 sides */
.coverflow {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  aspect-ratio: 1040 / 480;
  margin-top: -4%;
  perspective: 1600px;
  touch-action: pan-y;
}

.coverflow__item {
  --x: 0%;
  --ry: 0deg;
  --scale: 1;
  --lift: 0px;
  --shade: 0;
  position: absolute;
  top: 4%;
  left: 30.75%;
  width: 38.5%;
  height: 92%;
  translate: var(--x) var(--lift);
  transform: rotateY(var(--ry)) scale(var(--scale));
  transition:
    translate 0.6s var(--ease-out-soft),
    transform 0.6s var(--ease-out-soft),
    opacity 0.6s var(--ease-out-soft);
}

.coverflow__item[data-offset="0"]  { z-index: 5; }
.coverflow__item[data-offset="-1"] { --x: -62%;  --ry: 38deg;  --scale: 0.86; --shade: 1; z-index: 4; }
.coverflow__item[data-offset="1"]  { --x: 62%;   --ry: -38deg; --scale: 0.86; --shade: 1; z-index: 4; }
.coverflow__item[data-offset="-2"] { --x: -104%; --ry: 48deg;  --scale: 0.72; --shade: 1; z-index: 3; }
.coverflow__item[data-offset="2"]  { --x: 104%;  --ry: -48deg; --scale: 0.72; --shade: 1; z-index: 3; }
.coverflow__item[data-offset="-3"] { --x: -130%; --ry: 55deg;  --scale: 0.6;  z-index: 2; opacity: 0; pointer-events: none; }
.coverflow__item[data-offset="3"]  { --x: 130%;  --ry: -55deg; --scale: 0.6;  z-index: 2; opacity: 0; pointer-events: none; }

.coverflow__card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--space-16);
  border-radius: calc(var(--radius-16) + var(--space-16)); /* concentric, like all case tiles */
  background: var(--project-surface);
  box-shadow: 0 24px 48px -6px rgb(0 0 0 / 0.35);
}

.coverflow__card img,
.coverflow__card video {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-16);
  object-fit: cover;
}

/* perspective shading towards the outer edge of side cards */
.coverflow__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: var(--shade);
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out-soft);
}

.coverflow__item[data-offset^="-"] .coverflow__card::after { background: linear-gradient(90deg, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0.1)); }
.coverflow__item:not([data-offset^="-"]) .coverflow__card::after { background: linear-gradient(270deg, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0.1)); }

.coverflow__item:not([data-offset="0"]) .coverflow__card {
  cursor: pointer;
}

@media (hover: hover) {
  .coverflow__item[data-offset="0"]:hover {
    --lift: -12px;
  }
}

/* arrow chip like on project tiles, only on the front card */
.coverflow__card .cursor-chip {
  z-index: 1;
}

.coverflow__item[data-offset="0"] .coverflow__card:hover .cursor-chip,
.coverflow__item[data-offset="0"] .coverflow__card:focus-visible .cursor-chip {
  opacity: 1;
  scale: 1;
}

@media (prefers-reduced-motion: reduce) {
  .coverflow__item,
  .coverflow__card::after {
    transition: none;
  }
}

.home-hero__text {
  position: relative;
  z-index: 1;
  max-width: 560px;
  text-align: center;
}

/* ---------- Selected projects (Figma 730:11297) ---------- */

.selected__head {
  display: flex;
  gap: var(--space-48);
  align-items: flex-end;
  justify-content: space-between;
}

.selected__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  max-width: 780px;
}

/* ---------- About + facts ---------- */

.home-about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-96);
  align-items: center;
  background: var(--color-surface-warm);
}

.home-about__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  max-width: 560px;
}

.home-about__text .text-lead {
  color: var(--color-text-secondary);
}

/* ---------- Number tiles: small tilted cards floating next to the about text ---------- */

.number-tiles {
  position: relative;
  width: min(560px, 42vw);
  height: 520px;
}

.number-tiles__item {
  position: absolute;
}

.number-tiles__item:nth-child(1) { top: 2%;  left: 8%;  --tilt: -6deg; z-index: 2; }
.number-tiles__item:nth-child(2) { top: 14%; left: 58%; --tilt: 5deg; }
.number-tiles__item:nth-child(3) { top: 58%; left: 0;   --tilt: 4deg; }
.number-tiles__item:nth-child(4) { top: 52%; left: 50%; --tilt: -3deg; z-index: 1; }

.number-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 200px;
  padding: var(--space-24) var(--space-24) var(--space-32);
  border-radius: var(--radius-24);
  background: var(--color-core-surface-night);
  color: var(--color-fixed-light);
  box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.28);
  rotate: var(--tilt, 0deg);
}

.number-tiles__item:nth-child(4n + 2) .number-tile {
  background: var(--color-signal-coral);
}

.number-tiles__item:nth-child(4n + 3) .number-tile {
  background: var(--color-core-surface-paper);
  color: var(--color-fixed-dark);
}

.number-tiles__item:nth-child(4n + 4) .number-tile {
  background: var(--color-core-tone-graphite);
}

.number-tile__figure {
  font-size: clamp(56px, 6vw, 88px);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.number-tile__label {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-small);
  letter-spacing: var(--letter-spacing-small);
  hyphens: manual;
  text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
  /* each tile floats at its own pace; on scroll they drift apart a little (--sy from motion.js) */
  .number-tile {
    animation: stage-float 7s ease-in-out -1s infinite alternate;
  }

  .number-tiles__item:nth-child(2) .number-tile { --scroll-depth: -40px; animation-duration: 8.5s; animation-delay: -3s; }
  .number-tiles__item:nth-child(3) .number-tile { --scroll-depth: 56px; animation-duration: 6.5s; animation-delay: -5s; }
  .number-tiles__item:nth-child(4) .number-tile { --scroll-depth: -16px; animation-duration: 9s; animation-delay: -2s; }

  @media (min-width: 1024px) {
    .number-tile {
      translate: 0 calc(var(--sy, 0) * var(--scroll-depth, 24px));
    }
  }

  .number-tiles__item:nth-child(2) { --depth: -18px; }
  .number-tiles__item:nth-child(3) { --depth: 24px; }
  .number-tiles__item:nth-child(4) { --depth: -12px; }
}

@media (max-width: 1023px) {
  .home-about {
    grid-template-columns: 1fr;
    gap: var(--space-64);
  }

  /* phones and tablets: a loose, tilted row that wraps */
  .number-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-24) var(--space-16);
    width: auto;
    height: auto;
    padding-block: var(--space-16);
  }

  .number-tiles__item {
    position: static;
    flex: 1 1 calc(50% - var(--space-16));
  }

  .number-tile {
    min-width: 0;
    padding: var(--space-16) var(--space-16) var(--space-24);
  }

  .number-tile__figure {
    font-size: 48px;
  }

  .number-tiles__item:nth-child(even) {
    translate: 0 var(--space-24);
  }
}

/* ---------- Newsletter (Figma 730:11543) ---------- */

.newsletter {
  padding-block: var(--layout-block);
  background: var(--color-surface-raised);
}

.newsletter__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  max-width: 600px;
}

.newsletter .text-lead {
  color: var(--color-text-secondary);
}

/* Form / Email Field, Layout=Row */
.email-field {
  display: flex;
  gap: var(--space-16);
  align-items: center;
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-24);
  border-radius: var(--radius-pill);
  background: var(--color-surface-base);
  box-shadow: var(--shadow-float);
}

.email-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
}

.email-field input::placeholder {
  color: var(--color-text-tertiary);
}

.email-field:focus-within {
  outline: 2px solid var(--color-interactive-primary);
  outline-offset: 2px;
}

/* ---------- Statement (Figma 730:11517) ---------- */

.statement {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  align-items: flex-start;
  background: var(--color-surface-warm);
}

.statement .text-h1 {
  max-width: 1100px;
}

.statement__muted {
  color: var(--color-text-tertiary);
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .home-hero {
    justify-content: center;
    padding-inline: var(--layout-margin);
  }

  .coverflow {
    width: calc(100% + 2 * var(--layout-margin));
    aspect-ratio: 4 / 3;
    margin-top: -4%;
  }

  .coverflow__item {
    left: 24%;
    width: 52%;
  }

  .coverflow__card {
    padding: var(--space-8);
    border-radius: calc(var(--radius-16) + var(--space-8));
  }

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


  .email-field {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-8);
    border-radius: var(--radius-24);
  }

  .email-field input {
    padding: var(--space-8) var(--space-16);
  }
}
