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

:root {
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.08);
  --blue-line: rgba(59, 130, 246, 0.12);
  --blue-line-major: rgba(59, 130, 246, 0.22);
  --blue-text: rgba(59, 130, 246, 0.4);
  --blue-accent: rgba(59, 130, 246, 0.6);
  --bg: #0a0e1a;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: #f0f0f0;
  font-family: 'Manrope', sans-serif;
}

/* ================================
   BLUEPRINT GRID BACKGROUND
================================ */
canvas#grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Vignette */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 14, 26, 0.6) 80%, rgba(10, 14, 26, 0.95) 100%);
}

/* ================================
   CONTENT
================================ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.content {
  text-align: center;
  pointer-events: auto;
  max-width: 680px;
  padding: 0 2rem;
  position: relative;
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Blueprint annotation: measure lines around the title */
.measure-top {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 20px;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.8s forwards;
}

.measure-top::before,
.measure-top::after {
  content: '';
  position: absolute;
  top: 0;
  width: 1px;
  height: 20px;
  background: var(--blue-text);
}

.measure-top::before {
  left: 0;
}

.measure-top::after {
  right: 0;
}

.measure-top span {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--blue-text);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.measure-top .line {
  position: absolute;
  top: 9px;
  left: 1px;
  right: 1px;
  height: 1px;
  background: var(--blue-text);
}

.measure-side {
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 140px;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 2s forwards;
}

.measure-side::before,
.measure-side::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 1px;
  background: var(--blue-text);
}

.measure-side::before {
  top: 0;
}

.measure-side::after {
  bottom: 0;
}

.measure-side span {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--blue-text);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.measure-side .line {
  position: absolute;
  left: 9px;
  top: 1px;
  bottom: 1px;
  width: 1px;
  background: var(--blue-text);
}

.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.55rem, 0.8vw, 0.68rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--blue-accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 0 2px 0 2px;
  margin-bottom: 40px;
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

/* Corner marks on the tag */
.tag::before,
.tag::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--blue-accent);
  border-style: solid;
}

.tag::before {
  top: -2px;
  left: -2px;
  border-width: 1px 0 0 1px;
}

.tag::after {
  bottom: -2px;
  right: -2px;
  border-width: 0 1px 1px 0;
}

.title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 80px;
  font-weight: 700;
  line-height: 80px;
  letter-spacing: -0.04em;
  margin-bottom: 40px;
}

.title .line {
  display: block;
  overflow: hidden;
}

.title .line span {
  display: inline-block;
  transform: translateY(120%);
  animation: charReveal 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.title .line:nth-child(1) span {
  animation-delay: 0.5s;
  color: rgba(255, 255, 255, 0.92);
}

.title .line:nth-child(2) span {
  animation-delay: 0.65s;
  color: rgba(255, 255, 255, 0.92);
}

.title .line:nth-child(3) span {
  animation-delay: 0.8s;
  background: linear-gradient(90deg, #4d8ef7, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 300;
  color: #667ea8;
  line-height: 1.68;
  letter-spacing: 0.02em;
  max-width: 480px;
  margin: 0 auto 40px;
  opacity: 0;
  transform: translateY(15px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.pre-cta {
  font-size: clamp(0.78rem, 1vw, 0.88rem);
  font-weight: 400;
  color: #4a6080;
  line-height: 1.5;
  letter-spacing: 0.02em;
  max-width: 420px;
  margin: 0 auto 20px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.15s forwards;
}

.cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 9px 20px;
  height: 40px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.cta::before,
.cta::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-color: var(--blue-accent);
  border-style: solid;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.cta::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.cta::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}

.cta:hover::before,
.cta:hover::after {
  width: 10px;
  height: 10px;
  opacity: 1;
}

.cta:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  border-radius: 0;
}

.cta-primary {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.cta-primary:hover {
  background: #4d8ef7;
  border-color: #4d8ef7;
  border-radius: 0;
}

.cta-primary::before,
.cta-primary::after {
  border-color: rgba(255, 255, 255, 0.5);
}

.cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ================================
   CORNER ANNOTATIONS
================================ */
.annotation {
  position: fixed;
  z-index: 3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--blue-text);
  opacity: 0;
  animation: fadeIn 0.8s ease-out 2.2s forwards;
}

.a-top-left {
  top: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.a-top-right {
  top: 2rem;
  right: 2rem;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.a-bottom-left {
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.a-bottom-right {
  bottom: 2rem;
  right: 2rem;
  text-align: right;
}

.a-label {
  color: rgba(59, 130, 246, 0.25);
  text-transform: uppercase;
}

.a-value {
  color: rgba(255, 255, 255, 0.2);
}

.crosshair {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 2.5s forwards;
}

/* Origin crosshair — top-left */
.origin {
  top: 2rem;
  left: 2rem;
  width: 0;
  height: 0;
}

.origin::before {
  content: '';
  position: absolute;
  top: 22px;
  left: -0.5px;
  width: 1px;
  height: 14px;
  background: var(--blue-text);
}

.origin::after {
  content: '';
  position: absolute;
  top: 28.5px;
  left: -7px;
  width: 14px;
  height: 1px;
  background: var(--blue-text);
}

/* Coord display that follows mouse */
#coords {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--blue-accent);
  opacity: 0;
  transition: opacity 0.3s;
  transform: translate(12px, -8px);
}

@keyframes charReveal {
  to {
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .annotation {
    display: none;
  }

  .crosshair {
    display: none;
  }

  #coords {
    display: none;
  }

  .title {
    font-size: 48px;
    line-height: 48px;
  }
}

@media (max-width: 500px) {
  .cta-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cta {
    width: 100%;
    justify-content: center;
  }
}
