:root {
  --ink: #070f1c;
  --navy: #0a1626;
  --gold: #e9c98f;
  --text: #ece4d6;
  --muted: #8e9ab0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--navy); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(70rem 34rem at 50% 108%, rgba(233, 167, 92, .13), transparent 70%),
    radial-gradient(80rem 46rem at 50% 105%, rgba(42, 111, 214, .30), transparent 70%),
    linear-gradient(180deg, var(--ink), var(--navy) 62%);
  background-color: var(--navy);
  isolation: isolate;
}

img { display: block; max-width: 100%; height: auto; }

a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: .25rem; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem 1rem;
}

.logo { position: relative; margin: 0; width: min(34rem, 88vw, 58vh); }

.tagline {
  margin: clamp(1rem, 3vh, 1.75rem) 0 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
}

.status {
  margin: 1rem 0 0;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}

.social {
  list-style: none;
  margin: clamp(1.75rem, 5vh, 2.75rem) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem;
  max-width: 28rem;
}
.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--muted);
  transition: color .2s ease, transform .2s ease;
}
.social a:hover,
.social a:focus-visible { color: var(--gold); transform: translateY(-3px); }
.social svg { display: block; }

footer {
  padding: 1.25rem 1.25rem 1.75rem;
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
}
footer p { margin: 0; }

/* 404 */
.nf { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 1.25rem; text-align: center; padding: 2rem 1.25rem; }
.nf img { width: min(18rem, 80vw); }
.nf h1 { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; }
.nf a { color: var(--gold); }

/* Motion. Everything below animates opacity/transform only, and only for users who have not asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Intro: logo, then tagline, then status and icons. ~1.8s in total. */
  @keyframes rise {
    from { opacity: 0; transform: translate3d(0, 12px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  .logo, .tagline, .status, .social {
    animation: rise .8s cubic-bezier(.22, .61, .36, 1) both;
  }
  .tagline { animation-delay: .4s; }
  .status  { animation-delay: .9s; }
  .social  { animation-delay: 1s; }

  /* Living emblem: a warm glow centred on the logo's star (50% / 48% of the image box),
     sized relative to the image so it follows responsive scaling. One soft pulse per 12s. */
  .logo::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 48.2%;
    width: 34%;
    aspect-ratio: 1;
    margin: -17% 0 0 -17%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 214, 140, .55) 0%, rgba(255, 190, 100, .22) 35%, transparent 68%);
    opacity: 0;
    pointer-events: none;
    will-change: opacity, transform;
    animation: breathe 12s ease-in-out 3s infinite;
  }
  @keyframes breathe {
    0%, 100% { opacity: 0; transform: scale(.9); }
    45%      { opacity: .65; transform: scale(1.06); }
  }

  /* Living dawn: two fixed light layers that drift in and out of the existing gradient. */
  body::before,
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    will-change: opacity, transform;
  }
  body::before {
    background: radial-gradient(60rem 36rem at 30% 105%, rgba(60, 130, 235, .30), transparent 70%);
    animation: dawn-blue 26s ease-in-out infinite alternate;
  }
  body::after {
    background: radial-gradient(50rem 28rem at 72% 108%, rgba(240, 175, 95, .20), transparent 70%);
    animation: dawn-gold 30s ease-in-out -8s infinite alternate;
  }
  @keyframes dawn-blue {
    from { opacity: 0;  transform: translate3d(-3%, 0, 0); }
    to   { opacity: .9; transform: translate3d(3%, 0, 0); }
  }
  @keyframes dawn-gold {
    from { opacity: .8; transform: translate3d(3%, 0, 0); }
    to   { opacity: 0;  transform: translate3d(-3%, 0, 0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .social a { transition: none; }
  .social a:hover, .social a:focus-visible { transform: none; }
}

@media (max-width: 520px) {
  .social { max-width: 15.5rem; } /* wraps 5 + 4 instead of leaving a lone icon */
}
