/* ═══════════════════════════════════════════════════════
   Forge — Landing page styles
   Shared tokens + landing section + view-transition
════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color palette — FCP Tiger era (brushed aluminum + medium gray panels) */
  --bg:             #333333;
  --panel-bg:       #474747;
  --panel-header:   #565656;
  --panel-dark:     #383838;
  --toolbar-bg:     #787878;
  --toolbar-hi:     #949494;
  --toolbar-lo:     #606060;
  --border:         #222222;
  --border-hi:      #6e6e6e;
  --border-inner:   #585858;
  --text:           #d8d8d8;
  --text-dim:       #999999;
  --text-bright:    #f0f0f0;
  --accent:         #f0a020;
  --accent-dim:     #7a5010;
  --green:          #4caf50;
  --red:            #e84040;
  --blue:           #4a90d9;

  /* Layout */
  --toolbar-h:      38px;
  --browser-w:      220px;
  --inspector-w:    228px;
  --timeline-h:     180px;

  /* Type */
  --font-ui:        'DM Sans', system-ui, sans-serif;
  --font-mono:      'DM Mono', 'Courier New', monospace;
  --font-display:   'Bebas Neue', sans-serif;
}

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;
}

#css3d-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#landing-content {
  position: relative;
  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;
}

/* visibility, not opacity — each part already carries the landing-in fade
   animation with fill-mode:both, whose filled end value (opacity:1) beats
   any later class-based opacity rule regardless of specificity. */
#landing-content > *.lockup-occluded {
  visibility: hidden;
  pointer-events: none;
}

#landing-content > *.lockup-occluded a {
  pointer-events: none;
}

@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;
}

#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-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;
}
