:root {
  --bg: #05060a;
  --text: #f4f6fb;
  --muted: rgba(226, 232, 245, 0.62);
  --accent: #5b8cff;
  --accent-2: #a77bff;
  --accent-3: #22d3ee;
  --card: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.11);
  --grid: rgba(255, 255, 255, 0.07);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --glow-1: rgba(91, 140, 255, 0.32);
  --glow-2: rgba(167, 123, 255, 0.26);
  --glow-3: rgba(34, 211, 238, 0.16);
  --logo-glow: rgba(91, 140, 255, 0.45);
  --link: #22d3ee;
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.1);
  --amber-line: rgba(251, 191, 36, 0.45);
  color-scheme: dark;
}

/* Light theme: automatic from the device setting, or forced by the toggle */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fd;
    --text: #0b1020;
    --muted: rgba(20, 28, 55, 0.66);
    --accent: #2f63ff;
    --accent-2: #7c4dff;
    --accent-3: #0891b2;
    --card: rgba(255, 255, 255, 0.72);
    --line: rgba(15, 23, 60, 0.12);
    --grid: rgba(15, 23, 60, 0.05);
    --shadow: 0 10px 40px rgba(40, 60, 120, 0.12);
    --glow-1: rgba(91, 140, 255, 0.28);
    --glow-2: rgba(167, 123, 255, 0.22);
    --glow-3: rgba(34, 211, 238, 0.18);
    --logo-glow: rgba(91, 140, 255, 0.35);
    --link: #0e7490;
    --amber: #b45309;
    --amber-bg: rgba(245, 158, 11, 0.12);
    --amber-line: rgba(180, 83, 9, 0.4);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f6f8fd;
  --text: #0b1020;
  --muted: rgba(20, 28, 55, 0.66);
  --accent: #2f63ff;
  --accent-2: #7c4dff;
  --accent-3: #0891b2;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(15, 23, 60, 0.12);
  --grid: rgba(15, 23, 60, 0.05);
  --shadow: 0 10px 40px rgba(40, 60, 120, 0.12);
  --glow-1: rgba(91, 140, 255, 0.28);
  --glow-2: rgba(167, 123, 255, 0.22);
  --glow-3: rgba(34, 211, 238, 0.18);
  --logo-glow: rgba(91, 140, 255, 0.35);
  --link: #0e7490;
  --amber: #b45309;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-line: rgba(180, 83, 9, 0.4);
  color-scheme: light;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Soft animated gradient glow */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(40% 35% at 25% 20%, var(--glow-1), transparent 70%),
    radial-gradient(35% 35% at 78% 28%, var(--glow-2), transparent 70%),
    radial-gradient(40% 40% at 55% 85%, var(--glow-3), transparent 70%);
  filter: blur(30px);
  animation: drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Fine grid fading out toward the edges */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 100%);
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

main,
footer {
  position: relative;
  z-index: 1;
}

footer {
  width: calc(100% - 2 * clamp(1rem, 3vw, 2.5rem));
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

@media (max-width: 540px) {
  footer {
    flex-direction: column-reverse;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
  }

  footer nav {
    justify-content: center;
  }
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}


@media (prefers-reduced-motion: reduce) {
  body::before,
  .badge::before {
    animation: none;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}

.theme-toggle:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-wrap: break-word;
}

.theme-toggle {
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  font-size: 0.68rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  /* extend the glass background to the full page width */
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--bg) 72%, transparent);
  clip-path: inset(0 -100vmax);
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 3vw, 2.5rem) 0.6rem;
}

.wordmark {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark span {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 0 28px var(--logo-glow);
}

@media (max-width: 540px) {
  .topbar {
    padding: 1rem 1rem 0.6rem;
  }

  .wordmark {
    font-size: 1.05rem;
  }
}

.cta {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(91, 140, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(167, 123, 255, 0.5);
}

.cta-small {
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
  box-shadow: 0 4px 18px rgba(91, 140, 255, 0.35);
}

.wordmark,
.cta-small {
  white-space: nowrap;
}

.wordmark .llc {
  font-style: normal;
}

@media (max-width: 400px) {
  .topbar-right {
    gap: 0.6rem;
  }

  .cta-small {
    padding: 0.5rem 0.9rem;
  }
}

@media (max-width: 340px) {
  .topbar {
    padding: 0.9rem 0.75rem 0.6rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .wordmark {
    font-size: 0.95rem;
  }

  .cta-small {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
  }

}

/* Colorful pulses running along the grid lines */
.bg-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.run {
  position: absolute;
  opacity: 0;
  will-change: transform, opacity;
}

.run {
  filter: hue-rotate(var(--hue, 0deg)) saturate(1.1);
}

.run.h {
  left: 0;
  top: calc(var(--n) * 56px);
  width: 260px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #3b82f6 15%, #8b5cf6 38%, #ec4899 60%, #22d3ee 82%, transparent);
  box-shadow: 0 0 5px rgba(139, 92, 246, 0.4);
  animation: run-x var(--dur) linear var(--delay) infinite;
}

.run.v {
  top: 0;
  left: calc(var(--n) * 56px);
  width: 1px;
  height: 260px;
  background: linear-gradient(180deg, transparent, #22d3ee 15%, #3b82f6 38%, #8b5cf6 60%, #ec4899 82%, transparent);
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
  animation: run-y var(--dur) linear var(--delay) infinite;
}

.run:nth-child(4n + 1) { --hue: 0deg; }
.run:nth-child(4n + 2) { --hue: 70deg; }
.run:nth-child(4n + 3) { --hue: 150deg; }
.run:nth-child(4n) { --hue: 250deg; }

@keyframes run-x {
  0% { transform: translateX(-300px); opacity: 0; }
  10%, 85% { opacity: 0.85; }
  100% { transform: translateX(100vw); opacity: 0; }
}

@keyframes run-y {
  0% { transform: translateY(-300px); opacity: 0; }
  10%, 85% { opacity: 0.85; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-lines {
    display: none;
  }
}

.phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.phone svg {
  flex-shrink: 0;
  color: var(--accent);
}

.phone:hover {
  color: var(--link);
}

/* Phones: the number moves below the address in the contact card */
@media (max-width: 760px) {
  .phone {
    display: none;
  }
}

@media (max-width: 400px) {
  .topbar-right {
    gap: 0.45rem;
  }


  .cta-small {
    padding: 0.5rem 0.8rem;
  }

  .wordmark {
    font-size: 0.98rem;
  }
}


/* Phones: smaller theme button */
@media (max-width: 760px) {
  .theme-toggle {
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
  }
}
