.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border: 1px solid #d29a35;
  background: #070706;
  color: #f4f0e8;
  font: 700 12px/1.4 Manrope, Arial, sans-serif;
  letter-spacing: .04em;
  transform: translateY(-160%);
  transition: transform .2s ease;
}

/* The homepage is fully rendered beneath this fixed first-visit layer. Keeping
   the intro out of document flow prevents layout movement and lets hero assets
   load at their existing priority while the short CSS sequence plays. */
.site-intro {
  display: none;
}

html.intro-pending,
html.intro-pending body {
  overflow: hidden;
}

html.intro-pending .site-intro {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
  pointer-events: auto;
  background:
    radial-gradient(circle at 50% 48%, rgba(210, 154, 53, .09), transparent 32%),
    #070706;
  animation: hk-intro-exit 840ms cubic-bezier(.65, 0, .35, 1) both;
}

html.intro-pending .site-intro::before {
  content: '';
  position: absolute;
  width: min(72vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(210, 154, 53, .12);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.82);
  box-shadow: 0 0 90px rgba(210, 154, 53, .08), inset 0 0 90px rgba(210, 154, 53, .035);
  animation: hk-intro-halo 620ms cubic-bezier(.2, .75, .3, 1) 60ms both;
}

.site-intro__identity {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: clamp(9px, 1.2vw, 14px);
  color: #f4f0e8;
  opacity: 0;
  filter: blur(5px);
  transform: translateY(7px) scale(.96);
  animation: hk-intro-mark 380ms cubic-bezier(.16, 1, .3, 1) 50ms forwards;
}

.site-intro__monogram {
  font: 500 clamp(38px, 5vw, 68px)/.82 Georgia, 'Times New Roman', serif;
  letter-spacing: -.055em;
}

.site-intro__rule {
  width: clamp(76px, 10vw, 136px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #d29a35 28%, #efc76f 50%, #d29a35 72%, transparent);
  box-shadow: 0 0 16px rgba(210, 154, 53, .42);
  transform: scaleX(0);
  animation: hk-intro-line 440ms cubic-bezier(.2, .8, .2, 1) 160ms forwards;
}

.site-intro__name {
  color: #d8b264;
  font: 600 clamp(9px, 1vw, 12px)/1 Arial, sans-serif;
  letter-spacing: .46em;
  text-indent: .46em;
}

@keyframes hk-intro-mark {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes hk-intro-line {
  to { transform: scaleX(1); }
}

@keyframes hk-intro-halo {
  0% { opacity: 0; transform: scale(.82); }
  48% { opacity: 1; }
  100% { opacity: .18; transform: scale(1.06); }
}

@keyframes hk-intro-exit {
  0%, 72% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-1.5vh); }
}

/* Match the first paint to the fixed scene canvas before the deferred motion
   controller starts. A short inline timeout restores the document-flow
   fallback if JavaScript or the animation library cannot initialise. */
html.scene-preload,
html.scene-preload body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

html.scene-preload .site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
}

html.scene-preload main {
  position: fixed;
  inset: var(--header-h, 88px) 0 0;
  width: 100%;
  overflow: hidden;
}

html.scene-preload main > .hero,
html.scene-preload main > .section[id] {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
}

html.scene-preload main > .section[id] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Dormant scenes do not participate in the initial layout/paint. The scene
   director adds scene-entering before it reveals one, so transitions remain
   unchanged while the initial CLS stays at zero. */
html.scene-preload main > .scene:not(.is-active),
html.immersive-experience main.immersive-stage > .scene:not(.is-active):not(.scene-entering):not(.scene-leaving) {
  display: none !important;
}

html.scene-preload .scene-progress { visibility: hidden; }

.skip-link:focus {
  transform: none;
  outline: 2px solid #fff;
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #e0a52f;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }

  html.intro-pending .site-intro {
    display: none;
    animation: none;
  }
}
