/* Home page: dark, pastel accents, 16-bit-ish pixel art.
   Sprites and the cluster diagram are drawn by /js/pixels.js, the background by /js/cluster-bg.js. */
.home {
  --bg: #1c1a2b;
  --bg-glow: #2a2540;
  --ink: #efe8fb;          /* text */
  --dim: #9d93b5;
  --px-ink: #0f0d18;       /* sprite outlines and pixel borders */
  --on-pastel: #241f36;
  --screen: #241f36;
  --node: #2f2b45;         /* node bodies in the cluster diagram */
  --slot: #221f33;         /* empty pod slots */
  --grid: #3a3554;         /* background edges and idle nodes */
  --pink: #ffc8dc;
  --pink-deep: #f59bbb;
  --lav: #d6c6ff;
  --mint: #c3f1d6;
  --mint-deep: #7fd9a8;
  --sky: #c2e2ff;
  --butter: #fff0a6;
  --peach: #ffd5b5;
  --peach-deep: #f2b48a;
  --cloud: #f4eeff;
  --cloud-shade: #c9bfe6;
  --shadow: rgba(0, 0, 0, 0.5);
  --hl: rgba(195, 241, 214, 0.26);
  --px: 3px;               /* one "pixel" of UI chrome */
  --pixel-font: 'Jersey 20', ui-monospace, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
  min-height: 100svh;
  background: radial-gradient(120% 80% at 80% 0%, var(--bg-glow), transparent 60%), var(--bg);
  color: var(--ink);
  font-family: var(--font-space-grotesk);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---------- background cluster ---------- */
#cluster {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
  opacity: .6;
  /* calmer behind the text on the left */
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.3) 25%, #000 80%);
  mask-image: linear-gradient(100deg, rgba(0,0,0,.3) 25%, #000 80%);
}

/* ---------- pixel frame ---------- */
/* Four hard shadows give a border with notched corners, like a console window. */
.top nav a {
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--px-ink),
    0 var(--px) 0 0 var(--px-ink),
    calc(var(--px) * -1) 0 0 0 var(--px-ink),
    var(--px) 0 0 0 var(--px-ink);
}

/* ---------- header ---------- */
.top {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px clamp(20px, 6vw, 72px);
  font-family: var(--pixel-font);
  font-size: 26px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo svg { width: 27px; }
.top nav { display: flex; gap: 20px; }
.top nav a {
  background: var(--butter); color: var(--on-pastel);
  padding: 2px 16px; margin: var(--px);
  line-height: 1.3;
  transition: transform .12s steps(2);
}
.top nav a:hover { transform: translateY(-3px); }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 1;
  padding: clamp(24px, 7vh, 88px) clamp(20px, 6vw, 72px) 32px;
  max-width: 1100px;
}
.hello {
  font-family: var(--pixel-font);
  font-size: clamp(24px, 2.6vw, 30px);
  color: var(--dim);
  animation: rise .8s var(--ease-out) both;
}
.hello span { background: var(--pink); color: var(--on-pastel); padding: 0 8px; }
.cursor {
  display: inline-block; width: .5em; height: .9em; margin-left: 6px;
  vertical-align: -0.08em; background: var(--pink-deep);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-family: var(--pixel-font);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 120px);
  line-height: .92;
  margin: 12px 0 28px;
}
/* Each line glides up out of its own mask; the second follows a beat later. */
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.hero h1 .line > span { display: block; animation: reveal 1.1s .1s var(--ease-out) both; }
.hero h1 .line + .line > span { animation-delay: .22s; }
@keyframes reveal {
  from { transform: translateY(110%); opacity: 0; }
  40% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
.hero h1 em { font-style: normal; color: var(--sky); }
.diagram {
  display: block; width: min(100%, 600px); height: auto;
  margin: 8px 0 32px;
  shape-rendering: crispEdges;
  animation: rise 1s .45s var(--ease-out) both;
}
.description {
  max-width: 38ch;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  line-height: 1.55;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
  animation: rise 1s .6s var(--ease-out) both;
}
.description a { color: var(--ink); box-shadow: inset 0 -0.38em 0 var(--hl); transition: box-shadow .15s steps(3); }
.description a:hover { box-shadow: inset 0 -1.4em 0 var(--hl); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- tiles ---------- */
.tiles {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  padding: 24px clamp(24px, 6vw, 76px) 56px;
  max-width: 1100px;
}
.tile {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
  padding: 16px 20px;
  color: var(--on-pastel);
  --drop: 7px;
  /* pixel border plus a hard drop shadow, offset like a console button */
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--px-ink),
    0 var(--px) 0 0 var(--px-ink),
    calc(var(--px) * -1) 0 0 0 var(--px-ink),
    var(--px) 0 0 0 var(--px-ink),
    calc(var(--drop) + var(--px)) calc(var(--drop) + var(--px)) 0 0 var(--shadow);
  transition: transform .15s steps(3), box-shadow .15s steps(3);
  animation: rise .9s .75s var(--ease-out) both;
}
.tile[hidden] { display: none; }
.tile:hover { transform: translate(-3px, -3px); --drop: 10px; }
.tile:active { transform: translate(4px, 4px); --drop: 1px; }
.tile svg { grid-row: span 2; width: 48px; }
.tile b { font-family: var(--pixel-font); font-size: 32px; font-weight: 400; line-height: 1; }
.tile small { font-size: 14px; opacity: .78; }
.pink { background: var(--pink); }
.lav { background: var(--lav); }
.mint { background: var(--mint); }
.sky-tile { background: var(--sky); }

.foot {
  position: relative; z-index: 1;
  margin-top: auto;
  padding: 24px clamp(20px, 6vw, 72px);
  font-family: var(--pixel-font);
  font-size: 20px;
  color: var(--dim);
}
.foot i { font-style: normal; color: var(--mint-deep); }

/* svg sprites stay crisp at any size */
.home svg[data-sprite] { height: auto; shape-rendering: crispEdges; display: block; }

@media (max-width: 600px) {
  .top { font-size: 22px; }
  .tiles { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .home *, .home *::after { animation: none !important; transition: none !important; }
}
