/* ==========================================================================
   upgup.com — styles
   ========================================================================== */

:root {
  --bg: #05070f;
  --text: #e8ecf8;
  --text-muted: #94a0bf;
  --text-dim: #707c9e;
  --cyan: #22d3ee;
  --cyan-soft: #a5f3fc;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --grad: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 50%, var(--violet) 100%);
  --grid-line: rgba(148, 163, 255, 0.14);
  --danger: #fca5a5;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Background layers
   -------------------------------------------------------------------------- */

.bg-glow,
.bg-grid,
.bg-vignette,
#network {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-glow {
  background:
    radial-gradient(42vmax 32vmax at 28% 32%, rgba(34, 211, 238, 0.13), transparent 62%),
    radial-gradient(44vmax 34vmax at 74% 66%, rgba(139, 92, 246, 0.16), transparent 62%);
  animation: glow-drift 22s ease-in-out infinite alternate;
}

.bg-grid {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 0%, transparent 78%);
  opacity: 0.4;
}

#network {
  width: 100%;
  height: 100%;
  display: block;
}

.bg-vignette {
  background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 45%, rgba(3, 4, 10, 0.85) 100%);
}

@keyframes glow-drift {
  to {
    transform: translate3d(2.5%, -2%, 0) scale(1.06);
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding:
    calc(56px + env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    32px
    max(20px, env(safe-area-inset-left));
}

/* Soft dark scrim keeps text crisp over the particle field */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(960px, 100%); /* never wider than the viewport (avoids mobile h-scroll) */
  height: min(600px, 120vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(5, 7, 15, 0.78), rgba(5, 7, 15, 0));
  z-index: -1;
  pointer-events: none;
}

/* Logo -------------------------------------------------------------------- */

.logo {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.14em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 15vw, 7.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.logo-mark {
  width: 0.9em;
  height: 0.9em;
  flex: none;
  overflow: visible;
  /* optical alignment with the x-height/descender body of "upgup" */
  transform: translateY(0.09em);
  filter: drop-shadow(0 0 0.16em rgba(56, 189, 248, 0.35));
  animation: mark-breathe 6s ease-in-out 2s infinite;
}

.mark-hex {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: hex-draw 1.8s var(--ease-out) 0.15s both;
}

.mark-chev {
  transform-box: fill-box;
  transform-origin: center;
}

.mark-chev--low {
  opacity: 0.5;
  animation:
    chev-in 0.9s var(--ease-out) 0.55s both,
    chev-pulse-low 6s ease-in-out 2.4s infinite;
}

.mark-chev--high {
  animation:
    chev-in 0.9s var(--ease-out) 0.75s both,
    chev-pulse-high 6s ease-in-out 2.4s infinite;
}

.logo-word {
  /* extra room so background-clip:text doesn't cut the descenders */
  padding: 0.06em 0.04em 0.16em 0;
  margin-bottom: -0.1em;
  background: linear-gradient(100deg,
      #eef2ff 0%, #eef2ff 42%,
      var(--cyan-soft) 47%, #c4b5fd 53%,
      #eef2ff 58%, #eef2ff 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 8s var(--ease-out) 1.3s infinite;
}

@keyframes hex-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

@keyframes chev-in {
  from { transform: translateY(8px); opacity: 0; }
}

@keyframes chev-pulse-low {
  0%, 100% { opacity: 0.5; }
  6%       { opacity: 1; }
  16%      { opacity: 0.5; }
}

@keyframes chev-pulse-high {
  0%, 4%, 100% { transform: translateY(0); }
  12%          { transform: translateY(-2.5px); }
  24%          { transform: translateY(0); }
}

@keyframes mark-breathe {
  0%, 100% { filter: drop-shadow(0 0 0.14em rgba(56, 189, 248, 0.3)); }
  50%      { filter: drop-shadow(0 0 0.28em rgba(139, 92, 246, 0.45)); }
}

@keyframes shine {
  0%   { background-position: 100% 0; }
  28%  { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

/* Tagline ------------------------------------------------------------------ */

.tagline {
  margin: clamp(20px, 3vw, 30px) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 16px);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(0.76rem, 2.7vw, 1rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cyan-soft);
  white-space: nowrap;
}

.tagline-text {
  position: relative;
  /* cancel the trailing letter-spacing so the text stays optically centred */
  margin-right: -0.32em;
}

.tagline-text .glyph {
  color: var(--violet);
  opacity: 0.75;
}

/* blinking terminal caret */
.tagline-text::after {
  content: "";
  position: absolute;
  left: calc(100% - 0.16em);
  top: 50%;
  width: 0.55em;
  height: 1.15em;
  transform: translateY(-50%);
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
  animation: caret-blink 1.05s steps(1) infinite;
}

.tagline.caret-off .tagline-text::after {
  animation: none;
  opacity: 0;
}

.tagline-line {
  width: clamp(18px, 6vw, 56px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.75));
}

/* equal spacing on both sides; the right side also leaves room for the caret */
.tagline-line:first-child {
  margin-right: 0.32em;
}

.tagline-line:last-child {
  transform: scaleX(-1);
  margin-left: 0.32em;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

/* Lede --------------------------------------------------------------------- */

.lede {
  margin: clamp(18px, 2.6vw, 24px) 0 0;
  max-width: 46ch;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--text-muted);
  text-wrap: balance;
}

/* Buttons ------------------------------------------------------------------ */

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.65em;
  border: 0;
  border-radius: 999px;
  font: 600 1rem/1 var(--font-body);
  letter-spacing: 0.01em;
  color: #05070f;
  background: var(--grad);
  background-size: 160% 100%;
  background-position: 0% 0;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 10px 30px -10px rgba(56, 189, 248, 0.65),
    0 0 44px -10px rgba(139, 92, 246, 0.55);
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s ease,
    background-position 0.6s ease;
}

.hero > .cta {
  margin-top: clamp(30px, 4.5vw, 44px);
}

/* light sweep on hover */
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.8s var(--ease-out);
}

.cta svg {
  width: 1.15em;
  height: 1.15em;
  transition: transform 0.3s var(--ease-out);
}

@media (hover: hover) {
  .cta:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.18),
      0 16px 40px -12px rgba(56, 189, 248, 0.8),
      0 0 60px -8px rgba(139, 92, 246, 0.7);
  }
  .cta:hover::after {
    transform: translateX(130%);
  }
  .cta:hover svg {
    transform: translateX(3px);
  }
}

