:root {
  --bg: #0f1020;
  --grid: rgba(255, 255, 255, 0.04);
  --chomp: #ffd166;
  --ink: #f3f3ee;
  --ink-dim: #8a8da0;
  --accent: #6ee7b7;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(ellipse at 50% 40%, #1b1d36 0%, var(--bg) 60%, #07081a 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

.stage {
  position: relative;
  width: min(96vw, 1760px);
  aspect-ratio: 16 / 9;
  max-height: 96vh;
}

/* ---------- track + chomper ---------- */

.track {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  height: 140px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  padding-left: 5%;
}

.chomper {
  --size: 110px;
  width: var(--size);
  height: var(--size);
  flex: 0 0 var(--size);
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 8px 30px rgba(255, 209, 102, 0.25));
  animation: glide 14s linear infinite;
}

.chomper svg {
  width: 100%;
  height: 100%;
  display: block;
}

.jaw-top,
.jaw-bot {
  transform-origin: 50% 50%;
}

.jaw-top {
  animation: jawTop 0.36s ease-in-out infinite;
}

.jaw-bot {
  animation: jawBot 0.36s ease-in-out infinite;
}

.items {
  position: relative;
  flex: 1;
  height: 140px;
  margin-left: 80px;
  clip-path: inset(0px 0px 0px -120px);
}

/* ---------- item: tightly aligned icon + label ---------- */

.item {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 110px;
  color: var(--ink-dim);
  opacity: 0;
  transform: translate(1400px, -50%);
  will-change: transform, opacity;
}

.item .icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: currentColor;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.item .label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}

/* ---------- copy ---------- */

.copy {
  position: absolute;
  left: 0;
  right: 0;
  /* Anchored to the track's bottom edge (center 46% + half-height 70px) plus a
     proportional gap — scales with any 16:9 stage without per-breakpoint hacks. */
  top: calc(46% + 70px + 7%);
  bottom: auto;
  text-align: center;
  padding: 0 6%;
}

.eyebrow {
  position: absolute;
  top: calc((46% - 70px) / 2);
  transform: translateY(-50%);
  left: 0;
  right: 0;
  text-align: center;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 14px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
}

.eyebrow::before {
  content: "// ";
  opacity: 0.6;
}

.tagline {
  font-size: clamp(28px, 3.6vw, 56px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}

.tagline .dot {
  color: var(--chomp);
}

.tagline .boring {
  color: var(--ink-dim);
}

.tagline .strike {
  position: relative;
}

.tagline .strike::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 55%;
  height: 3px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  animation: strike var(--loop, 16s) linear infinite;
}

.tagline .vision {
  position: relative;
  color: var(--chomp);
}

.tagline .vision::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -4px;
  height: 3px;
  background: var(--chomp);
  transform: scaleX(0);
  transform-origin: left center;
  animation: underlineEffect var(--loop, 16s) linear infinite;
}

.sub-tagline {
  margin-top: 26px;
  font-size: 16px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.sub-tagline .sub-text {
  opacity: 0.85;
}

.learn-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(110, 231, 183, 0.06);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.learn-more:hover {
  background: rgba(110, 231, 183, 0.12);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.35);
  transform: translateY(-1px);
  color: #ffffff;
}

.learn-more i {
  font-size: 10px;
  transition: transform 0.25s ease;
}

.learn-more:hover i {
  transform: translateX(3px);
}

.footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3%;
  text-align: center;
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
}

/* ---------- animations ---------- */

@keyframes jawTop {

  0%,
  100% {
    transform: rotate(-38deg);
  }

  50% {
    transform: rotate(0deg);
  }
}

@keyframes jawBot {

  0%,
  100% {
    transform: rotate(38deg);
  }

  50% {
    transform: rotate(0deg);
  }
}

