/* --- CSS variables: tweak brand colors & site name styling --- */
:root {
  --bg-deep: #07090f;
  --bg-mid: #0f1424;
  --accent: #00e5c8;
  --accent-dim: rgba(0, 229, 200, 0.35);
  --accent-2: #7c5cff;
  --accent-2-dim: rgba(124, 92, 255, 0.4);
  --text: #e8eef8;
  --text-muted: rgba(232, 238, 248, 0.65);
  --card: rgba(18, 24, 42, 0.72);
  --stroke: rgba(255, 255, 255, 0.08);
  --radius: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  /* Fill viewport: svh = stable mobile height; dvh = dynamic when bars hide */
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: "Outfit", system-ui, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1a2250 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(124, 92, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(0, 229, 200, 0.1) 0%, transparent 45%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 2;
  animation: noise-shift 8s steps(10) infinite;
}

@keyframes noise-shift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 2%);
  }
  50% {
    transform: translate(2%, -1%);
  }
  75% {
    transform: translate(-1%, -2%);
  }
}

.particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  z-index: 0;
  animation: orb-float 18s var(--ease-out) infinite;
}

.orb--1 {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  background: var(--accent-dim);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.orb--2 {
  width: min(40vw, 360px);
  height: min(40vw, 360px);
  background: var(--accent-2-dim);
  bottom: -5%;
  right: -8%;
  animation-delay: -6s;
  animation-duration: 22s;
}

.orb--3 {
  width: min(30vw, 280px);
  height: min(30vw, 280px);
  background: rgba(255, 255, 255, 0.06);
  top: 40%;
  left: 45%;
  animation-delay: -12s;
  animation-duration: 15s;
}

@keyframes orb-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(8%, 12%) scale(1.05);
  }
  66% {
    transform: translate(-6%, 6%) scale(0.98);
  }
}

.wrap {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  min-height: 0;
  padding: clamp(0.65rem, 2.5vmin, 2rem) clamp(1rem, 4vw, 3rem);
  gap: clamp(0.6rem, 2vmin, 1.75rem);
}

/* --- Brand --- */
.brand {
  text-align: center;
  animation: rise-in 1s var(--ease-out) both;
}

.brand__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: rgba(0, 229, 200, 0.08);
  margin-bottom: clamp(0.35rem, 1.5vmin, 1rem);
  animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 229, 200, 0.25);
  }
  50% {
    box-shadow: 0 0 24px 2px rgba(0, 229, 200, 0.15);
  }
}

.brand__name {
  margin: 0;
  font-size: clamp(1.35rem, 5.5vmin, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shimmer 6s ease-in-out infinite;
}

@keyframes title-shimmer {
  0%,
  100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(12deg);
  }
}

.brand__tag {
  margin: clamp(0.35rem, 1.2vmin, 0.75rem) 0 0;
  font-size: clamp(0.85rem, 2.2vmin, 1.05rem);
  font-weight: 300;
  color: var(--text-muted);
  animation: fade-in 1.2s var(--ease-out) 0.2s both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Oil pump jack (walking beam) --- */
.stage {
  perspective: 900px;
  animation: rise-in 1s var(--ease-out) 0.15s both;
  flex: 0 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  transform-origin: center bottom;
}

.pumpjack {
  position: relative;
  width: min(260px, 62vw);
  height: 248px;
  margin: 0 auto;
}

.pumpjack__shadow {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 78%;
  height: 20px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.48) 0%, transparent 72%);
  border-radius: 50%;
  animation: pumpjack-shadow 2.6s ease-in-out infinite;
}

@keyframes pumpjack-shadow {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.88;
  }
  50% {
    transform: translateX(-50%) scale(0.9);
    opacity: 0.62;
  }
}

.pumpjack__rig {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 220px;
  height: 228px;
  margin-left: -110px;
}

