:root {
  --ink: #07090b;
  --ink-lift: #10151a;
  --mist: #c5d0d4;
  --seal: #8a969c;
  --beam: #dfe8e4;
  --beam-core: #f4f7f5;
  --accent: #6b9e8a;
  --ticker: #00e676;
  --ticker-dim: #00a855;
  --font-brand: "Instrument Serif", Georgia, serif;
  --font-seal: "Newsreader", Georgia, serif;
  --font-ticker: "IBM Plex Mono", ui-monospace, monospace;
  --brand-size: clamp(2.4rem, 11vw, 7.75rem);
  --brand-line-height: 0.95;
  /* Fallback before JS measures the real brand box; ticker is ignored */
  --globe-size: calc(var(--brand-size) * var(--brand-line-height) * 2);
  /* Longitude start: Atlantic facing forward (map scrolls from here) */
  --earth-lon: 46%;
  --title-gap: clamp(0.85rem, 2vh, 1.35rem);
  --byline-gap: clamp(0.7rem, 1.6vh, 1.1rem);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  background: var(--ink);
  color: var(--mist);
  font-family: var(--font-seal);
  overflow: hidden;
}

/* Atmosphere — full-bleed field */
.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 115%, var(--ink-lift) 0%, transparent 55%),
    radial-gradient(90% 60% at 70% -10%, #122018 0%, transparent 50%),
    var(--ink);
}

.field__beam {
  position: absolute;
  inset: -20% -10%;
  background:
    conic-gradient(
      from 210deg at 18% 88%,
      transparent 0deg,
      rgba(223, 232, 228, 0.04) 18deg,
      rgba(244, 247, 245, 0.14) 28deg,
      rgba(223, 232, 228, 0.05) 38deg,
      transparent 52deg
    ),
    linear-gradient(
      118deg,
      transparent 0%,
      transparent 42%,
      rgba(107, 158, 138, 0.08) 52%,
      rgba(244, 247, 245, 0.12) 58%,
      transparent 68%
    );
  opacity: 0;
  animation: beam-in 2.4s ease-out 0.2s forwards, beam-drift 18s ease-in-out 2.6s infinite;
  transform-origin: 18% 88%;
}

.field__horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 18%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(197, 208, 212, 0.08) 20%,
    rgba(244, 247, 245, 0.22) 48%,
    rgba(197, 208, 212, 0.08) 75%,
    transparent 100%
  );
  opacity: 0;
  animation: horizon-in 2s ease-out 0.8s forwards;
}

.field__grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

/* Scene — one composition */
.scene {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 8vh, 4.5rem);
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(1rem, 4vw, 3rem);
  /* slight inset so the globe isn't flush with the right edge */
  padding-right: clamp(0.75rem, 3vw, 2.25rem);
}

.brand {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: var(--brand-size);
  line-height: var(--brand-line-height);
  letter-spacing: -0.02em;
  color: var(--beam-core);
  text-wrap: balance;
}

.brand__line {
  display: block;
  opacity: 0;
  transform: translateY(0.35em);
  animation: brand-rise 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand__line:nth-child(1) {
  animation-delay: 0.35s;
}

.brand__line--infinity {
  animation-delay: 0.55s;
  color: var(--beam-core);
}

.globe-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  opacity: 0;
  transform: scale(0.92);
  animation: globe-in 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

/* Spinning Earth — CSS map scroll; black / red / white grade */
.globe {
  width: var(--globe-size);
  height: var(--globe-size);
}

.globe__sphere {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-image: url("../assets/earth-map.jpg");
  background-size: 200% 100%;
  background-repeat: repeat-x;
  background-position: var(--earth-lon) 50%;
  animation: earth-spin 48s linear infinite;
  box-shadow:
    inset 1.1rem 0 1.6rem rgba(0, 0, 0, 0.55),
    inset -0.35rem 0 0.7rem rgba(255, 255, 255, 0.1),
    inset 0 0 1.2rem rgba(0, 0, 0, 0.35),
    0 0 2rem rgba(212, 24, 26, 0.22),
    0 0.4rem 1.5rem rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.globe__sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.2) 0%, transparent 26%),
    radial-gradient(circle at 70% 70%, transparent 40%, rgba(0, 0, 0, 0.48) 100%);
  pointer-events: none;
}

.ticker {
  margin: 0;
  font-family: var(--font-ticker);
  font-size: clamp(0.8rem, 2.2vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ticker);
  text-shadow: 0 0 12px rgba(0, 230, 118, 0.35);
  white-space: nowrap;
  animation: ticker-pulse 2.4s ease-in-out infinite;
}

.titles {
  margin-top: var(--title-gap);
}

.seal,
.byline {
  margin: 0;
  max-width: 22rem;
  font-family: var(--font-seal);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--seal);
  opacity: 0;
  transform: translateY(0.5rem);
}

.seal {
  animation: seal-in 1.2s ease-out 1.15s forwards;
}

.byline {
  margin-top: var(--byline-gap);
  animation: seal-in 1.2s ease-out 1.35s forwards;
}

@media (min-width: 720px) {
  .scene {
    padding-left: clamp(3rem, 10vw, 8rem);
    padding-right: clamp(3rem, 10vw, 8rem);
  }

  .seal,
  .byline {
    max-width: 28rem;
  }
}

@keyframes brand-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes seal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes beam-in {
  to {
    opacity: 1;
  }
}

@keyframes horizon-in {
  to {
    opacity: 1;
  }
}

@keyframes globe-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes earth-spin {
  from {
    background-position: var(--earth-lon) 50%;
  }
  to {
    background-position: calc(var(--earth-lon) - 200%) 50%;
  }
}

@keyframes ticker-pulse {
  0%,
  100% {
    color: var(--ticker);
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.4);
    opacity: 1;
  }
  50% {
    color: var(--ticker-dim);
    text-shadow: 0 0 4px rgba(0, 230, 118, 0.15);
    opacity: 0.72;
  }
}

@keyframes beam-drift {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: rotate(1.2deg) scale(1.02);
    filter: brightness(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .field__beam,
  .field__horizon,
  .brand__line,
  .globe-block,
  .seal,
  .byline {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .globe__sphere,
  .ticker {
    animation: none;
  }
}
