/* Welcome page and 404 page: name, one line, the two sections and the social links. One orbit line with a
   moving station is the only decoration. Fonts and colours come from site.css. */

body.home {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 85% 0%, #0d1a2e 0%, transparent 70%),
    var(--bg);
}

/* ---------- Orbit ---------- */

.orbit {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.orbit__line {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.orbit__dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
}
.orbit__dot--still { display: none; }

@media (prefers-reduced-motion: reduce) {
  .orbit__dot--moving { display: none; }
  .orbit__dot--still { display: inline; }
}

/* ---------- Name ---------- */

.home__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(48px, 9vh, 96px);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 12vh, 140px) var(--gutter) 40px;
}

.home__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(64px, 13vw, 168px);
  line-height: 0.86;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.home__intro {
  margin: 22px 0 0;
  font-family: var(--font-read);
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 34ch;
}

/* ---------- Sections ---------- */

.zones {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  max-width: 760px;
}

.zone {
  --zone: var(--accent);
  position: relative;
  display: block;
  padding: 18px 0 18px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.zone--experiments { --zone: var(--term); }
.zone--thoughts { --zone: var(--grow); }

/* A short bar in the section's colour, drawn when you point at or focus the link. */
.zone::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--zone);
  box-shadow: 0 0 10px var(--zone);
  transform: translateY(-50%);
  transition: height 180ms ease;
}

.zone__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1;
  letter-spacing: -0.01em;
  transition: color 180ms ease;
}

.zone:hover,
.zone:focus-visible { color: var(--ink); }
.zone:hover .zone__name,
.zone:focus-visible .zone__name { color: var(--zone); }
.zone:hover::before,
.zone:focus-visible::before { height: 60%; }
.zone:focus-visible { outline-offset: -2px; }

/* ---------- Social links (icons only; the name is in aria-label) ---------- */

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Sit the icons closer to the name and intro line than the page gap would. */
.home__head + .socials {
  margin-top: calc(-1 * clamp(16px, 4vh, 40px));
}

.social {
  --brand: var(--accent);
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.social svg { width: 28px; height: 28px; }
.social--x { --brand: var(--signal); }
.social--github { --brand: var(--grow); }

.social:hover,
.social:focus-visible {
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 14px color-mix(in srgb, var(--brand) 35%, transparent);
}

/* ---------- 404 page (site/404.html) ---------- */

.orbit__line--broken { stroke-dasharray: 2 14; }
.orbit__dot--lost {
  fill: var(--signal);
  filter: drop-shadow(0 0 6px var(--signal));
  animation: lost-blink 2.4s steps(1, end) infinite;
}
@keyframes lost-blink { 50% { opacity: 0.25; } }

.lost__code {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--signal);
}

.lost .home__name { font-size: clamp(56px, 11vw, 140px); }

.lost__actions { margin: 0; }

.lost__home {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.lost__home:hover,
.lost__home:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 560px) {
  .zone { padding: 16px 0 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .zone::before, .zone__name, .social, .lost__home { transition: none; }
  .orbit__dot--lost { animation: none; }
}
