:root {
  --night: #07140c;
  --soil: #0b1d12;
  --moss: #1f6b3a;
  --fern: #3fa34d;
  --grass: #7bd35a;
  --lime: #c6f26b;
  --sun: #f2e96b;
  --mist: #cfe9c4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  background: var(--night); /* fills overscroll / browser-bar / safe-area gaps on mobile */
  color-scheme: dark;
}
body {
  min-height: 100%;
  height: 100vh;
  height: 100dvh;
}

body {
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(ellipse at 70% 10%, rgba(198, 242, 107, .16), transparent 55%),
    radial-gradient(ellipse at 20% 100%, rgba(63, 163, 77, .25), transparent 60%),
    linear-gradient(180deg, var(--night), var(--soil));
  color: var(--mist);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- code in the soil ---------- */
.code-bg {
  position: fixed;
  inset: 0;
  padding: 1.2rem;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fern);
  opacity: .14;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 30%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 85%);
}
.code-bg .k { color: var(--lime); }
.code-bg .c { color: var(--moss); }

/* ---------- the big title ---------- */
.stage {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 2vw;
}

.title {
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.05em;
  white-space: nowrap;
  /* font-size is fitted to the viewport width by main.js */
  font-size: 11vw;
  --mx: -999px;
  --my: 50%;
  --tx: 0px;
  --ty: 0px;
  background:
    /* light that follows the pointer (or drifts by itself) */
    radial-gradient(circle 16vw at var(--mx) var(--my), #fff 0%, rgba(240, 255, 190, .85) 25%, transparent 100%),
    /* tiny "pixels" of light, like sun through leaves */
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .35) 0 2px, transparent 3px) 0 0 / 38px 38px,
    linear-gradient(100deg, var(--moss) 0%, var(--fern) 20%, var(--grass) 40%, var(--lime) 60%, var(--sun) 75%, var(--grass) 90%, var(--moss) 100%);
  background-size: 100% 100%, 38px 38px, 300% 100%;
  background-repeat: no-repeat, repeat, repeat;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  filter: drop-shadow(0 .02em .08em rgba(123, 211, 90, .35));
  transform: translate(var(--tx), var(--ty));
  animation: flow 8s ease-in-out infinite alternate, grow-in 1.6s cubic-bezier(.2, .8, .2, 1) both, breathe 6s ease-in-out infinite;
}

/* gradient drifts across the letters like wind over a field */
@keyframes flow {
  from { background-position: 0 0, 0 0, 0% 0; }
  to   { background-position: 0 0, 0 0, 100% 0; }
}
/* revealed from the ground up */
@keyframes grow-in {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(-20% -5% -20% -5%); }
}
/* slow breathing on the glow */
@keyframes breathe {
  50% { filter: drop-shadow(0 .03em .16em rgba(198, 242, 107, .6)); }
}

/* dots: plain inline, no own layer, otherwise background-clip:text breaks */
.dot {
  -webkit-text-fill-color: var(--sun);
  animation: pulse 2.4s ease-in-out infinite;
}
.dot:nth-of-type(4) { animation-delay: 1.2s; }
@keyframes pulse {
  50% { -webkit-text-fill-color: var(--lime); }
}

.tagline {
  margin-top: 2.2vh;
  font-size: clamp(.8rem, 1.6vw, 1.3rem);
  color: var(--mist);
  opacity: .85;
  min-height: 1.5em;
  text-align: center;
}
.prompt { color: var(--lime); }
.cursor {
  display: inline-block;
  width: .6ch;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--grass);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- grass ---------- */
.grass {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 28vh;
  z-index: 3;
  pointer-events: none;
}
.blade {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: wind var(--d, 4s) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes wind {
  from { transform: rotate(calc(var(--a, 4deg) * -1)); }
  to   { transform: rotate(var(--a, 4deg)); }
}
/* some blades are secretly brackets / tags */
.glyph {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  fill: var(--lime);
  opacity: .8;
}

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