/* Landing page of Flying Microwave (plan 0006). Visual first, little text
   (D-5). Nothing is loaded from other sites and no script runs (N-02). */

:root {
  color-scheme: dark;
  --ink: #f4f6fb;
  --muted: #8a93ad;
  --glow: #f2a541;
  --sky-top: #060812;
  --sky-bottom: #141a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--sky-top);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* The night sky: two layers of small stars over a dark gradient. */
.sky {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(1px 1px at 20px 30px, rgba(207, 216, 255, 0.7), transparent),
    radial-gradient(1px 1px at 140px 90px, rgba(207, 216, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 90px 160px, rgba(207, 216, 255, 0.6), transparent),
    radial-gradient(1px 1px at 230px 210px, rgba(207, 216, 255, 0.45), transparent),
    linear-gradient(135deg, var(--sky-top), var(--sky-bottom));
  background-size: 260px 260px, 260px 260px, 260px 260px, 260px 260px, 100% 100%;
}

.bar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

/* A dark backing keeps the links readable when a microwave flies behind
   them (review of plan 0006, M-1). */
.bar a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(6, 8, 18, 0.72);
  color: #aab3cb;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}

.bar a:hover,
.bar a:focus-visible {
  color: var(--ink);
}

/* The GitHub mark is the official one, white on the dark page and never
   recolored here (plan 0006, D-6). It has no backing shape, and shows focus
   with an outline around it only. */
.bar .gh {
  padding: 0.3rem;
  background: none;
}

.bar .gh:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 2px;
}

.bar svg {
  display: block;
  width: 26px;
  height: 26px;
}

/* The microwaves fly from the upper right to the lower left, behind the
   title. Each one has its own size, speed and start (custom properties). */
.flock {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.f {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--w);
  opacity: var(--o, 1);
  animation: fly var(--t) linear infinite;
  animation-delay: var(--d);
  will-change: transform;
}

/* Every one flies along a parallel line; --x sets which line, so the lines
   are spread over the whole screen (from 30vw to 150vw at the top). */
@keyframes fly {
  from {
    transform: translate(var(--x), -40vh) rotate(var(--r));
  }
  to {
    transform: translate(calc(var(--x) - 150vw), 120vh) rotate(calc(var(--r) * -1));
  }
}

/* --sx and --sy: where each one stays when motion is reduced. */
/* The delays put each one part way along its line, so that several are on
   the screen when the page opens (a line is on screen for about a quarter
   to five eighths of its time; the top is reached at a quarter). */
.f1 { --w: clamp(150px, 22vw, 260px); --t: 28s; --d: -10s; --x: 120vw; --r: -8deg; --sx: 66vw; --sy: 6vh; }
.f2 { --w: clamp(110px, 15vw, 180px); --t: 36s; --d: -13s; --x: 75vw; --r: 10deg; --o: 0.9; --sx: 6vw; --sy: 64vh; }
.f3 { --w: clamp(80px, 10vw, 120px); --t: 46s; --d: -25s; --x: 150vw; --r: -14deg; --o: 0.75; --sx: 82vw; --sy: 66vh; }
.f4 { --w: clamp(60px, 7vw, 90px); --t: 56s; --d: -39s; --x: 135vw; --r: 6deg; --o: 0.6; --sx: 14vw; --sy: 12vh; }
.f5 { --w: clamp(120px, 17vw, 200px); --t: 32s; --d: -14s; --x: 90vw; --r: 12deg; --o: 0.95; --sx: 44vw; --sy: 74vh; }

/* The food flies with them, about as large as the smallest microwave
   (plan 0006, D-8). It is not shown when motion is reduced (below). */
.f6 { --w: clamp(42px, 5vw, 64px); --t: 44s; --d: -20s; --x: 105vw; --r: -18deg; --o: 0.85; }
.f7 { --w: clamp(60px, 7vw, 88px); --t: 50s; --d: -16s; --x: 60vw; --r: 14deg; --o: 0.8; }
.f8 { --w: clamp(44px, 5vw, 64px); --t: 40s; --d: -22s; --x: 140vw; --r: 0deg; --o: 0.95; }
.f9 { --w: clamp(44px, 5vw, 64px); --t: 54s; --d: -33s; --x: 120vw; --r: 0deg; --o: 0.95; }

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 4rem 1.5rem;
  text-align: center;
  /* A soft shade behind the text, so a microwave flying behind it does not
     make it hard to read (review of plan 0006, M-1). */
  background: radial-gradient(ellipse 46rem 17rem at 50% 50%, rgba(6, 8, 18, 0.78), rgba(6, 8, 18, 0) 100%);
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 24px rgba(6, 8, 18, 0.8);
}

.tag {
  margin: 0.9rem 0 0;
  color: #b9c2d9;
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  text-shadow: 0 1px 12px rgba(6, 8, 18, 0.9);
}

.dl {
  display: inline-block;
  margin-top: 2.2rem;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  background: var(--glow);
  color: #1d1305;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 6px 28px rgba(242, 165, 65, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dl:hover,
.dl:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(242, 165, 65, 0.5);
}

.req {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Everything else is small and quiet (D-5). */
footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.8;
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

footer li {
  padding: 0.25rem 0.8rem;
  border: 1px solid rgba(138, 147, 173, 0.35);
  border-radius: 999px;
}

footer p {
  margin: 0 0 0.6rem;
}

code {
  font-family: ui-monospace, Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) {
  .f {
    animation: none;
    transform: translate(var(--sx), var(--sy)) rotate(var(--r));
  }

  /* Only the five microwaves stay still (plan 0006, D-8 (2)). */
  .food {
    display: none;
  }

  .dl {
    transition: none;
  }
}

/* On a narrow screen the text fills the middle, so the still microwaves
   keep to the bands above and below it. */
@media (prefers-reduced-motion: reduce) and (max-width: 600px) {
  .f1 { --sx: 52vw; --sy: 11vh; }
  .f2 { --sx: 4vw; --sy: 80vh; }
  .f3 { --sx: 70vw; --sy: 84vh; }
  .f4 { --sx: 8vw; --sy: 13vh; }
  .f5 { --sx: 30vw; --sy: 80vh; }
}

/* On a low screen (a low window, a phone on its side) the text fills the
   height, so the still microwaves are made small and kept to the left and
   right edges (re-review of plan 0006, L-1; the maintainer chose this). */
/* Why left and right in percent: vw includes a scroll bar where one takes
   room, and the text is centred without it, so the edges are measured in
   the width of the page instead (review of the D-7 change, M-1). */
@media (prefers-reduced-motion: reduce) and (max-height: 720px) and (min-width: 601px) {
  .f { --w: clamp(48px, 8vw, 104px); --sx: 0px; }
  .f2, .f4, .f5 { left: 2%; }
  .f1, .f3 { left: auto; right: 2%; }
  .f1 { --sy: 22vh; }
  .f2 { --sy: 58vh; }
  .f3 { --sy: 66vh; }
  .f4 { --sy: 12vh; }
  .f5 { --sy: 82vh; }
}
