/* neuhauser.tech
   Layout: one screen. Nebula, star sky and particle network behind,
   a planet rising from the bottom edge, and the terminal title with three
   service links centred in the sky above it. */

/* Font is served from this server (no request to Google). License: fonts/OFL.txt */
@font-face {
  font-family: "VT323";
  src: url("fonts/vt323-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --accent: #ff6600;
  --font: "VT323", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* visible height of the planet; the same formula is used in app.js and planet.js */
  --cap: clamp(80px, 18vh, 200px);
}

html, body { height: 100%; }
html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
}

/* Page load: the screen stays black until the stars, the WebGL planet and the
   font are ready, then everything fades in together. Without this, the plain
   CSS planet and the fallback font flash up for a moment first.
   app.js sets html.ready; the delayed animation is the fallback if scripts
   never run, so the page can never stay black. */
body { opacity: 0; animation: reveal .8s ease 2.5s forwards; }
html.ready body { opacity: 1; animation: none; transition: opacity .7s ease; }
@keyframes reveal { to { opacity: 1; } }

#space {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* faint drifting nebula glow behind the stars */
.nebula {
  position: fixed; inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 40% 30% at 25% 35%, rgba(255, 102, 0, .10), transparent 70%),
    radial-gradient(ellipse 45% 35% at 75% 65%, rgba(80, 90, 255, .11), transparent 70%),
    radial-gradient(ellipse 30% 25% at 60% 20%, rgba(170, 70, 255, .07), transparent 70%);
  filter: blur(20px);
  animation: drift 40s ease-in-out infinite alternate;
  transition: scale 1.2s ease, filter 1.2s ease;
}
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(4%, -3%) rotate(8deg) scale(1.08); }
}
/* while a link is hovered the sky "jumps": nebula swells a little */
.warp .nebula { scale: 1.15; filter: blur(20px) brightness(1.7); }

main {
  position: relative;
  height: 100%;
  display: grid; place-content: center;
  text-align: center;
  /* centre the text in the sky above the planet, not in the whole window */
  padding-block: 2rem calc(var(--cap) + 1rem);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  pointer-events: none;
  user-select: none;
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.8rem, 11vw, 6.5rem);
  line-height: 1;
  letter-spacing: .02em;
  text-shadow: 0 0 24px rgba(0, 0, 0, .9);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }

h1 .tld { color: var(--accent); animation: glow 3s ease-in-out infinite; }
@keyframes glow {
  50% { text-shadow: 0 0 18px var(--accent), 0 0 40px rgba(255, 102, 0, .5); }
}

p {
  margin: 1rem 0 0;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  color: var(--muted);
}
p .prompt { color: var(--accent); }

.cursor {
  display: inline-block; width: .5em; height: 1em;
  background: var(--accent);
  vertical-align: -.15em; margin-left: .15em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

nav {
  margin-top: 2.5rem;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .75rem 1.5rem;
  pointer-events: auto;
}
nav a {
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
  color: var(--fg);
  text-decoration: none;
  padding: .1em .3em;
  border-radius: 3px;
  transition: color .2s, text-shadow .2s, background .2s;
}
nav a::before { content: "["; color: var(--accent); margin-right: .25em; }
nav a::after  { content: "]"; color: var(--accent); margin-left: .25em; }
nav a:hover, nav a:focus-visible {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(255, 102, 0, .7);
  background: rgba(255, 102, 0, .08);
  outline: none;
}
nav a:focus-visible { box-shadow: 0 0 0 1px var(--accent); }

/* Planet: a huge dark disc whose top edge rises from the bottom of the page,
   with a thin orange atmosphere glowing along its rim. Sits in front of the
   sky (hides stars and network behind it) and behind the text. */
.planet {
  --d: max(200vw, 1600px);           /* diameter */
  position: fixed;
  left: 50%;
  top: calc(100% - var(--cap));
  width: var(--d);
  height: var(--d);
  translate: -50% 0;
  border-radius: 50%;
  pointer-events: none;
  background-color: #040307;
  background-image:
    radial-gradient(ellipse 45% 180px at 50% 0%, rgba(255, 120, 50, .10), transparent 100%),
    radial-gradient(ellipse 70% 420px at 30% 0%, rgba(120, 110, 255, .05), transparent 100%);
  box-shadow:
    0 0 24px 1px rgba(255, 102, 0, .50),
    0 0 90px 16px rgba(255, 102, 0, .18),
    0 0 240px 60px rgba(255, 80, 0, .07),
    inset 0 12px 26px -10px rgba(255, 150, 80, .60),
    inset 0 40px 90px -40px rgba(255, 102, 0, .25);
}

/* Detailed planet drawn with WebGL (planet.js). Its height is set by the
   script. Once it renders, the plain CSS planet above is hidden. */
#planet-gl {
  position: fixed;
  left: 0; bottom: 0;
  width: 100%;
  height: 0;
  display: block;
  pointer-events: none;
}
.gl-planet .planet { display: none; }

/* very flat screens (phone held sideways): tighter spacing so everything fits */
@media (max-height: 440px) {
  p   { margin-top: .5rem; }
  nav { margin-top: 1.25rem; }
}
