/* Baseline styles. Deliberately minimal; the real design comes later. */

:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --fg: #111;
  --muted: #666;
  --accent: #111;
  --max-width: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --fg: #f2f2f2;
    --muted: #999;
    --accent: #f2f2f2;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--fg);
  color: var(--bg);
}
.skip-link:focus { left: 0.5rem; }

.site-header,
.site-main,
.site-footer {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 1rem 1.25rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-main { flex: 1; }

.hero { padding-block: 4rem 2rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 4rem); margin: 0 0 0.5rem; }

.site-footer {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Homepage: full-screen 3D wireframe scene, nothing else. */

body.home {
  display: block;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #39ff14;
}

.layer {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Stacking: far produce (behind the planet), orbit, dust, text, near produce, then the contact link. */
.layer-veg-back { z-index: 0; pointer-events: none; }
.layer-orbit { z-index: 1; pointer-events: none; }
.layer-dust { z-index: 2; pointer-events: none; }
.scene { z-index: 3; }
.layer-veg-front { z-index: 4; pointer-events: none; }
.scene-fallback { z-index: 3; }
.contact { z-index: 5; }

/* Without WebGL the canvas is removed and this faint limb stands in. */
.layer-orbit.is-fallback {
  background:
    radial-gradient(ellipse 140% 70% at 50% 118%, rgba(40, 70, 120, 0.45) 0%, rgba(10, 18, 36, 0.6) 40%, #000 62%);
}

.layer-orbit canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-fallback[hidden] {
  display: none;
}

.scene-fallback {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(1.25rem, 5vw, 4rem);
  letter-spacing: 0.1em;
}

.contact {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(78% + 60px);
  margin: 0;
  padding: 0 1rem;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp(1rem, 1.9vw, 1.25rem);
  letter-spacing: 0.04em;
}

.contact a {
  color: #fff;
  opacity: 0.4;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.contact a:hover,
.contact a:focus-visible {
  opacity: 0.9;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.contact-sep {
  color: #fff;
  opacity: 0.25;
  margin: 0 0.5em;
}

/* Narrow viewports: stack the links, no separator. */
@media (max-width: 768px) {
  .contact a {
    display: block;
    margin-top: 0.6em;
  }

  .contact-sep {
    display: none;
  }
}
