/* ============================================
   LANDING PAGE
   Entirely self-contained — no base.css needed
   ============================================ */

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

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-text);
  opacity: 0;
  transition: opacity 500ms ease;
}

body.loaded {
  opacity: 1;
}

/* Warm grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: soft-light;
}


/* --- Mute button — mirrors site bar position on inner pages --- */

.landing-mute {
  position: fixed;
  top: 0;
  right: 32px;
  height: 56px;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease, color 160ms ease;
  z-index: 100;
}

.landing-mute.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.landing-mute:hover {
  color: var(--c-text);
}

.landing-mute.is-muted {
  color: var(--c-text-dim);
}


/* --- Centered layout --- */

.landing-center {
  position: relative;      /* contains absolutely-positioned circles + SVG */
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}


/* --- Subtle light pulse emanating from central text --- */
@keyframes textGlow {
  0%, 100% {
    filter: drop-shadow(0 0 0px rgba(234,224,208,0));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(234,224,208,0.12));
  }
}

/* --- Per-line text glow — synced to the same 7s cycle as textGlow --- */
@keyframes line1Glow {
  0%, 100% { text-shadow: none; }
  50%       { text-shadow: 0 0 12px rgba(234, 224, 208, 0.38); }
}

@keyframes line2Glow {
  0%, 100% { text-shadow: none; }
  50%       { text-shadow: 0 0 14px rgba(255, 72, 0, 0.48); }
}


/* --- Central text block --- */

.landing-text {
  text-align: center;
  user-select: none;
  cursor: pointer;
  line-height: 1.05;
  position: relative;
  z-index: 2;             /* above circles and lines */
  animation: textGlow 7s ease-in-out infinite;
}

.landing-line {
  display: block;
  font-size: clamp(2.2rem, 5.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--c-text);
}

/* .space is orange */
#line-2 {
  color: var(--c-accent-orange);
}

#line-2.is-glowing {
  animation: line2Glow 7s ease-in-out infinite;
}

.landing-line + .landing-line {
  margin-top: 0.05em;
}

/* --- findlayboyes materialise animation ---
   Triggered by adding class .is-materialising to #line-1 on page load.
   High blur + contrast creates a threshold/pixel-emergence effect;
   flickering keyframes give a scratchy, noisy feel before resolving.
   ------------------------------------------------------------------ */
@keyframes materialise {
  0%   { opacity: 0.1; filter: blur(48px) contrast(20) brightness(3.5); }
  25%  { opacity: 0.4; filter: blur(32px) contrast(10) brightness(2);   }
  50%  { opacity: 0.65; filter: blur(16px) contrast(4)  brightness(1.3); }
  75%  { opacity: 0.85; filter: blur(6px)  contrast(1.8) brightness(1.1); }
  90%  { opacity: 0.95; filter: blur(1.5px) contrast(1.1) brightness(1); }
  100% { opacity: 1;    filter: none; }
}

#line-1 {
  animation: line1Glow 7s ease-in-out infinite;
}

#line-1.is-materialising {
  animation: materialise 3000ms linear forwards, line1Glow 7s ease-in-out infinite;
}


/* --- findlayboyes exit animation ---
   Triggered by adding class .is-exiting to #line-1.
   Grows very slowly, then fades away and up.
   ------------------------------------------------------------------ */
@keyframes growFadeUp {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.15, 0, 0.25, 1);
  }
  58% {
    /* end of growth phase */
    transform: scale(1.1) translateY(0);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.6, 0, 1, 0.4);
  }
  100% {
    transform: scale(1.14) translateY(-22px);
    opacity: 0;
  }
}

#line-1.is-exiting {
  animation: growFadeUp 2600ms forwards, line1Glow 7s ease-in-out infinite;
  pointer-events: none;
}


/* --- Individual letter spans (added by JS) --- */

.letter {
  display: inline-block;
  will-change: transform;
}


/* --- Navigation column (post-click state) --- */

.landing-nav {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.landing-nav__item {
  display: block;
  font-size: clamp(2.2rem, 5.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--c-text);
  text-decoration: none;
  line-height: 1.2;
  transition: opacity 160ms ease;
}

.landing-nav__item:hover {
  opacity: 0.5;
}

/* First letter of each nav item — orange, matching original .space colour */
.nav-first {
  color: var(--c-accent-orange);
}

/* The remaining letters of each nav word (rojects, bout, etc.) */
.nav-rest {
  color: var(--c-text);
}


/* --- Floating circles --- */

.landing-circle {
  position: absolute;
  border-radius: 50%;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  z-index: 1;
  overflow: hidden; /* clips card content to circle shape during collapse */
  transition:
    box-shadow 200ms ease,
    width 280ms cubic-bezier(0.4, 0, 0.2, 1),
    height 280ms cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 280ms cubic-bezier(0.4, 0, 0.2, 1),
    background 200ms ease;
  /* transform is driven by JS float loop — do not include here */
}

/* Rotating dashed border ring via ::before pseudo-element.
   The circle container stays still so text is always legible. */
.landing-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--c-border-light);
  animation: circle-spin 22s linear infinite;
}