.pumpjack__base {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 88%;
  height: 14px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #2c3548 0%, #141a28 100%);
  border-radius: 4px;
  border: 1px solid var(--stroke);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.pumpjack__foot {
  position: absolute;
  bottom: 14px;
  width: 10px;
  height: 108px;
  background: linear-gradient(90deg, #1e2638, #2a3548 50%, #1e2638);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  transform-origin: bottom center;
}

.pumpjack__foot--l {
  left: 28px;
  transform: rotate(14deg);
}

.pumpjack__foot--r {
  right: 28px;
  transform: rotate(-14deg);
}

.pumpjack__samson {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 14px;
  height: 118px;
  margin-left: -7px;
  background: linear-gradient(90deg, #1a2233, #2d3a52 45%, #1a2233);
  border-radius: 3px;
  border: 1px solid var(--stroke);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 200, 0.06);
}

.pumpjack__crank {
  position: absolute;
  bottom: 52px;
  right: 36px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3d4d68, #151b28);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  animation: pumpjack-crank 2.6s linear infinite;
}

.pumpjack__crank-arm {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 22px;
  margin: -11px 0 0 -2px;
  background: linear-gradient(180deg, var(--accent), #009e8a);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-dim);
}

@keyframes pumpjack-crank {
  to {
    transform: rotate(360deg);
  }
}

.pumpjack__pivot {
  position: absolute;
  bottom: 124px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  z-index: 2;
}

.pumpjack__pivot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #5a6a85, #1a2230);
  border: 2px solid rgba(0, 229, 200, 0.25);
  box-shadow: 0 0 14px rgba(0, 229, 200, 0.15);
}

.pumpjack__beam {
  position: absolute;
  left: -102px;
  top: 6px;
  width: 204px;
  height: 11px;
  margin-top: -5px;
  background: linear-gradient(180deg, #3a465c 0%, #1e2638 55%, #121822 100%);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform-origin: 113px 5px;
  animation: pumpjack-beam 2.6s ease-in-out infinite;
}

@keyframes pumpjack-beam {
  0%,
  100% {
    transform: rotate(-13deg);
  }
  50% {
    transform: rotate(13deg);
  }
}

.pumpjack__horsehead {
  position: absolute;
  left: -6px;
  top: -14px;
  width: 36px;
  height: 32px;
  border: 3px solid #2a3548;
  border-right: none;
  border-radius: 50% 0 0 50%;
  background: linear-gradient(180deg, #323e54, #1a2230);
  box-shadow: inset -4px 0 8px rgba(0, 0, 0, 0.35);
}

.pumpjack__horsehead::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: 50%;
  width: 3px;
  height: 14px;
  margin-left: -1px;
  background: linear-gradient(180deg, #4a566e, #252d3e);
  border-radius: 1px;
}

.pumpjack__tail {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 28px;
  border-color: transparent transparent transparent #2a3548;
  filter: drop-shadow(-2px 4px 6px rgba(0, 0, 0, 0.35));
}

.pumpjack__polish-rod {
  position: absolute;
  left: 12px;
  top: 26px;
  width: 6px;
  height: 92px;
  margin-left: -3px;
  background: linear-gradient(90deg, #8a93a8, #d4d8e0 45%, #8a93a8);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(0, 229, 200, 0.12);
  transform-origin: top center;
  animation: pumpjack-rod 2.6s ease-in-out infinite;
}

@keyframes pumpjack-rod {
  0%,
  100% {
    transform: translateY(8px) rotate(13deg);
  }
  50% {
    transform: translateY(-8px) rotate(-13deg);
  }
}

/* --- Card --- */
.card {
  width: min(100%, 520px);
  flex-shrink: 0;
  padding: clamp(0.85rem, 2.8vmin, 2rem);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: rise-in 1s var(--ease-out) 0.25s both;
}

.card__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__text {
  margin: 0 0 clamp(0.65rem, 2vmin, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2.2vmin, 1rem);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: dot-beat 1.4s ease-in-out infinite;
}

@keyframes dot-beat {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.75;
  }
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  animation: progress-gradient 3s linear infinite;
  transition: width 0.35s var(--ease-out);
}

@keyframes progress-gradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.mono {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.foot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  text-align: center;
  padding: 0.5rem 1rem max(0.5rem, env(safe-area-inset-bottom, 0px));
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Glitch attribute hook */
[data-glitch]:hover {
  animation: glitch-text 0.4s linear;
}

@keyframes glitch-text {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 1px);
  }
  40% {
    transform: translate(2px, -1px);
  }
  60% {
    transform: translate(-1px, -1px);
  }
  80% {
    transform: translate(1px, 1px);
  }
  100% {
    transform: translate(0);
  }
}

/* Keep pump + header + card on one screen when height is tight */
@media (max-height: 780px) {
  .stage {
    transform: scale(0.92);
    margin-bottom: -1.25rem;
  }
}

@media (max-height: 700px) {
  .stage {
    transform: scale(0.84);
    margin-bottom: -2rem;
  }

  .brand__name {
    font-size: clamp(1.2rem, 5vmin, 3rem);
  }
}

@media (max-height: 620px) {
  .stage {
    transform: scale(0.74);
    margin-bottom: -3rem;
  }

  .wrap {
    gap: clamp(0.35rem, 1.5vmin, 1rem);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .card__title {
    font-size: 1.15rem;
  }
}

@media (max-height: 520px) {
  .stage {
    transform: scale(0.62);
    margin-bottom: -4rem;
  }

  .brand__badge {
    margin-bottom: 0.15rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.65rem;
  }

  .foot {
    padding-top: 0.25rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress__fill {
    animation: none;
  }
}
