/* Electric Heart — landing page */

@font-face {
  font-family: "Rubik";
  src: url("fonts/rubik-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rubik";
  src: url("fonts/rubik-italic-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* straight from the logo */
  --blue: #2176ff;
  --blue-deep: #0239bf;
  --yellow: #ffd603;
  --orange: #da8301;

  --night: #050818;
  --ink: #f5f8ff;
  --muted: #a9b8e6;
  --font: "Rubik", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  color-scheme: dark;
}

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

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The logo's glow and sparks are drawn on a canvas that spills well past the
   logo itself; this wrapper trims the spill at the edges of the page. */
.page {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  overflow: clip;
}

::selection {
  background: var(--yellow);
  color: var(--night);
}

/* ── Backdrop ─────────────────────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 78vmax 66vmax at 50% 38%, #13246e 0%, #0c174c 30%, #080e2e 60%, var(--night) 100%);
}

/* a field of dots that thins out towards the edges */
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(150, 182, 255, 0.22) 1px, transparent 1.7px);
  background-size: 28px 28px;
  background-position: 50% 38%;
  -webkit-mask-image: radial-gradient(ellipse 62vmax 52vmax at 50% 38%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 62vmax 52vmax at 50% 38%, #000 0%, transparent 100%);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4.5vh, 3.5rem) 1.25rem clamp(1rem, 3vh, 2rem);
  text-align: center;
}

.logo {
  position: relative;
  flex: none;
  width: min(92vw, 66vh, 700px);
  width: min(92vw, 66svh, 700px);
  aspect-ratio: 4 / 3;
}

@supports not (aspect-ratio: 1) {
  .logo::before {
    content: "";
    display: block;
    padding-top: 75%;
  }
}

.logo__still {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* once the canvas is drawing, the still logo steps aside (it stays readable to screen readers) */
.logo.is-live .logo__still {
  opacity: 0;
}

.logo__hit {
  position: absolute;
  inset: 4% 6%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}

.logo:not(.is-live) .logo__hit {
  display: none;
}

.logo__hit:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.hero__copy {
  position: relative; /* keeps the words above the sparks */
  z-index: 1;
}

.wordmark {
  margin: clamp(0.25rem, 1.6vh, 1.1rem) 0 0;
  font-size: clamp(2.3rem, min(10.2vw, 9.4vh), 6rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.012em;
  text-transform: uppercase;
}

.wordmark span {
  display: inline-block;
}

/* the two words borrow the logo's two colour pairs, as chunky extruded type */
.wordmark__electric {
  color: var(--yellow);
  text-shadow:
    0 0.03em 0 #eea300,
    0 0.06em 0 var(--orange),
    0 0.09em 0 #b56a00,
    0 0.2em 0.3em rgba(2, 4, 20, 0.5);
}

.wordmark__heart {
  color: #fff;
  text-shadow:
    0 0.03em 0 #6ea6ff,
    0 0.06em 0 var(--blue),
    0 0.09em 0 var(--blue-deep),
    0 0.2em 0.3em rgba(2, 4, 20, 0.5);
}

.tagline {
  margin: clamp(0.9rem, 2.4vh, 1.4rem) 0 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.4;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem 1rem;
  margin-top: clamp(1.4rem, 3.8vh, 2.4rem);
}

/* ── Buttons: one dressed as the bolt, one as the heart ───────────────────── */

.btn {
  --face: var(--yellow);
  --edge: var(--orange);
  --text: #0a0f2c;
  --drop: 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3.5rem;
  padding: 0.6em 1.4em;
  border: 3px solid var(--edge);
  border-radius: 1.15rem;
  background: var(--face);
  box-shadow:
    0 var(--drop) 0 var(--edge),
    0 calc(var(--drop) + 12px) 26px -10px rgba(0, 0, 0, 0.6);
  color: var(--text);
  font: 700 clamp(1rem, 4.6vw, 1.1875rem) / 1.1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.16s cubic-bezier(0.3, 1.7, 0.5, 1),
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.btn svg {
  flex: none;
  width: 1.35em;
  height: 1.35em;
}

.btn--mail {
  --face: #1f6ff5; /* the logo blue, a touch deeper so white text stays readable */
  --edge: var(--blue-deep);
  --text: #fff;
}

/* too narrow for the buttons to sit side by side: stack them at one width */
@media (max-width: 640px) {
  .links {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: min(100%, 19.5rem);
  }
}

.btn:hover {
  --drop: 8px;
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.btn:active {
  --drop: 2px;
  transform: translateY(4px);
  transition-duration: 0.05s;
}

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 1rem 1.25rem max(1.1rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: #7f8fc6;
}

.site-footer p {
  margin: 0;
}

/* ── The page flinches when the heart is shocked ──────────────────────────── */

@keyframes zap {
  0% { filter: brightness(1); transform: none; }
  7% { filter: brightness(2.3) drop-shadow(0 0 0.22em rgba(255, 226, 90, 0.9)); transform: translateX(-0.012em) skewX(-2deg); }
  14% { filter: brightness(1.05); transform: translateX(0.01em); }
  22% { filter: brightness(1.8) drop-shadow(0 0 0.16em rgba(255, 226, 90, 0.7)); transform: none; }
  100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 226, 90, 0)); transform: none; }
}

.is-jolted .wordmark {
  animation: zap 0.6s ease-out;
}

/* ── Short, wide screens (a phone on its side): logo beside the words ─────── */

@media (orientation: landscape) and (max-height: 540px) {
  .hero {
    flex-direction: row;
    gap: clamp(1rem, 4vw, 3rem);
    padding-block: 0.75rem;
    text-align: left;
  }

  .logo {
    width: min(46vw, 104vh);
    width: min(46vw, 104svh);
  }

  .wordmark {
    margin-top: 0;
    font-size: clamp(1.9rem, min(5.6vw, 15vh), 3.6rem);
  }

  .tagline {
    margin-top: 0.6rem;
  }

  .links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    margin-top: 1rem;
  }

  .btn {
    width: min(100%, 19.5rem);
    min-height: 3rem;
  }

  .site-footer {
    padding-block: 0.4rem 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .is-jolted .wordmark {
    animation: none;
  }
}
