/* ================= Nav (floats over the lake) ================= */
.site-header { position: fixed; left: 0; right: 0; top: 14px; margin: 0 auto; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-weight: 600;
}
.user-chip img { border-radius: 50%; box-shadow: 0 0 0 2px var(--toxic); }
.chip-logout {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.chip-logout:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* ================= Hero: the lake ================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  /* fallback if WebGL is unavailable */
  background:
    radial-gradient(70% 60% at 30% 70%, rgba(195, 255, 58, 0.22), transparent 60%),
    radial-gradient(60% 50% at 80% 40%, rgba(70, 242, 255, 0.16), transparent 60%),
    var(--deep);
}
.lake {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 8, 6, 0.55) 0%, transparent 22%, transparent 45%, rgba(2, 8, 6, 0.75) 88%, var(--void) 100%);
}

.hero-inner {
  position: relative;
  padding-top: 120px;
  padding-bottom: clamp(64px, 10vh, 110px);
}

.title {
  margin: 0 0 clamp(28px, 5vh, 48px);
  font-family: var(--font-display);
  font-weight: 800;
  /* never wider than the content column: "gewässer" + indent is ~6.3em wide */
  font-size: min(13.2vw, calc((min(100vw, 1180px) - 40px) / 6.7));
  line-height: 0.86;
  letter-spacing: -0.055em;
  color: var(--text);
  text-shadow: 0 2px 40px rgba(2, 8, 6, 0.45);
}
.title-line { display: block; white-space: nowrap; }
.title-line:nth-child(2) { padding-left: 0.32em; }
.title .ch { display: inline-block; will-change: transform, filter, opacity; }

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px 40px;
}
.tagline {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  color: rgba(239, 255, 246, 0.82);
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.setup-hint { grid-column: 1 / -1; margin: 0; text-align: right; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  width: 26px;
  height: 42px;
  border-radius: 14px;
  border: 1.5px solid rgba(239, 255, 246, 0.35);
}
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--toxic);
  animation: cue 2s var(--ease-out) infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ================= Entrance ================= */
.intro { display: none; }
.intro-play .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--void);
  pointer-events: none;
  animation: intro-out 0.9s var(--ease-out) 1.05s forwards;
}
.intro-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #f4ffe0;
  box-shadow: 0 0 20px 6px var(--toxic), 0 0 80px 30px rgba(195, 255, 58, 0.45), 0 0 160px 60px rgba(70, 242, 255, 0.25);
  animation: charge 1.05s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}
.intro-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1ffd6 18%, #d4ff7a 42%, var(--toxic) 70%, #8ff0c8 100%);
  clip-path: circle(0% at 50% 50%);
  animation: flash 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 1s forwards;
}
@keyframes charge {
  0%   { transform: scale(0.2); opacity: 0; }
  25%  { transform: scale(1); opacity: 1; }
  55%  { transform: scale(0.8); }
  99%  { transform: scale(2.4); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes flash {
  from { clip-path: circle(0% at 50% 50%); }
  to   { clip-path: circle(75% at 50% 50%); }
}
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

/* Hero content waits for the flash, then lands */
.intro-play .title .ch {
  opacity: 0;
  transform: translateY(0.45em) scale(1.08);
  filter: blur(14px);
  animation: land 0.9s var(--ease-out) forwards;
  animation-delay: calc(1.25s + var(--i) * 45ms);
}
@keyframes land { to { opacity: 1; transform: none; filter: blur(0); } }

.intro-play .site-header,
.intro-play .hero-bottom,
.intro-play .scroll-cue {
  opacity: 0;
  animation: rise 0.9s var(--ease-out) 1.9s forwards;
}
.intro-play .hero-bottom { animation-delay: 1.75s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ================= Projects ================= */
main.container { padding-top: clamp(72px, 12vh, 120px); padding-bottom: 96px; }

.section-head { margin-bottom: 32px; }
.section-head h2 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
.section-head p { margin: 0; font-size: 1.1rem; }

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(210px, auto);
  gap: 16px;
}
.bento > :first-child:not(.loading) { grid-column: span 2; }

.tile {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
/* light that follows the cursor */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(195, 255, 58, 0.16), rgba(70, 242, 255, 0.06) 40%, transparent 65%);
  transition: opacity 0.3s;
}
a.tile:hover { transform: translateY(-4px); border-color: rgba(195, 255, 58, 0.35); }
a.tile:hover::before { opacity: 1; }
a.tile:focus-visible { outline-offset: 4px; border-radius: var(--r-lg); }

.tile-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(195, 255, 58, 0.22), rgba(70, 242, 255, 0.12));
  border: 1px solid rgba(195, 255, 58, 0.25);
  margin-bottom: auto;
}
.tile-name { margin: 28px 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; }
.tile-desc { margin: 0; padding-right: 52px; color: var(--muted); max-width: 46ch; }
.tile-name { padding-right: 52px; }

.tile-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
}
.tile-badge svg { width: 14px; height: 14px; }
.tile.locked .tile-badge { color: var(--hazard); border-color: rgba(255, 210, 63, 0.35); background: rgba(255, 210, 63, 0.08); }
.tile.locked .tile-icon { filter: saturate(0.4); }

.tile-go {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: background 0.3s var(--ease-out), color 0.3s, transform 0.4s var(--ease-out);
}
.tile-go svg { width: 18px; height: 18px; }
a.tile:hover .tile-go { background: var(--toxic); color: var(--void); border-color: transparent; transform: rotate(-45deg); }

.tile.loading {
  background: linear-gradient(100deg, var(--surface) 30%, rgba(195, 255, 58, 0.06) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ================= Responsive ================= */
@media (max-width: 900px) {
  .hero-bottom { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .setup-hint { text-align: left; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .nav-link { display: none; }
  .user-chip span { display: none; }
  .hero-inner { padding-bottom: 84px; }
  .title-line:nth-child(2) { padding-left: 0; }
  .actions .btn { flex: 1 1 100%; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: minmax(190px, auto); }
  .bento > :first-child:not(.loading) { grid-column: auto; }
}
