/* ===========================
   TOKENS
=========================== */
:root {
  --bg:      #F7F6F1;
  --ink:     #1A1A18;
  --muted:   #8A8A84;
  --accent:  #2A5741;
  --frosted: rgba(247, 246, 241, 0.88);

  --font-pixel: 'Press Start 2P', monospace;
  --font-mono:  'Space Mono', monospace;
}

/* ===========================
   RESET
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

a      { color: inherit; text-decoration: none; }
button { cursor: pointer; }
ul     { list-style: none; }

/* ===========================
   GRID CANVAS
=========================== */
#grid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#bloom-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ===========================
   NAV — stacked top-right
=========================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 26px 44px;
}

.nav-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.nav-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  letter-spacing: 0.08em;
  padding: 0;
  transition: color 0.15s;
  line-height: 1;
}
.nav-btn:hover { color: var(--accent); }

/* ===========================
   VIEWPORT + SCENE
=========================== */
.viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================
   TEXT CONTAINER + WORDS
=========================== */
.text-container {
  position: absolute;
  max-width: 620px;
  width: calc(100% - 80px);
  height: 72vh;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.word {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  /* no transform transition — JS lerp handles smoothness */
  transition: opacity 0.5s ease;
  will-change: transform, opacity;
  user-select: none;
  pointer-events: none;
}

/* ===========================
   SHARED OVERLAY BASE
=========================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px) saturate(0.55);
  -webkit-backdrop-filter: blur(20px) saturate(0.55);
  background-color: var(--frosted);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

.overlay-inner {
  position: relative;
  width: 100%;
  max-width: 640px;
  padding: 72px 48px 60px;
}

/* Close button — fixed top-right (same corner as nav buttons) */
.overlay-close {
  position: fixed;
  top: 26px;
  right: 44px;
  font-family: var(--font-mono);
  font-size: 16px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.15s;
  z-index: 101;
}
.overlay-close:hover { color: var(--accent); }

/* Back button — top left */
.overlay-back {
  position: absolute;
  top: 28px;
  left: 32px;
  font-family: var(--font-pixel);
  font-size: 8px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: color 0.15s;
  padding: 6px;
  line-height: 1;
}
.overlay-back:hover { color: var(--accent); }

/* ===========================
   PRODUCTS LIST
=========================== */
.item-list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(42, 87, 65, 0.12);
  color: var(--ink);
  transition: color 0.15s;
}
.list-item:hover { color: var(--accent); }
.item-list li:last-child .list-item { border-bottom: none; }

.li-num {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.14em;
  min-width: 28px;
  flex-shrink: 0;
}

.li-name {
  font-family: var(--font-mono);
  font-size: 20px;
  flex: 1;
}

.li-arrow {
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ===========================
   TEAM LIST
=========================== */
.team-list {
  display: flex;
  flex-direction: column;
}

.team-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid rgba(42, 87, 65, 0.12);
}
.team-item:last-child { border-bottom: none; }

.t-name {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.t-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.t-icon {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.t-icon:hover { color: var(--accent); }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .nav           { padding: 18px 20px; }
  .nav-right     { gap: 8px; }
  .nav-btn       { font-size: 10px; }
  .overlay-close { top: 18px; right: 20px; }

  .text-container {
    width: calc(100% - 40px);
    height: 84vh;
    max-width: 100%;
  }

  /* Smaller font so the paragraph fits on narrow screens */
  .word { font-size: 13px; }

  .overlay-inner { padding: 64px 24px 48px; max-width: 100%; }

  .li-name { font-size: 17px; }
  .t-name  { font-size: 18px; }
}

@media (max-width: 480px) {
  .nav-right      { gap: 6px; }
  .nav-btn        { font-size: 9px; }

  .text-container { height: 88vh; }
  .word           { font-size: 12px; }

  .li-name { font-size: 15px; }
  .t-name  { font-size: 16px; }
}