.landing-circle:hover {
  /* transform handled by JS to compose with float offset */
  box-shadow: 5px 5px 0 var(--c-accent-orange);
}

.landing-circle:hover::before {
  animation-play-state: paused;
}

.landing-circle__text {
  font-size: 0.6rem;
  text-align: center;
  color: var(--c-text-muted);
  padding: 0.6rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

/* Individual sizes and positions — roughly pentagonal, varied radii and slight offsets */
#circle-1 {
  width: 88px;
  height: 88px;
  top: 14%;
  left: 48%;
}
#circle-1::before { animation-duration: 18s; }

#circle-2 {
  width: 90px;
  height: 90px;
  top: 27%;
  left: 84%;
}
#circle-2::before { animation-duration: 38s; animation-direction: reverse; }

#circle-3 {
  width: 138px;
  height: 138px;
  top: 71%;
  left: 57%;
}
#circle-3::before { animation-duration: 26s; }

#circle-4 {
  width: 100px;
  height: 100px;
  top: 68%;
  left: 25%;
}
#circle-4::before { animation-duration: 21s; animation-direction: reverse; }

#circle-5 {
  width: 110px;
  height: 110px;
  top: 38%;
  left: 14%;
}
#circle-5::before { animation-duration: 31s; }

@keyframes circle-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* --- Content iframe (shell architecture) ---
   Hidden until a nav item is clicked.
   Lives above the landing layer.
   ------------------------------------------ */

#content-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  background: var(--c-bg);
  transition: opacity 380ms ease;
}

#content-frame.is-visible {
  opacity: 1;
  pointer-events: auto;
}


/* --- SVG connector lines --- */

.landing-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.landing-line-svg {
  stroke-width: 1.5;
  /* stroke colour and opacity set per-line via SVG linearGradient in JS */
}


/* --- Circle card content (hidden by default, shown when .is-expanded) --- */

.circle-card__content {
  position: absolute;
  inset: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.circle-card__title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-accent-orange);
}

.circle-card__desc {
  font-size: 0.72rem;
  color: var(--c-text-muted);
  line-height: 1.5;
  font-family: var(--font-body);
}

.circle-card__link {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--c-accent-orange);
  text-decoration: none;
  margin-top: auto;
}


/* --- Expanded circle state ---
   !important needed on width/height because #circle-1/2/3 ID rules
   have higher specificity than .landing-circle.is-expanded.
   ------------------------------------------------------------------ */

.landing-circle.is-expanded {
  width: 170px !important;
  height: 170px !important;
  border-radius: 50%;
  background: var(--c-surface);
  /* inset ring replaces border so it participates in box-shadow transition — no snap on collapse */
  box-shadow: inset 0 0 0 2px var(--c-accent-orange), 5px 5px 0 var(--c-accent-orange);
  z-index: 10;
  cursor: default;
}

.landing-circle.is-expanded::before {
  animation-play-state: paused;
  opacity: 0;
  transition: opacity 160ms ease;
}

.landing-circle.is-expanded .landing-circle__text {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.landing-circle.is-expanded .circle-card__content {
  opacity: 1;
  pointer-events: auto;
  padding: 26px 24px;
  transition-delay: 180ms;
}

.landing-circle.is-expanded .circle-card__title { font-size: 0.6rem; }
.landing-circle.is-expanded .circle-card__desc  { font-size: 0.58rem; line-height: 1.4; }
.landing-circle.is-expanded .circle-card__link  { font-size: 0.56rem; }


/* --- Collapsing state — shape shrinks slowly, content clipped by overflow:hidden --- */

.landing-circle.is-collapsing .circle-card__content {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 150ms ease !important;
  transition-delay: 0ms !important;
}

/* Keep label text and spinning ring hidden until circle is fully collapsed */
.landing-circle.is-collapsing .landing-circle__text {
  opacity: 0 !important;
  pointer-events: none !important;
}

.landing-circle.is-collapsing::before {
  opacity: 0 !important;
}

.landing-circle.is-collapsing {
  transition:
    box-shadow 600ms ease,
    width 600ms cubic-bezier(0.4, 0, 0.2, 1),
    height 600ms cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 600ms cubic-bezier(0.4, 0, 0.2, 1),
    background 500ms ease;
}
