:root {
  --bg: #000;
  --fg: #f3f3f3;
  --muted: #c8c8c8;
  --accent-red: #ff2d2d;
  --accent-light: #4ec3ff;
  --accent-blue: #1a1ad6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0.02em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-columns: 100%;
  /* Use dynamic viewport units so iOS / Android URL bars don't crop the footer.
     Older browsers fall back to 100vh via the first declaration. */
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
}

main {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Boxed description popup pinned to the middle of the viewport. */
#service-info {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(22rem, calc(100vw - 1.6rem));
  background: rgba(8, 12, 28, 0.96);
  border: 1px solid rgba(78, 195, 255, 0.5);
  border-radius: 8px;
  padding: 0.95rem 2rem 1.05rem 1.1rem;
  color: var(--fg);
  text-align: left;
  z-index: 100;
  pointer-events: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.85s ease;
}

#service-info.is-hidden {
  opacity: 0;
  pointer-events: none;
}

#service-label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  color: var(--accent-light);
  font-weight: 500;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

#service-close {
  display: block;
  position: absolute;
  top: 0.25rem;
  right: 0.4rem;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  font-family: inherit;
}
#service-close:hover {
  color: #fff;
}

#service-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* let pinch-zoom drive the 3D camera, not the page */
  -webkit-tap-highlight-color: transparent;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.brand--top {
  padding: 2.8rem 1rem 1rem;
  gap: 0.65rem;
}

.name {
  font-size: 1.05rem;
  letter-spacing: 0.2em;
}

.brand--top .name {
  font-size: 1.25rem;
  letter-spacing: 0.22em;
}

.locations {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  color: var(--muted);
}

.brand--top .locations {
  font-size: 0.82rem;
  letter-spacing: 0.34em;
}

.pitch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem 1.4rem;
  text-align: center;
}

.pitch-desc {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.55;
}

.pitch-tag {
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  color: var(--fg);
  font-weight: 500;
  margin-top: 0.1rem;
}

.info {
  font: inherit;
  background: none;
  border: 0;
  padding: 0.4rem 0.2rem;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease;
  margin-top: 0.2rem;
}

.info:hover {
  opacity: 0.6;
}

.meta {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 1.1rem 1rem 1.4rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--fg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#election-label {
  color: var(--muted);
}

@media (max-width: 640px) {
  .brand--top {
    padding: 1.6rem 1rem 0.6rem;
    gap: 0.45rem;
  }
  .brand--top .name {
    font-size: 1.05rem;
    letter-spacing: 0.2em;
  }
  .brand--top .locations {
    font-size: 0.7rem;
    letter-spacing: 0.28em;
  }
  .pitch {
    padding: 0.5rem 1rem 0.9rem;
    gap: 0.5rem;
  }
  .pitch-desc {
    font-size: 0.74rem;
  }
  .pitch-tag {
    font-size: 0.95rem;
  }
  .meta {
    gap: 0.9rem;
    padding: 0.6rem 0.7rem 0.8rem;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    flex-wrap: wrap;
    justify-content: center;
  }
  #election-label,
  #election-countdown {
    white-space: nowrap;
  }
  .name,
  .info {
    font-size: 0.78rem;
  }
  #service-info {
    bottom: 1rem;
    padding: 0.85rem 1rem 0.95rem;
  }
  #service-label {
    font-size: 0.7rem;
  }
  #service-desc {
    font-size: 0.78rem;
    line-height: 1.5;
  }
}

@media (max-height: 720px) and (max-width: 640px) {
  /* On short phone screens give the scene more vertical room. */
  .brand--top {
    padding-top: 1.2rem;
  }
  .pitch {
    padding-bottom: 0.5rem;
  }
}
