:root {
  --ink: #07161c;
  --ink-soft: #14303a;
  --foam: #f3f7f4;
  --foam-muted: rgba(243, 247, 244, 0.72);
  --foam-faint: rgba(243, 247, 244, 0.48);
  --signal: #3dffc0;
  --signal-deep: #12b88a;
  --atlantic: #0b4f5c;
  --horizon: #1a7a6d;
  --sand: #d8c4a0;
  --max: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foam);
  background: var(--ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #9bffe0;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 70% 10%, rgba(26, 122, 109, 0.45), transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(11, 79, 92, 0.55), transparent 50%),
    linear-gradient(165deg, #041015 0%, #0a2430 42%, #07161c 100%);
}

.radar-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(61, 255, 192, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 255, 192, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 72% 18%, black 0%, transparent 58%);
  animation: grid-drift 28s linear infinite;
}

.radar-sweep {
  position: absolute;
  top: -12%;
  right: -8%;
  width: min(72vw, 44rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    transparent 0deg,
    rgba(61, 255, 192, 0.18) 28deg,
    transparent 70deg
  );
  border: 1px solid rgba(61, 255, 192, 0.12);
  box-shadow: inset 0 0 0 1px rgba(61, 255, 192, 0.05);
  animation: sweep 7.5s linear infinite;
  opacity: 0.85;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.glow-a {
  width: 28rem;
  height: 28rem;
  top: -8rem;
  right: -4rem;
  background: rgba(18, 184, 138, 0.22);
  animation: pulse 6s ease-in-out infinite;
}

.glow-b {
  width: 22rem;
  height: 22rem;
  bottom: 10%;
  left: -6rem;
  background: rgba(11, 79, 92, 0.4);
}

.top,
main,
footer {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--foam-faint);
  animation: rise 0.9s var(--ease) both;
}

.hero {
  min-height: calc(100svh - 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0 5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sand);
  animation: rise 0.9s var(--ease) 0.08s both;
}

.brand {
  display: flex;
  flex-direction: column;
  margin: 0;
  max-width: 100%;
  font-family: Syne, "Instrument Sans", sans-serif;
  font-size: clamp(3.5rem, 14vw, 7.5rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.045em;
  color: var(--foam);
  animation: rise 1s var(--ease) 0.16s both;
}

.brand span {
  display: block;
}

.lede {
  margin: 1.5rem 0 0;
  max-width: 22rem;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--foam-muted);
  animation: rise 1s var(--ease) 0.28s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.25rem;
  animation: rise 1s var(--ease) 0.4s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--signal);
  color: var(--ink);
}

.btn-primary:hover {
  background: #9bffe0;
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(243, 247, 244, 0.28);
  color: var(--foam);
}

.btn-ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.thesis,
.demo,
.document {
  padding: 4.5rem 0 0;
}

.thesis h2,
.demo h2,
.document h2 {
  margin: 0 0 1rem;
  font-family: Syne, "Instrument Sans", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.thesis p,
.demo p {
  margin: 0;
  max-width: 42rem;
  color: var(--foam-muted);
}

.loop {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.35rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  font-family: Syne, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}

.loop li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.loop li:not(:last-child)::after {
  content: "→";
  color: var(--foam-faint);
  font-weight: 500;
}

.demo {
  border-top: 1px solid rgba(243, 247, 244, 0.1);
  margin-top: 4.5rem;
  padding-top: 4.5rem;
}

.document {
  margin-top: 4.5rem;
  padding-bottom: 5rem;
}

.document-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.document-head p {
  margin: 0.4rem 0 0;
  color: var(--foam-faint);
  font-size: 0.95rem;
}

.viewer {
  overflow: hidden;
  border: 1px solid rgba(243, 247, 244, 0.14);
  border-radius: 0.5rem;
  background: rgba(7, 22, 28, 0.65);
  height: min(78vh, 56rem);
}

.viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

.viewer-fallback {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--foam-faint);
}

footer {
  padding: 0 0 2.5rem;
  font-size: 0.8125rem;
  color: var(--foam-faint);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

@keyframes grid-drift {
  to {
    transform: translate3d(-32px, -32px, 0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 640px) {
  .top {
    flex-direction: column;
    gap: 0.35rem;
  }

  .hero {
    min-height: calc(100svh - 5.5rem);
    padding-top: 3rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .document-head .btn {
    width: auto;
  }

  .viewer {
    height: 70vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .radar-grid,
  .radar-sweep,
  .glow-a,
  .top,
  .eyebrow,
  .brand,
  .lede,
  .cta-row {
    animation: none;
  }
}
