/* Logo intro over the home page: the mark punches in on brown, the 3D wordmark swings round on ink
   with a sheen, then the camera dives through the O into the dark hero below. Plays on every
   visit; a tap skips it; reduced motion never sees it. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 900px;
  cursor: pointer;
  animation:
    intro-bg 3s steps(1) forwards,
    intro-out 0.45s ease 3.05s forwards;
}
.intro > * {
  grid-area: 1 / 1;
}
@keyframes intro-bg {
  0% { background: var(--primary); }
  20% { background: var(--ink); }
}
@keyframes intro-out {
  to { opacity: 0; visibility: hidden; }
}
.intro.gone {
  display: none;
}

/* 1. Punch-in. */
.intro-punch {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  opacity: 0;
  background: linear-gradient(90deg, var(--paper) 50%, var(--ink) 50%);
  animation: intro-punch 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
@keyframes intro-punch {
  0% { opacity: 0; scale: 0.3; }
  40% { opacity: 1; scale: 1.08; }
  85% { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: 1.4; }
}

/* 2. The extruded wordmark swings round; 3. the camera dives through its O. */
.intro-dive {
  opacity: 0;
  animation:
    intro-on 0.01s linear 0.6s forwards,
    intro-dive 1s cubic-bezier(0.7, 0, 0.9, 0.35) 2.3s forwards;
}
@keyframes intro-on { to { opacity: 1; } }
@keyframes intro-dive { to { scale: 70; } }
.intro-extrude {
  position: relative;
  transform-style: preserve-3d;
  animation: intro-turn 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both;
}
@keyframes intro-turn {
  0% { transform: rotateY(-55deg) rotateX(18deg) scale(0.7); }
  75% { transform: rotateY(6deg) rotateX(-3deg) scale(1); }
  100% { transform: none; }
}
.extrude-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  white-space: nowrap;
  font: 600 clamp(44px, 15vw, 150px) / 1 var(--heading);
  letter-spacing: 0.03em;
  transform: translateZ(calc(var(--i) * -3px));
  color: hsl(25 35% calc(14% + var(--i) * 1.4%));
}
.extrude-layer.front {
  position: relative;
  left: auto;
  top: auto;
  translate: none;
  display: block;
  color: var(--cream);
}
.extrude-layer.front em {
  font-style: normal;
}
/* A sheen runs across the front letters (intended, from the reference reel). */
.intro .extrude-layer.front {
  background: linear-gradient(100deg, var(--cream) 42%, #fff 50%, var(--cream) 58%) 200% 0 / 300%
    100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: intro-sheen 1s ease 1.5s forwards;
}
@keyframes intro-sheen { to { background-position: -100% 0; } }

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