@keyframes glide {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* item conveyor — duration set per-element via inline style */
@keyframes eat {
  0% {
    transform: translate(1400px, -50%);
    opacity: 0;
  }

  4% {
    transform: translate(1400px, -50%);
    opacity: 1;
  }

  92% {
    transform: translate(-70px, -50%);
    opacity: 1;
  }

  95% {
    transform: translate(-105px, -50%) scale(0.25);
    opacity: 0;
  }

  100% {
    transform: translate(-105px, -50%) scale(0.25);
    opacity: 0;
  }
}

.item {
  animation: eat var(--loop, 16s) linear infinite;
}

@keyframes underlineEffect {

  0%,
  70% {
    transform: scaleX(0);
  }

  85% {
    transform: scaleX(1);
  }

  100% {
    transform: scaleX(1);
  }
}

@keyframes strike {

  0%,
  70% {
    transform: scaleX(0);
  }

  85% {
    transform: scaleX(1);
  }

  100% {
    transform: scaleX(1);
  }
}

/* ---------- hover to pause belt ---------- */

.track:hover {
  cursor: pause;
}

.track:hover .chomper,
.track:hover .jaw-top,
.track:hover .jaw-bot,
.track:hover .item {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {

  .chomper,
  .item,
  .jaw-top,
  .jaw-bot,
  .tagline .vision::after,
  .tagline .strike::after {
    animation: none !important;
  }

  .tagline .vision::after,
  .tagline .strike::after {
    transform: scaleX(1);
  }
}

@keyframes eatMobile {
  0% {
    transform: translate(700px, -50%);
    opacity: 0;
  }

  4% {
    transform: translate(700px, -50%);
    opacity: 1;
  }

  92% {
    transform: translate(-30px, -50%);
    opacity: 1;
  }

  95% {
    transform: translate(-65px, -50%) scale(0.2);
    opacity: 0;
  }

  100% {
    transform: translate(-65px, -50%) scale(0.2);
    opacity: 0;
  }
}

/* Landscape on iPad / medium screens (viewport height 768px–900px)            *
 * Fixes track–copy overlap and oversized fixed-pixel elements on short stages. */
@media (orientation: landscape) and (max-height: 900px) and (min-width: 769px) {
  .track {
    height: 120px;
    top: 42%;
  }

  .chomper {
    --size: 90px;
  }

  .items {
    height: 120px;
    margin-left: 60px;
  }

  .item {
    width: 90px;
  }

  .item .icon {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .item .label {
    white-space: normal;
    line-height: 1.25;
  }

  /* Re-center eyebrow between stage top and the new track top (42% − 60px). */
  .eyebrow {
    top: calc((42% - 60px) / 2);
  }

  .copy {
    /* track is at 42% / 60px half-height in this breakpoint */
    top: calc(42% + 60px + 8%);
  }

  .tagline {
    font-size: clamp(22px, 2.8vw, 44px);
  }

  .sub-tagline {
    margin-top: 16px;
  }
}

/* Portrait on iPad / wide-portrait tablets (769px+ wide, portrait orientation).  *
 * The 16:9 desktop stage only uses ~37% of a 1210px-tall viewport; switch to    *
 * the same flex-column approach used on mobile, but at tablet-appropriate sizes. */
@media (orientation: portrait) and (min-width: 769px) {
  .stage {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 0;
  }

  .track {
    position: relative;
    top: auto;
    transform: none;
    height: 130px;
    margin-top: auto;
    margin-bottom: auto;
    padding-left: 40px;
  }

  .chomper {
    --size: 96px;
  }

  .items {
    margin-left: 52px;
    height: 130px;
    clip-path: inset(0px 0px 0px -96px);
  }

  .item {
    width: 96px;
    gap: 6px;
  }

  .item .icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: 9px;
  }

  .item .label {
    font-size: 11px;
    letter-spacing: 0.1em;
    white-space: normal;
    line-height: 1.25;
  }

  .copy {
    position: relative;
    top: auto;
    bottom: auto;
    padding: 0 40px;
    text-align: center;
    margin-bottom: 24px;
  }

  .eyebrow {
    position: relative;
    top: auto;
    transform: none;
    font-size: 13px;
    letter-spacing: 0.26em;
    margin-top: 40px;
    margin-bottom: 14px;
  }

  .tagline {
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1.25;
  }

  .sub-tagline {
    margin-top: 20px;
    font-size: 15px;
    flex-direction: column;
    gap: 10px;
  }

  .footer {
    position: relative;
    bottom: auto;
    font-size: 11px;
    letter-spacing: 0.25em;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .stage {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 0;
  }

  .track {
    position: relative;
    left: 0;
    right: 0;
    top: auto;
    transform: none;
    height: 100px;
    margin-top: auto;
    margin-bottom: auto;
    padding-left: 20px;
  }

  .chomper {
    --size: 70px;
  }

  .items {
    margin-left: 35px;
    height: 100px;
    clip-path: inset(0px 0px 0px -60px);
  }

  .item {
    width: 70px;
    gap: 4px;
    animation-name: eatMobile;
  }

  .item .icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 8px;
  }

  .item .label {
    font-size: 10px;
    letter-spacing: 0.08em;
    white-space: normal;
    line-height: 1.25;
    max-width: 100%;
  }

  .copy {
    position: relative;
    left: 0;
    right: 0;
    top: auto;
    bottom: auto;
    padding: 0 20px;
    margin-bottom: 20px;
  }

  .eyebrow {
    position: relative;
    top: auto;
    transform: none;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.2em;
    margin-top: 24px;
    margin-bottom: 12px;
  }

  .tagline {
    font-size: 26px;
    line-height: 1.3;
  }

  .sub-tagline {
    margin-top: 16px;
    font-size: 13px;
    flex-direction: column;
    gap: 10px;
  }

  .learn-more {
    font-size: 11px;
    padding: 4px 12px;
  }

  .footer {
    position: relative;
    left: 0;
    right: 0;
    bottom: auto;
    font-size: 10px;
    letter-spacing: 0.2em;
  }
}
