:root {
  --nav-h: 80px;
}

#ambient-tile-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(var(--ambient-columns, 40), minmax(0, 1fr));
  grid-template-rows: repeat(var(--ambient-rows, 24), minmax(0, 1fr));
  gap: 1px;
  pointer-events: none;
  perspective: 1200px;
  transform-style: preserve-3d;
  opacity: 0.76;
  contain: layout paint style;
}

#ambient-tile-field::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(12, 19, 36, 0.16), rgba(12, 19, 36, 0.82));
  pointer-events: none;
}

.ambient-tile {
  position: relative;
  z-index: 0;
  min-width: 0;
  min-height: 0;
  background: hsla(var(--tile-hue, 185), 100%, 55%, var(--tile-alpha, 0.026));
  border: 1px solid hsla(var(--tile-hue, 185), 100%, 82%, var(--tile-border, 0.045));
  opacity: var(--tile-opacity, 0.54);
  box-shadow:
    0 0 calc(var(--tile-glow, 0) * 1px) hsla(var(--tile-hue, 185), 100%, 62%, 0.22),
    inset 0 0 calc(var(--tile-inner-glow, 0) * 1px) hsla(var(--tile-hue, 185), 100%, 78%, 0.12);
  transform:
    translateZ(var(--tile-z, 0px))
    rotateX(var(--tile-rx, 0deg))
    rotateY(var(--tile-ry, 0deg));
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 260ms ease,
    border-color 260ms ease,
    opacity 260ms ease,
    box-shadow 260ms ease;
}

.ambient-tile.is-near {
  border-color: hsla(var(--tile-hue, 185), 100%, 78%, var(--tile-border, 0.28));
  will-change: transform;
}

.sc-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: var(--nav-h);
  min-height: var(--nav-h);
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(12, 19, 36, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

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

.sc-nav-inner {
  width: 100%;
  max-width: 1440px;
  height: var(--nav-h);
  min-height: var(--nav-h);
  margin-inline: auto;
  padding-inline: clamp(20px, 4.45vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.sc-brand {
  font-family: 'Geist', sans-serif;
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: 0;
  color: #dbfcff;
  text-decoration: none;
  white-space: nowrap;
}

.sc-nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.sc-nav-link {
  color: rgba(219, 252, 255, 0.68);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  font-weight: 500;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.sc-nav-link:hover,
.sc-nav-link.active {
  color: #dbfcff;
}

.sc-nav-link.active {
  border-bottom-color: #dbfcff;
}

.sc-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(219, 252, 255, 0.08);
  background: rgba(7, 13, 31, 0.86);
}

.sc-footer-inner {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: rgba(219, 252, 255, 0.46);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sc-footer-brand {
  font-family: 'Geist', sans-serif;
  color: #dbfcff;
  font-size: 22px;
}

.sc-footer-ack {
  font-size: clamp(7px, 1.8vw, 11px);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: none;
}

.sc-footer-ack-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.sc-footer-ack a {
  color: #71f8e4;
  transition: color 0.2s ease;
}

.sc-footer-ack a:hover {
  color: #dbfcff;
}

@media (max-width: 760px) {
  #ambient-tile-field {
    gap: 1px;
  }

  .sc-nav-menu {
    display: none;
  }

  .sc-brand {
    font-size: 28px;
    line-height: 36px;
  }

  .sc-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
