/* ═══════════════════════════════════════════════════════
   Anvil Animate — Landing page styles
   Tokens come from forge-design-system.css (linked in animate.html
   before this file) + landing section + view-transition
════════════════════════════════════════════════════════ */

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   UTILITY
════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   LANDING PAGE
════════════════════════════════════════════ */
#landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#landing-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.82;
  cursor: grab;
}

/* Placed by landing.js every frame: the card is projected from scene space
   onto the page with one matrix3d, measured from its top-left corner. */
#landing-content {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  z-index: 2;
  width: max-content;
  max-width: 90vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}

#landing-enter,
#landing-socials a {
  pointer-events: auto;
}

/* Seen from behind, the ship is in front of the card: landing.js cuts its
   silhouette out with this mask (polygons updated every frame). */
#landing-content.lockup-clipped {
  -webkit-mask: url(#lockup-mask);
  mask: url(#lockup-mask);
}

#lockup-mask-svg {
  position: absolute;
  width: 0;
  height: 0;
}

@keyframes landing-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

#landing-mark {
  opacity: 0;
  filter: drop-shadow(0 2px 10px rgba(240, 160, 32, 0.25));
  animation: landing-in 1s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#landing-title-main {
  font-family: var(--font-display);
  font-size: clamp(80px, 14vw, 160px);
  line-height: 0.9;
  color: var(--text-bright);
  letter-spacing: 0.02em;
  /* Stacked backgrounds: sheen layer on top, base gradient below */
  background-image:
    linear-gradient(108deg,
      transparent 35%,
      rgba(255, 255, 255, 0.72) 48%,
      rgba(255, 255, 255, 0.18) 52%,
      transparent 65%
    ),
    linear-gradient(160deg, #ffffff 30%, #888888 100%);
  background-size: 220% 100%, 100% 100%;
  background-position: -120% 0, 0 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation:
    landing-in 1s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both,
    forge-sheen 4s 1.8s ease-in-out infinite;
}

@keyframes forge-sheen {
  0%   { background-position: -120% 0, 0 0; }
  100% { background-position: 220% 0, 0 0; }
}

#landing-title-sub {
  /* landing.js wraps each letter in its own span and spaces them with
     margin-right — on every letter except the last, so there is no
     trailing gap past the final glyph the way letter-spacing would add.
     The element's own natural width is therefore exactly its visible
     content, so plain shrink-to-fit centering (via the flex parent) lands
     both edges exactly on #landing-title-main's edges. */
  display: block;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 300;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  -webkit-text-fill-color: var(--text-dim);
  margin-top: 0.35em;
  opacity: 0;
  animation: landing-in 1s 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.8;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: landing-in 1s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-enter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-bright);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  opacity: 0;
  animation: landing-in 1s 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-enter:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 20px rgba(240,160,32,0.15);
  color: var(--accent);
}

#landing-enter svg { opacity: 0.7; transition: transform 0.2s, opacity 0.2s; }
#landing-enter:hover svg { transform: translateX(3px); opacity: 1; }

#landing-tutorials {
  pointer-events: auto;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  opacity: 0;
  animation: landing-in 1s 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-tutorials:hover { color: var(--accent); }

/* What it takes to run: one quiet line, same voice as "follow me". */
#landing-runs {
  pointer-events: auto;
  margin: -6px 0 0;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  line-height: 1.8;
  color: #555;
  opacity: 0;
  animation: landing-in 1s 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-runs a {
  color: #666;
  text-decoration: none;
  border-bottom: 1px solid #333;
  transition: color 0.2s, border-color 0.2s;
}

#landing-runs a:hover { color: var(--text-bright); border-color: var(--text-dim); }

#landing-socials {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: landing-in 1s 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#landing-socials span {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #555;
}

#landing-socials a {
  display: flex;
  color: #666;
  transition: color 0.2s;
}

#landing-socials a:hover { color: var(--text-bright); }

#landing-copy {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  z-index: 4;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #3a3a3a;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   VIEW TRANSITIONS
════════════════════════════════════════════ */
@view-transition { navigation: auto; }

#landing-title {
  view-transition-name: forge-logo;
  contain: layout;
}
