/* Bayview after the rain: asphalt, sodium streetlights, the logo on the horizon. */
:root {
  --asphalt: #0A101B;
  --sky-low: #1A2B44;
  --sky-high: #060A13;
  --sodium: #FFA43A;
  --ice: #5CC8FF;
  --text: #E6EDF5;
  --muted: #8D9CB2;
  --faint: #5B6A80;

  --font: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;

  --hz: 62%;                       /* horizon line inside the stage */
  --logo-w: min(680px, 86vw);
}

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

html { background: var(--asphalt); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--asphalt);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.defs {
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
}

/* ---------- Stage: night street ---------- */
/* The stage takes whatever height is left after the copy and footer,
   so the whole page fits one screen on common desktop viewports. */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 320px;
  max-height: 640px;
  margin: 0;
}

.night {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(55% 16% at 50% var(--hz), rgba(255, 164, 58, 0.16), transparent 100%),
    radial-gradient(70% 30% at 50% var(--hz), rgba(92, 200, 255, 0.10), transparent 100%),
    linear-gradient(to bottom,
      var(--sky-high) 0%,
      #0E1A2E calc(var(--hz) - 22%),
      var(--sky-low) var(--hz),
      #101A2A calc(var(--hz) + 0.5%),
      var(--asphalt) 100%);
}

/* Wet asphalt grain below the horizon */
.night::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: var(--hz);
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}

.skyline {
  position: absolute;
  left: 0;
  width: 100%;
  height: 12%;
  bottom: calc(100% - var(--hz));
  fill: #14223A;
}

/* Sodium streetlights receding to the vanishing point.
   --x: position, --y: lamp height above horizon, --g: where its reflection starts,
   --s: lamp size, --d: switch-on delay (far lamps first). */
.lamp {
  position: absolute;
  inset: 0;
}

/* Pole: from the lamp head down to the kerb */
.lamp::before {
  content: "";
  position: absolute;
  left: var(--x);
  top: calc(var(--hz) - var(--y));
  width: max(1px, calc(var(--s) * 0.2));
  height: calc(var(--y) + var(--g));
  translate: -50% 0;
  background: linear-gradient(to bottom, #2A3A55, #121C2C);
}

.lamp i,
.lamp b {
  position: absolute;
  left: var(--x);
  translate: -50% 0;
  animation: lamp-on 0.9s var(--d) both;
}

.lamp i {
  top: calc(var(--hz) - var(--y));
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #FFE2B8;
  box-shadow:
    0 0 calc(var(--s) * 0.8) calc(var(--s) * 0.2) rgba(255, 164, 58, 0.9),
    0 0 calc(var(--s) * 4) calc(var(--s) * 1.2) rgba(255, 164, 58, 0.22);
}

.lamp b {
  top: calc(var(--hz) + var(--g));
  width: calc(var(--s) * 0.7);
  height: calc(var(--y) * 1.5);
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(255, 164, 58, 0.55), rgba(255, 164, 58, 0));
  filter: blur(calc(var(--s) * 0.25));
}

.lamp:nth-child(1)  { --x: 46.5%; --y: 1.4%; --g: 0.6%; --s: 3px;  --d: 0.15s; }
.lamp:nth-child(2)  { --x: 43%;   --y: 3%;   --g: 1.4%; --s: 5px;  --d: 0.35s; }
.lamp:nth-child(3)  { --x: 37%;   --y: 6%;   --g: 3%;   --s: 7px;  --d: 0.55s; }
.lamp:nth-child(4)  { --x: 23%;   --y: 12%;  --g: 6%;   --s: 11px; --d: 0.8s;  }
.lamp:nth-child(5)  { --x: 6%;    --y: 21%;  --g: 11%;  --s: 17px; --d: 1.05s; }
.lamp:nth-child(6)  { --x: 53.5%; --y: 1.4%; --g: 0.6%; --s: 3px;  --d: 0.22s; }
.lamp:nth-child(7)  { --x: 57%;   --y: 3%;   --g: 1.4%; --s: 5px;  --d: 0.42s; }
.lamp:nth-child(8)  { --x: 63%;   --y: 6%;   --g: 3%;   --s: 7px;  --d: 0.62s; }
.lamp:nth-child(9)  { --x: 77%;   --y: 12%;  --g: 6%;   --s: 11px; --d: 0.88s; }
.lamp:nth-child(10) { --x: 94%;   --y: 21%;  --g: 11%;  --s: 17px; --d: 1.12s; }

/* Sodium lamps stutter before they settle */
@keyframes lamp-on {
  0%   { opacity: 0; }
  25%  { opacity: 0.85; }
  35%  { opacity: 0.15; }
  55%  { opacity: 1; }
  100% { opacity: 1; }
}

/* ---------- Logo and its reflection ---------- */
.logo {
  position: absolute;
  left: 50%;
  bottom: calc(100% - var(--hz));
  width: var(--logo-w);
  margin: 0;
  translate: -50% 0;
  line-height: 0;
}

.logo-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(92, 200, 255, 0.28));
}

.reflection {
  position: absolute;
  left: 50%;
  top: var(--hz);
  width: var(--logo-w);
  translate: -50% 0;
  line-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 70%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 70%);
  animation: reflect 1.2s 1.25s ease-out both;
}

.reflection img {
  display: block;
  width: 100%;
  height: auto;
  transform: scaleY(-1);
  opacity: 0.42;
  filter: url(#ripple) blur(1.2px);
}

@keyframes reflect {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Intro copy ---------- */
.intro {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

.tagline {
  margin: 0;
  font-size: clamp(1.375rem, 3.4vw, 1.875rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.lead {
  max-width: 34em;
  margin: 0.9em auto 0;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Social links ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.75rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.25rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.social svg { flex: none; display: block; }

.social-text {
  display: grid;
  text-align: left;
  line-height: 1.2;
}

.social-name {
  font-weight: 600;
  text-decoration: underline 2px transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s ease;
}

.social-handle {
  font-size: 0.875rem;
  color: var(--muted);
}

.social:hover .social-name { text-decoration-color: var(--sodium); }

.social:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 4px;
}

/* ---------- Plain link (404) ---------- */
.back {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline 2px var(--sodium);
  text-underline-offset: 4px;
}

.back:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Footer ---------- */
.footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 16px 1.5rem;
  color: var(--faint);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
}

.footer p { margin: 0; }

@media (max-width: 560px) {
  :root { --hz: 66%; }

  .stage {
    flex: none;
    min-height: 0;
    height: clamp(300px, 52svh, 460px);
  }

  .lamp:nth-child(4),
  .lamp:nth-child(9) { display: none; }

  .socials {
    display: grid;
    justify-content: center;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lamp i,
  .lamp b,
  .reflection { animation: none; }
  .social-name { transition: none; }
}
