/* neonbulldog.com: the one stylesheet for every page. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/HankenGrotesk-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tilt Neon";
  src: url("../fonts/TiltNeon-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0E1424;
  --night-2: #131B2E;
  --rule: #24304A;
  --text: #EEF1F7;
  --muted: #A3ADC2;
  --dim: #8A93A8;
  --soft: #C3CADA;
  --pink: #FF5BD7;
  --cyan: #4DF3FF;
  --accent: var(--pink);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 17px/1.6 "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration-color: #56617F;
  text-underline-offset: 3px;
}

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

a:focus-visible {
  outline-style: solid;
  outline-width: 2px;
  outline-color: var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

img {
  max-width: 100%;
}

.w {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 48px;
}

/* Header */

.hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-block: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Tilt Neon", system-ui, sans-serif;
  font-size: 23px;
  line-height: 1;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-size: 15px;
  font-weight: 500;
}

.nav a {
  color: #C9D0DE;
  text-decoration: none;
  padding-block: 4px;
}

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

.nav a[aria-current] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Homepage hero: the lit sign on a dark wall */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(68vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-block: 64px 72px;
}

/* Rainbow light from the sign, spilling onto the wall behind it. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 30%;
  width: min(860px, 82%);
  height: 40%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, hsl(0 45% 56%), hsl(60 45% 54%), hsl(120 40% 50%), hsl(180 40% 50%), hsl(240 45% 60%), hsl(300 45% 58%));
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
  transition: opacity 0.3s;
  animation: spill 1.6s ease-out 1.25s backwards;
}

.sign {
  font-family: "Tilt Neon", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(52px, 10vw, 108px);
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
}

/* One neon tube per letter of the wordmark, in the sign and the header. --i is the letter's place and
   --hue sweeps a muted rainbow from red to magenta. The text stays "Neon Bulldog"; CSS sets it in lower case. */
.rainbow > span {
  --hue: calc(var(--i) * 30);
  --lit: hsl(var(--hue) 45% 90%);
  --dim: hsl(var(--hue) 12% 28%);
  --glow: 0 0 2px hsl(var(--hue) 40% 96%), 0 0 8px hsl(var(--hue) 55% 72%), 0 0 18px hsl(var(--hue) 50% 60%),
    0 0 40px hsl(var(--hue) 45% 52%), 0 0 72px hsl(var(--hue) 45% 50%);
  --glow-hot: 0 0 3px hsl(var(--hue) 40% 97%), 0 0 10px hsl(var(--hue) 60% 76%), 0 0 24px hsl(var(--hue) 55% 64%),
    0 0 52px hsl(var(--hue) 50% 56%), 0 0 90px hsl(var(--hue) 50% 54%);
  color: var(--lit);
  text-shadow: var(--glow);
}

.rainbow > span:nth-child(1) { --i: 0; }
.rainbow > span:nth-child(2) { --i: 1; }
.rainbow > span:nth-child(3) { --i: 2; }
.rainbow > span:nth-child(4) { --i: 3; }
.rainbow > span:nth-child(5) { --i: 4; }
.rainbow > span:nth-child(6) { --i: 5; }
.rainbow > span:nth-child(7) { --i: 6; }
.rainbow > span:nth-child(8) { --i: 7; }
.rainbow > span:nth-child(9) { --i: 8; }
.rainbow > span:nth-child(10) { --i: 9; }
.rainbow > span:nth-child(11) { --i: 10; }

.logo .rainbow {
  text-transform: lowercase;
}

.logo .rainbow > span {
  text-shadow: 0 0 5px hsl(var(--hue) 50% 64%), 0 0 13px hsl(var(--hue) 45% 54%);
}

.logo:hover .rainbow > span {
  text-shadow: 0 0 3px hsl(var(--hue) 40% 94%), 0 0 9px hsl(var(--hue) 55% 68%), 0 0 22px hsl(var(--hue) 50% 56%);
}

/* The power-on: the bulldog lights first, then each tube stutters on, left to right. The "u" is a little faulty.
   Afterwards the tubes buzz brighter under the pointer and flicker when tapped. */
