:root{
  --bg: #0b0d12;
  --fg: #ffffff;
  --muted: rgba(255,255,255,0.48);
  --duck: #ffd400;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body{
  overflow-x: hidden;
}

.brand-rail{
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-btn{
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;

  font-weight: 800;
  font-size: 34px;
  line-height: 44px;
  text-align: left;
  color: rgba(255,255,255,0.35);
}

.rail-btn:focus-visible{
  outline: 2px solid var(--duck);
  outline-offset: 6px;
  border-radius: 10px;
}

.content{
  padding-left: 220px;   /* desktop layout */
  padding-right: 40px;
}

.panel{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 80px 0;
  opacity: 0.35;
}

.heading{
  margin: 0;
  font-weight: 900;
  font-size: clamp(56px, 7vw, 120px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--duck);
}

.heading .first{
  /* the real first letter stays in DOM for accessibility;
     we hide it while overlay sits on top */
  display: inline-block;
}

.heading .rest{
  display: inline-block;
  opacity: 0;
  letter-spacing: -0.10em;
  will-change: opacity, letter-spacing;
}

.panel p{
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

/* Overlay letter (the moving glyph) */
#morph-letter{
  position: fixed;
  left: -9999px;
  top: -9999px;
  z-index: 9999;
  pointer-events: none;

  font-weight: 900;
  font-size: clamp(56px, 7vw, 120px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--duck);

  will-change: transform, left, top;
  transform-origin: left center;
  text-shadow: 0 0 18px rgba(255,212,0,0.18), 0 0 42px rgba(255,212,0,0.10);
}

/* ===== Mobile-only tweaks (desktop untouched) ===== */
@media (max-width: 768px){
  .brand-rail{
    left: 12px;
    gap: 8px;
  }

  .rail-btn{
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 32px;
  }

  .content{
    padding-left: 92px;
    padding-right: 16px;
  }

  .panel{
    min-height: 85vh;
    padding: 64px 0;
  }

  .panel p{
    font-size: 16px;
  }
/* FIX: keep first letter + word together */
  .heading{
    white-space: nowrap;
    font-size: clamp(42px, 10vw, 64px);
  }

  .heading .first,
  .heading .rest{
    display: inline;
    white-space: nowrap;
  }

  .panel p{
    font-size: 16px;
    max-width: 100%;
  }

}
