/* Self-hosted so no visitor data goes to Google. Giganoob is our own hand and the only font we use. */

@font-face {
  font-family: "Giganoob";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/giganoob-regular.woff2") format("woff2");
}

/* Strictly black, white and grey, like the game. Dark is the default. */
:root {
  --ink: #0b0a0d;
  --paper: #f8f6f1;
  --grey-1: #e6e3dc;
  --grey-2: #cbc7bf;
  --grey-3: #a8a49c;
  --night: #0b0a0d;
  --chalk: #efebe2;
  --max: 1000px;
  --wob: 10px 4px 12px 5px / 5px 11px 4px 10px;
  --hatch: repeating-linear-gradient(-45deg, var(--chalk) 0 1.5px, transparent 1.5px 5px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--night);
  color: var(--chalk);
  font-family: "Giganoob", sans-serif;
  font-size: 1.2rem;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background: faint ruled-out Xs drifting slowly, one tile per loop */

body::before {
  content: "";
  position: fixed;
  top: -80px;
  right: 0;
  bottom: 0;
  left: -80px;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80' fill='none' stroke='%231c1a1f' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M14 14l12 12M26 14L14 26M54 54l12 12M66 54L54 66'/%3E%3C/svg%3E");
  animation: drift 12s linear infinite;
}

@keyframes drift {
  to { transform: translate(80px, 80px); }
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

h1, h2, h3 {
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Hand-ruled frames with a hatched cast shadow, like the game's cards */

.wob {
  border-radius: var(--wob);
}

.shadow {
  position: relative;
  isolation: isolate;
}

/* Both layers sit under the element's border and content: the hatch first, then the fill
   (--fill) over it, so the hatch shows only where it sticks out. */
.shadow::before,
.shadow::after {
  content: "";
  position: absolute;
  inset: -2.5px;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

.shadow::before {
  background: var(--hatch);
  transform: translate(7px, 8px);
}

/* Inside the border, which an isolated element paints under its negative layers. */
.shadow::after {
  inset: 0;
  background: var(--fill);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  --fill: var(--paper);
  --hatch: repeating-linear-gradient(-45deg, var(--ink) 0 1.5px, transparent 1.5px 4.5px);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  text-decoration: none;
  line-height: 1.2;
  transition: transform 0.1s;
}

.btn::before {
  transform: translate(5px, 6px);
  transition: transform 0.1s;
}

a.btn:hover {
  transform: translate(2px, 2px);
}

a.btn:hover::before {
  transform: translate(3px, 4px);
}

.btn svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: currentColor;
}

.btn small {
  display: block;
  font-size: 0.8rem;
}

.btn strong {
  display: block;
  font-weight: 400;
  font-size: 1.25rem;
}

/* Header */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand img {
  width: 52px;
}

.brand span {
  border-bottom: 3px solid var(--chalk);
  border-radius: 0 0 40% 60% / 0 0 3px 2px;
  line-height: 1.2;
}

/* Panels: paper card, ink text, hatched shadow */

.panel {
  --fill: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--chalk);
  margin-bottom: 32px;
}

.panel-head {
  padding: 12px 24px 0;
}

.panel-label {
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.panel-body {
  padding: 12px 24px 26px;
}

/* Hero: copy on the left, a tilted phone on the right */

.hero {
  position: relative;
  padding: 32px 0 24px;
  overflow-x: clip;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 32px;
  padding: 40px 48px;
}

.hero .eyebrow {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 3.8rem);
  line-height: 1.05;
}

.hero .lede {
  margin: 0 0 28px;
  max-width: 34ch;
}

.hero-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  margin: -110px 0 -40px;
  perspective: 1100px;
}

.tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-24deg) rotateX(10deg) rotateZ(5deg);
}

/* Scroll turn on top of the resting tilt. --scroll runs 0 → 1 (set in main.js). */
.tilt-spin {
  position: relative;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  transform:
    rotateY(calc(var(--scroll, 0) * 26deg))
    rotateX(calc(var(--scroll, 0) * -14deg));
  will-change: transform;
}

.device,
.device-edge {
  border-radius: 28px;
}

.device {
  position: relative;
  width: 210px;
  padding: 9px;
  background: var(--ink);
  border: 2.5px solid var(--chalk);
}

.device-edge {
  position: absolute;
  inset: 0;
  background: var(--grey-3);
  transform: translateZ(var(--z));
}

.device-edge:nth-child(1) { --z: -30px; background: var(--chalk); }
.device-edge:nth-child(2) { --z: -25px; }
.device-edge:nth-child(3) { --z: -20px; }
.device-edge:nth-child(4) { --z: -15px; }
.device-edge:nth-child(5) { --z: -10px; }
.device-edge:nth-child(6) { --z: -5px; }

.device img {
  width: 100%;
  aspect-ratio: 1170 / 2532;
  object-fit: cover;
  border-radius: 20px;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Feature cards */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.features .panel {
  margin-bottom: 0;
  text-align: center;
}

.feature h2 {
  font-size: 1.25rem;
  margin: 16px 0 0;
}

.feature p {
  margin: 8px 0 0;
  font-size: 1rem;
}

.feature .glyph {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 4px auto 0;
  background: var(--grey-1);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
}

.feature .glyph svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature .glyph img {
  width: 56px;
}

.about .panel-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
  padding: 20px 48px 32px;
}

.about .phone {
  width: 170px;
  padding: 7px;
  background: var(--ink);
  border-radius: 22px;
}

.about .phone img {
  border-radius: 16px;
  aspect-ratio: 1170 / 2532;
  object-fit: cover;
}

.about p {
  margin: 0 0 0.6em;
}

.about .tagline {
  margin: 0;
  font-size: 1.4rem;
}

/* Legal pages */

.doc {
  max-width: 800px;
  margin: 24px auto 32px;
}

.doc .panel-body {
  padding: 16px 32px 32px;
  font-size: 1.05rem;
}

.doc h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
}

.doc h2 {
  font-size: 1.6rem;
  margin-top: 1.4em;
}

.doc h3 {
  font-size: 1.3rem;
  margin-top: 1.2em;
}

.doc .summary {
  background: var(--grey-1);
  border: 2px solid var(--ink);
  border-radius: var(--wob);
  padding: 14px 18px;
}

.doc address {
  font-style: normal;
}

.table-scroll {
  overflow-x: auto;
  margin: 1em 0;
}

.doc table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px;
  border-bottom: 2px solid var(--grey-2);
}

.doc th {
  background: var(--grey-1);
}

/* Unresolved facts to settle before launch. Search the pages for "[CONFIRM". */
.confirm {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85em;
  padding: 1px 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Footer */

.site-footer {
  padding: 8px 0 36px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
  text-decoration: underline;
}

.site-footer p {
  margin: 0;
}

/* Mobile */

@media (max-width: 860px) {
  .hero-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 20px 28px;
  }

  .hero-scene {
    min-height: 330px;
    margin: -40px 0 0;
    grid-row: 1;
  }

  .device {
    width: 160px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .panel-head {
    padding: 12px 18px 0;
  }

  .panel-body,
  .doc .panel-body {
    padding: 10px 18px 22px;
  }

  .about .panel-body {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
    padding: 10px 20px 26px;
  }
}