.sign > span {
  cursor: pointer;
  transition: text-shadow 0.15s;
  animation: tube-on 0.6s steps(1, end) backwards;
  animation-delay: calc(0.95s + var(--i) * 0.09s);
}

.sign > span:nth-child(6) {
  animation: tube-on 0.6s steps(1, end) backwards, faulty 0.55s steps(1, end) 1;
  animation-delay: calc(0.95s + var(--i) * 0.09s), 3.6s;
}

.sign > span:hover {
  text-shadow: var(--glow-hot);
}

.sign > span:active {
  animation: tap 0.3s steps(1, end);
}

/* The bulldog mark: neon tubes with a pale core (Mark.astro; the gradient and glow are in NeonDefs.astro). */
.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.mark {
  display: block;
  overflow: visible;
}

.mark .tube {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark .core {
  fill: none;
  stroke: #F4F0F6;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.eye-wink {
  opacity: 0;
}

.logo .mark {
  width: 34px;
  height: 34px;
}

/* In the hero the bulldog is a button: it winks under the pointer and barks when pressed. */
.dog {
  position: relative;
  display: block;
  margin: 0 auto 4px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.dog .mark {
  width: clamp(116px, 15vw, 164px);
  height: auto;
  aspect-ratio: 1;
  animation: mark-on 0.9s steps(1, end) 0.1s backwards;
}

.dog:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 6px;
}

.dog:hover .eye-open,
.dog:focus .eye-open {
  opacity: 0;
}

.dog:hover .eye-wink,
.dog:focus .eye-wink {
  opacity: 1;
}

.woof {
  position: absolute;
  left: 86%;
  top: 2%;
  font: 400 24px/1 "Tilt Neon", system-ui, sans-serif;
  color: hsl(48 45% 92%);
  text-shadow: 0 0 2px #fff, 0 0 8px hsl(48 55% 70%), 0 0 20px hsl(48 50% 58%);
  border: 2px solid hsl(48 50% 74%);
  border-radius: 16px 16px 16px 4px;
  padding: 6px 12px 7px;
  box-shadow: 0 0 10px hsl(48 50% 60%), inset 0 0 8px hsl(48 50% 60% / 0.5);
  white-space: nowrap;
  opacity: 0;
  transform: rotate(-6deg);
  pointer-events: none;
}

.dog:focus .woof,
.dog:active .woof {
  opacity: 1;
  animation: woof-on 0.45s steps(1, end);
}

/* The lights switch: a real checkbox, so keyboards and screen readers can use it. */
.lights {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.lights-switch {
  position: absolute;
  top: 6px;
  right: 48px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: 2px solid hsl(300 40% 66%);
  box-shadow: 0 0 8px hsl(300 45% 60% / 0.7);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.knob {
  position: absolute;
  top: 2px;
  left: 22px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: hsl(300 45% 88%);
  box-shadow: 0 0 8px hsl(300 50% 70%);
  transition: left 0.2s, background 0.2s, box-shadow 0.2s;
}

.lights:focus-visible + .lights-switch .track {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.hero:has(.lights:not(:checked)) .knob {
  left: 2px;
  background: #4A5168;
  box-shadow: none;
}

.hero:has(.lights:not(:checked)) .track {
  border-color: #3A4258;
  box-shadow: none;
}

.hero:has(.lights:not(:checked)) .sign > span {
  color: var(--dim);
  text-shadow: none;
  animation: none;
}

.hero:has(.lights:not(:checked)) .dog .mark {
  opacity: 0.22;
  filter: saturate(0.2);
  animation: none;
}

.hero:has(.lights:not(:checked))::before {
  opacity: 0;
}

@keyframes tube-on {
  0% { color: var(--dim); text-shadow: none; }
  30% { color: var(--lit); text-shadow: var(--glow); }
  45% { color: var(--dim); text-shadow: none; }
  65% { color: var(--lit); text-shadow: var(--glow); }
}

@keyframes faulty {
  0% { color: var(--lit); text-shadow: var(--glow); }
  25% { color: var(--dim); text-shadow: none; }
  40% { color: var(--lit); text-shadow: var(--glow); }
  70% { color: var(--dim); text-shadow: none; }
  80% { color: var(--lit); text-shadow: var(--glow); }
}

@keyframes tap {
  0% { color: var(--dim); text-shadow: none; }
  40% { color: var(--lit); text-shadow: var(--glow-hot); }
  60% { color: var(--dim); text-shadow: none; }
  80% { color: var(--lit); text-shadow: var(--glow-hot); }
}

@keyframes mark-on {
  0% { opacity: 0.18; filter: saturate(0.3); }
  30% { opacity: 1; filter: none; }
  42% { opacity: 0.3; }
  60% { opacity: 1; }
}

@keyframes woof-on {
  0% { opacity: 0; }
  30% { opacity: 1; }
  45% { opacity: 0.2; }
  60% { opacity: 1; }
}

@keyframes spill {
  from { opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

.lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--soft);
  max-width: 30em;
  margin: 32px auto 0;
  text-wrap: balance;
}

.hero .lede {
  animation: rise 0.8s ease-out 2.1s backwards;
}

/* App panels (homepage) */

.apps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-block: 0 56px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 26px 24px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 26px var(--accent);
}

/* Cards: the accent bar is a neon tube that lights the card under the pointer. */
.panel {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover,
.panel:focus-within {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--rule));
  box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--accent) 60%, transparent),
    inset 0 60px 70px -60px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* Where scroll-linked animations exist, each tube lights up as its card scrolls into view. */
@supports (animation-timeline: view()) {
  .panel::before {
    animation: tube-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes tube-up {
  from { opacity: 0.15; box-shadow: none; }
}

.app-id {
  display: flex;
  gap: 16px;
  align-items: center;
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 22.5%;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.panel h2,
.panel h3 {
  font-size: 23px;
}

.panel h2 a,
.panel h3 a {
  text-decoration: none;
}

.panel h2 a:hover,
.panel h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.panel p {
  color: var(--muted);
  font-size: 16px;
  margin-top: 3px;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 24px;
  font-size: 15px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 16px;
  font-size: 15px;
}

.badge {
  display: inline-block;
  flex: none;
  line-height: 0;
  border-radius: 9px;
}

.badge img {
  display: block;
  width: auto;
  height: 44px;
}

.soon {
  font-size: 14px;
  color: var(--muted);
  border: 1px solid #36415E;
  border-radius: 9px;
  padding: 10px 14px;
}

.meta {
  color: var(--dim);
  font-size: 15px;
}

.about {
  padding-block: 0 56px;
  text-align: center;
  color: var(--muted);
}

.about p {
  border-top: 1px solid var(--rule);
  padding-top: 36px;
  text-wrap: balance;
}

/* Homepage groups: Games and Apps */

.group-head {
  font-size: 28px;
  margin-bottom: 20px;
}

.group-head a {
  text-decoration: none;
}

.group-head a:hover {
  text-decoration: underline;
  text-decoration-color: var(--cyan);
}

/* App pages */

.app-hero {
  display: flex;
  gap: 32px;
  align-items: center;
  padding-block: 48px 52px;
}

.app-hero .icon {
  width: 120px;
  height: 120px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 14px 48px -10px var(--accent);
}

.app-hero h1 {
  font-size: 48px;
  letter-spacing: -0.02em;
}

.pitch {
  font-size: 21px;
  line-height: 1.45;
  color: var(--soft);
  margin-top: 8px;
  max-width: 30em;
  text-wrap: pretty;
}

.app-hero .actions {
  margin-top: 22px;
}

.shots {
  background: var(--night-2);
  background: color-mix(in srgb, var(--accent) 11%, var(--night));
  border-block: 1px solid var(--rule);
  border-block: 1px solid color-mix(in srgb, var(--accent) 28%, var(--night));
}

.shot-row {
  display: flex;
  gap: 28px;
  padding-block: 40px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

/* Auto margins center the row when it fits and keep its start reachable when it doesn't. */
.shot-row > :first-child {
  margin-left: auto;
}

.shot-row > :last-child {
  margin-right: auto;
}

.shot-row img {
  width: 236px;
  height: auto;
  flex: none;
  border-radius: 20px;
  scroll-snap-align: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* A row of five shots is narrower, so all five fit across a wide screen. */
@media (min-width: 641px) {
  .shot-row img:first-child:nth-last-child(5),
  .shot-row img:first-child:nth-last-child(5) ~ img {
    width: 182px;
  }
}

.features {
  padding-block: 56px 16px;
}

.features h2,
.support h2 {
  font-size: 28px;
  margin-bottom: 22px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 56px;
  max-width: 920px;
}

.grid2 h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 6px;
}

.grid2 p {
  color: var(--muted);
  text-wrap: pretty;
}

.fine {
  color: var(--dim);
  font-size: 15px;
  margin-top: 32px;
  max-width: 68ch;
}

.support {
  padding-block: 40px 64px;
}

.support-box {
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--night-2);
  padding: 28px;
  max-width: 720px;
}

.support-box h2 {
  margin-bottom: 12px;
}

.support-box p {
  color: var(--soft);
}

.support-box p + p {
  margin-top: 10px;
}

/* Policy pages */

.doc {
  max-width: 800px;
  padding-block: 44px 72px;
}

.doc h1 {
  font-size: 40px;
  letter-spacing: -0.02em;
}

.doc .updated {
  color: var(--dim);
  font-size: 15px;
  margin-top: 10px;
}

.doc h2 {
  font-size: 22px;
  margin: 40px 0 10px;
}

.doc p,
.doc li {
  color: #D3D9E5;
  line-height: 1.7;
  max-width: 68ch;
}

.doc p + p {
  margin-top: 14px;
}

.doc .updated + p {
  margin-top: 28px;
}

.doc ul {
  padding-left: 22px;
  margin: 12px 0 0;
}

.doc li + li {
  margin-top: 6px;
}

/* Section landings and the 404 page */

.page-hero {
  padding-block: 48px 40px;
}

.page-hero h1 {
  font-size: 48px;
  letter-spacing: -0.02em;
}

.page-hero .links {
  margin-top: 22px;
}

/* Footer */

.ft {
  border-top: 1px solid var(--rule);
}

.ftw {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 24px 30px;
  font-size: 14px;
  color: var(--dim);
}

.ftnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.ftnav a {
  color: #B7BFD0;
}

/* Narrow screens */

@media (max-width: 760px) {
  .apps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .w {
    padding-inline: 20px;
  }

  .hd {
    padding-block: 18px;
  }

  .hero {
    padding-block: 44px 52px;
  }

  .lights-switch {
    right: 20px;
  }

  .woof {
    left: 70%;
    top: -14%;
    font-size: 20px;
  }

  .lede,
  .pitch {
    font-size: 19px;
  }

  .panel {
    padding: 24px 20px 20px;
  }

  .app-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-block: 32px 40px;
  }

  .app-hero .icon {
    width: 96px;
    height: 96px;
  }

  .app-hero h1 {
    font-size: 36px;
  }

  .page-hero {
    padding-block: 32px 28px;
  }

  .page-hero h1 {
    font-size: 36px;
  }

  .shot-row {
    gap: 16px;
  }

  .shot-row img {
    width: 70%;
  }

  .grid2 {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .features h2,
  .support h2,
  .group-head {
    font-size: 24px;
  }

  .support-box {
    padding: 22px 20px;
  }

  .doc h1 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sign > span,
  .sign > span:nth-child(6),
  .sign > span:active,
  .hero::before,
  .hero .lede,
  .panel::before,
  .dog .mark,
  .dog:focus .woof,
  .dog:active .woof {
    animation: none;
  }

  .sign > span,
  .panel,
  .knob,
  .track,
  .hero::before {
    transition: none;
  }

  .panel:hover,
  .panel:focus-within {
    transform: none;
  }
}

/* Paper: black on white, whether or not the browser prints backgrounds */

@media print {
  :root {
    color-scheme: light;
  }

  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .hero::before,
  .lights-switch,
  .woof {
    display: none;
  }
}