.cta:active {
  transform: translateY(0) scale(0.98);
}

.cta:focus-visible {
  outline: 2px solid var(--cyan-soft);
  outline-offset: 4px;
}

.cta[disabled] {
  cursor: progress;
  opacity: 0.85;
}

.cta--block {
  width: 100%;
  margin-top: 6px;
}

.spinner {
  display: none;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid rgba(5, 7, 15, 0.25);
  border-top-color: #05070f;
  animation: spin 0.7s linear infinite;
}

.cta.is-loading .spinner {
  display: inline-block;
}

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

/* Footer ------------------------------------------------------------------- */

.footer {
  position: relative;
  z-index: 1;
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.footer p {
  margin: 0;
}

/* Entrance animation ------------------------------------------------------- */

.reveal {
  animation: rise 1s var(--ease-out) var(--d, 0s) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(6px);
  }
}

/* --------------------------------------------------------------------------
   Contact modal
   -------------------------------------------------------------------------- */

.modal {
  width: min(540px, calc(100% - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(3, 5, 12, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal[open] {
  animation: modal-in 0.5s var(--ease-out);
}

.modal[open]::backdrop {
  animation: fade-in 0.3s ease;
}

.modal.is-closing {
  animation: modal-out 0.2s ease forwards;
}

.modal.is-closing::backdrop {
  animation: fade-out 0.2s ease forwards;
}

.modal-panel {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(26px, 5vw, 38px);
  border: 1px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(14, 20, 40, 0.97), rgba(8, 12, 26, 0.97)) padding-box,
    linear-gradient(140deg, rgba(34, 211, 238, 0.6), rgba(96, 165, 250, 0.12) 40%, rgba(167, 139, 250, 0.6)) border-box;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.85),
    0 0 70px -24px rgba(96, 165, 250, 0.45);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(148, 163, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal-close:focus-visible {
  outline: 2px solid var(--cyan-soft);
  outline-offset: 2px;
}

.modal-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
}

.modal-title {
  margin: 0;
  padding-right: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.modal-title--form {
  margin-bottom: 26px;
}

.modal-sub {
  margin: 10px 0 24px;
  color: var(--text-muted);
  font-size: 0.975rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom-on-focus */
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 255, 0.2);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field textarea {
  min-height: 128px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #58637f;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(34, 211, 238, 0.75);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14);
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: rgba(248, 113, 113, 0.8);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-status {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 0.875rem;
  text-align: center;
  color: var(--danger);
}

.form-status:empty {
  min-height: 0;
  margin: 0;
}

.modal-success {
  text-align: center;
  padding: 12px 0 4px;
}

.modal-success .modal-title {
  padding-right: 0;
}

.modal-success .modal-sub {
  margin-bottom: 26px;
}

.success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.45));
}

.success-icon circle,
.success-icon path {
  stroke-dasharray: 100;
}

.modal-success:not([hidden]) .success-icon circle {
  animation: hex-draw 0.8s var(--ease-out) both;
}

.modal-success:not([hidden]) .success-icon path {
  animation: hex-draw 0.6s var(--ease-out) 0.35s both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
}

@keyframes modal-out {
  to { opacity: 0; transform: translateY(10px) scale(0.98); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes fade-out {
  to { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 560px) {
  /* modal becomes a bottom sheet */
  .modal {
    width: 100%;
    margin: auto 0 0;
  }

  .modal-panel {
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
  }

  .modal[open] {
    animation: sheet-in 0.5s var(--ease-out);
  }

  .modal.is-closing {
    animation: sheet-out 0.22s ease forwards;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
}

@keyframes sheet-out {
  to { transform: translateY(100%); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    padding-top: calc(28px + env(safe-area-inset-top));
    padding-bottom: 16px;
  }
  .logo {
    font-size: clamp(2.8rem, 9vw, 4.5rem);
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .tagline-text::after {
    display: none;
  }
}
