/* ==========================================================
   Front Porch — homepage
   Shared look (colours, fonts, top bar, footer, grain) comes
   from night.css; this file adds the homepage-only pieces.
   ========================================================== */

:root { --neon: var(--cyan); }

/* porch-light from above, a cool cyan glow from below */
body::before {
  background:
    radial-gradient(ellipse 60% 45% at 50% 18%, rgba(255, 207, 122, 0.10), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(0, 229, 255, 0.05), transparent 70%);
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);   /* never let wide content push the page wider than the screen */
}

/* ---------- Center stage ---------- */

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--gutter) 4rem;
  text-align: center;
  container-type: inline-size;   /* lets the sign size itself to this area (cqw units) */
  --neon-size: min(90px, 8.8cqw);                     /* FRONT PORCH: largest 90px */
  --pillars-size: clamp(0.78rem, 1.2vw, 0.95rem);     /* ART · SOUND · STORY: up to ~15px */
}

/* Neon-tube porch outline */
.porch {
  width: min(300px, 70vw);
  height: calc(min(300px, 70vw) * 210 / 320);   /* explicit height: Safari can collapse SVGs in flex columns */
  flex-shrink: 0;
  overflow: visible;
  margin-bottom: 2.5rem;
}

.porch .tube {
  fill: none;
  stroke: #c9f7ff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#glow);
  /* the draw-in animation is set up in home.js */
}

.porch .doorway {
  opacity: 0;
  animation: warmOn 1.6s ease 1.6s forwards;
}

.porch .lamp {
  fill: var(--warm);
  filter: url(#glowWarm);
  opacity: 0;
  animation: flickerOn 1.4s steps(1) 1.4s forwards;
}

/* The neon sign */
.neon {
  font-family: var(--sans);
  font-weight: 200;
  /* the sign is ~11× its font size wide; 8.8% of the content width keeps it on one line */
  font-size: var(--neon-size);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.32em;
  padding-left: 0.32em;          /* balances the trailing letter-spacing → truly centred */
  text-transform: uppercase;
  color: #eafcff;
  opacity: 0;
  animation:
    flickerOn 1.2s steps(1) 0.9s forwards,
    neonCycle 6.3s ease-in-out 2.2s infinite;   /* one full cyan → magenta → gold loop */
  text-shadow:
    0 0 4px #fff,
    0 0 12px var(--cyan),
    0 0 28px var(--cyan),
    0 0 60px rgba(0, 229, 255, 0.55);
}

.tagline {
  margin-top: 1.6rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.8vw, 2rem);   /* up to 32px on laptops/desktops */
  color: var(--mute);
  opacity: 0;
  animation: rise 1.2s var(--ease) 1.8s forwards;
}

/* ART · SOUND · STORY — small spaced capitals under the tagline */
.pillars {
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: var(--pillars-size);
  font-weight: 500;
  letter-spacing: 0.42em;
  padding-left: 0.42em;          /* keeps letter-spaced text truly centred */
  text-transform: uppercase;
  color: var(--bone);
  opacity: 0;
  animation: rise 1.2s var(--ease) 1.95s forwards;
}

.pillars span {
  color: var(--faint);
  margin: 0 0.15em;
}

/* ---------- Rooms (project links) ---------- */

.rooms {
  list-style: none;
  width: min(100%, 44rem);
  /* Same visible gap as porch → top of the FRONT PORCH letters.
     That gap = porch margin (2.5rem) + a little space inside the drawing (3.5px)
     + the space above capital letters (0.133 × sign size). The pillars line
     already has 0.447 × its size of space below the letters, so subtract that. */
  margin-top: calc(2.5rem + 3.5px + 0.133 * var(--neon-size) - 0.447 * var(--pillars-size));
  border-top: 1px solid var(--line);
  text-align: left;
}

.room {
  opacity: 0;
  animation: rise 1s var(--ease) forwards;
}
.room:nth-child(1) { animation-delay: 2.1s; }
.room:nth-child(2) { animation-delay: 2.25s; }
.room:nth-child(3) { animation-delay: 2.4s; }

/* each room's neon colour (inherited by the link inside) */
.room          { --c: var(--cyan); }
.room--cyan    { --c: var(--cyan); }
.room--magenta { --c: var(--magenta); }
.room--gold    { --c: var(--gold); }

.room > a,
.room > div {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr auto 1.5rem;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease);
}

/* neon tick on the left that lights up on hover */
.room > *::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 25%;
  bottom: 25%;
  width: 2px;
  background: var(--c);
  box-shadow: 0 0 8px var(--c), 0 0 18px var(--c);
  opacity: 0;
  transform: scaleY(0.3);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.room-num {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--mute);
}

.room-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  transition: color 0.35s var(--ease), text-shadow 0.35s var(--ease), transform 0.4s var(--ease);
}

.room-desc {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--mute);
}

.room-tag {
  padding: 0.3rem 0.7rem;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--mute);
  white-space: nowrap;
}

.room-tag--open {
  color: var(--c);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
}

.room-arrow {
  color: var(--mute);
  transition: transform 0.4s var(--ease), color 0.3s var(--ease);
}

.room > a:hover,
.room > a:focus-visible { background: rgba(244, 241, 234, 0.025); outline: none; }

.room > a:hover::before,
.room > a:focus-visible::before { opacity: 1; transform: none; }

.room > a:hover .room-name,
.room > a:focus-visible .room-name {
  color: #fff;
  text-shadow: 0 0 10px var(--c), 0 0 26px var(--c);
  transform: translateX(6px);
}

.room > a:hover .room-arrow,
.room > a:focus-visible .room-arrow { color: var(--c); transform: translateX(4px); }

.room > div { cursor: default; }
.room > div .room-name { color: rgba(244, 241, 234, 0.45); }

/* ---------- Motion (flickerOn + rise come from night.css) ---------- */

@keyframes warmOn { to { opacity: 1; } }

/* the original Front Porch glow cycle: cyan → magenta → gold */
@keyframes neonCycle {
  0%, 100% {
    text-shadow: 0 0 4px #fff, 0 0 12px var(--cyan), 0 0 28px var(--cyan), 0 0 60px rgba(0, 229, 255, 0.55);
  }
  33% {
    text-shadow: 0 0 4px #fff, 0 0 12px var(--magenta), 0 0 28px var(--magenta), 0 0 60px rgba(255, 45, 160, 0.55);
  }
  66% {
    text-shadow: 0 0 4px #fff, 0 0 12px var(--gold), 0 0 28px var(--gold), 0 0 60px rgba(255, 215, 0, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .neon, .tagline, .room, .porch .doorway, .porch .lamp { animation-delay: 0s !important; }
}

@media (max-width: 560px) {
  .stage { --neon-size: 10.4cqw; }
  .neon { letter-spacing: 0.18em; padding-left: 0.18em; }
  .room > a, .room > div { grid-template-columns: 2rem 1fr auto; }
  .room-arrow { display: none; }
}
