/* 1OFF landing page. Colors from the app: indigo CTA #4a1fd1, the logo's
   gradient #38227d -> #8e71ea, and the foil rainbow of the grid's cards. */

/* Inter, served from here rather than Google Fonts: visitors' IPs go to no one
   else (see /privacy). Latin only, variable weight and optical size (big type
   gets the Display cut). SIL Open Font License (fonts/inter-LICENSE.txt). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/inter-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 700 900;
  font-display: swap;
  src: url('/fonts/inter-italic.woff2') format('woff2');
}

:root {
  --bg: #07060c;
  --ink: #f4f2ff;
  --muted: rgba(236, 232, 255, 0.62);
  --line: rgba(236, 232, 255, 0.09);
  --cta: #4a1fd1;
  --cta-hi: #5b2ef0;
  --violet: #8e71ea;
  --deep: #38227d;
  --foil: linear-gradient(100deg, #ff8fd0 0%, #ffe28a 20%, #8affc8 40%, #8ad8ff 60%, #c79bff 80%, #ff8fd0 100%);
  --gutter: clamp(16px, 4vw, 48px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* clip, not hidden: the glows overflow, and iOS lets you pan a hidden overflow. */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2 { margin: 0; font-weight: 900; font-style: italic; letter-spacing: -0.035em; line-height: 0.95; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Film grain over everything: keeps the big gradients from banding. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

/* Foil text: the cards' rainbow, sliding. */
.foil-text {
  background: var(--foil);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-slide 6s linear infinite;
  /* The gradient only paints inside the box: room for the italics leaning out
     on the right and for descenders (the f of "off") below a tight line-height. */
  padding: 0 0.08em 0.18em 0;
}
@keyframes foil-slide { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- Backdrop */

.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); }
.orb-a {
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  right: -10vw;
  top: -10vw;
  opacity: 0.55;
  background: radial-gradient(circle, var(--cta) 0%, rgba(74, 31, 209, 0) 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-b {
  width: 40vw;
  height: 40vw;
  max-width: 600px;
  max-height: 600px;
  right: 20vw;
  bottom: -12vw;
  opacity: 0.28;
  background: radial-gradient(circle, #e0457b 0%, rgba(224, 69, 123, 0) 70%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift { to { transform: translate(-6vw, 4vw) scale(1.1); } }
/* A garage floor: a grid running off to the horizon. */
.floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 50%;
  background-image:
    linear-gradient(rgba(142, 113, 234, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 113, 234, 0.2) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  animation: floor-run 3.5s linear infinite;
}
@keyframes floor-run { to { background-position: 0 64px; } }

/* ---------------------------------------------------------------- Layout */

.page {
  max-width: 1320px;
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) var(--gutter) 0;
  display: flex;
  flex-direction: column;
}
.top { display: flex; }
.logo { height: 32px; width: auto; }

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 32px 0;
}
.hero-copy { max-width: 600px; }
.headline {
  font-size: clamp(52px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-bottom: 28px;
}
.headline .line { display: block; }
/* Its descender room overlaps what follows instead of pushing it down. */
.headline .foil-text { margin-bottom: -0.18em; }
.intro .headline .line {
  opacity: 0;
  transform: translateY(40px) skewY(4deg);
  animation: rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.intro .headline .foil-text { animation: rise 1s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, foil-slide 6s linear infinite; }
@keyframes rise { to { opacity: 1; transform: none; } }
.lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); max-width: 480px; margin-bottom: 32px; }

/* ---------------------------------------------------------------- Join form */

/* As in the app: the field a box with 16 px corners (TextField), the button a
   capsule (borderRadius 999), flat CTA indigo with white bold text. */
.join { position: relative; max-width: 520px; }
.join-field { display: flex; gap: 8px; }
.join input[type='email'] {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--ink);
  font: 500 17px var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.join input[type='email']:focus { border-color: rgba(142, 113, 234, 0.7); box-shadow: 0 0 0 4px rgba(74, 31, 209, 0.25); }
.join input::placeholder { color: rgba(236, 232, 255, 0.38); }
.join .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join button {
  position: relative;
  flex: 0 0 auto;
  height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: 700 16px var(--font);
  cursor: pointer;
  overflow: hidden;
  background: var(--cta);
  box-shadow: 0 8px 30px rgba(74, 31, 209, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: background 0.2s, transform 0.15s;
}
/* A glint runs across the button now and then. */
.join button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sweep 4.5s 1.5s ease-in-out infinite;
}
@keyframes sweep { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.join button:hover { background: var(--cta-hi); }
.join button:active { transform: scale(0.97); }
.join .spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.join.loading .label { opacity: 0; }
.join.loading .spinner { opacity: 1; }
.join-note { padding: 10px 4px 0; font-size: 13px; color: rgba(236, 232, 255, 0.45); }
.join.error .join-note { color: #ff8fa8; }
.join.error .join-field { animation: shake 0.4s; }
.join.error input[type='email'] { border-color: rgba(255, 110, 140, 0.6); }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.join.done .join-field { display: none; }
.join-done {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 20px 0 8px;
  border-radius: 16px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(79, 240, 168, 0.5);
}
.join-done .tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ff0a8, #2bb3ff);
}
.join-done .tick svg { width: 18px; height: 18px; fill: none; stroke: #07060c; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 0.5s 0.15s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Sparks thrown when someone joins. */
.spark {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

/* ---------------------------------------------------------------- Cards */

/* A card is its two published pictures (photo, then frame + nuts + name) with
   the foil between them and the glint on top, as in the app. The pictures
   are 640x800 with the card in the middle 400x560: the layers sit there. */
.card {
  --mx: 0.5;
  --my: 0.5;
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  perspective: 1100px;
  user-select: none;
  -webkit-user-select: none;
}
.card-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(calc(var(--lift) * 30px));
  will-change: transform;
}
/* Phones: flat cards, no 3D layers (main.js sets .flat without a mouse). */
.flat .card { perspective: none; }
.flat .card-tilt { transform: none; transform-style: flat; will-change: auto; }
.flat .card-shadow { transform: translate(0, 18px) scale(0.94); }
.flat .card-glow { transform: scale(1.05); animation-name: breathe-flat; }
@keyframes breathe-flat { 50% { opacity: 0.6; transform: scale(1.12); } }
.card-photo, .card-front { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.card-foil, .card-glint, .card-shadow, .card-glow {
  position: absolute;
  inset: 15% 18.75%;
  border-radius: 10% / 7.15%;
  pointer-events: none;
}
.card-shadow {
  background: #000;
  filter: blur(22px);
  opacity: 0.6;
  transform: translate(calc((0.5 - var(--mx)) * 30px), calc(24px + (0.5 - var(--my)) * 20px)) translateZ(-40px) scale(0.94);
}

/* Foil: the rainbow band the light reveals (CardTileEffects' SHEEN), under
   the frame, plus fine holo lines from Rare up and glitter on Epic and up. */
.card-foil {
  overflow: hidden;
  mix-blend-mode: screen;
  opacity: var(--sheen, 0);
  background: linear-gradient(calc(110deg + (var(--mx) - 0.5) * 30deg),
    transparent 18%, #ff8fd0 32%, #ffe28a 40%, #8affc8 48%, #8ad8ff 56%, #c79bff 64%, transparent 78%);
  background-size: 260% 260%;
  background-position: calc(var(--mx) * 100%) calc(var(--my) * 100%);
}
.card-foil::before, .card-foil::after { content: ''; position: absolute; inset: 0; }
.card[data-rarity='rare'] .card-foil::before,
.card[data-rarity='epic'] .card-foil::before,
.card[data-rarity='legendary'] .card-foil::before {
  background: repeating-linear-gradient(calc(-60deg + (var(--mx) - 0.5) * 20deg),
    rgba(255, 255, 255, 0) 0 3px, rgba(255, 255, 255, 0.18) 3px 4px, rgba(255, 255, 255, 0) 4px 7px);
  mix-blend-mode: overlay;
}
.card[data-rarity='epic'] .card-foil::after,
.card[data-rarity='legendary'] .card-foil::after {
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 0.6px, transparent 1.4px),
    radial-gradient(circle at 70% 60%, #fff 0 0.5px, transparent 1.2px),
    radial-gradient(circle at 40% 80%, #fff 0 0.7px, transparent 1.5px);
  background-size: 23px 29px, 31px 19px, 17px 37px;
  background-position: calc(var(--mx) * -40px) calc(var(--my) * -40px);
  mask-image: radial-gradient(circle at calc(var(--mx) * 100%) calc(var(--my) * 100%), #000 0%, transparent 55%);
  -webkit-mask-image: radial-gradient(circle at calc(var(--mx) * 100%) calc(var(--my) * 100%), #000 0%, transparent 55%);
}
/* RARITY_LIFE in the app's CardTileEffects, a touch stronger: a desktop screen is bigger. */
.card[data-rarity='common'] { --sheen: 0; --glint: 0.3; }
.card[data-rarity='uncommon'] { --sheen: 0.18; --glint: 0.36; }
.card[data-rarity='rare'] { --sheen: 0.26; --glint: 0.42; }
.card[data-rarity='epic'] { --sheen: 0.32; --glint: 0.48; }
.card[data-rarity='legendary'] { --sheen: 0.4; --glint: 0.55; }

/* The glint: a white light where the pointer is, over the frame too. */
.card-glint {
  mix-blend-mode: soft-light;
  opacity: var(--glint);
  background: radial-gradient(circle at calc(var(--mx) * 100%) calc(var(--my) * 100%),
    rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.15) 30%, rgba(0, 0, 0, 0.3) 80%);
}

/* A Legendary breathes a glow in its aura's red (LegendaryGlow). */
.card-glow {
  background: #ff3d6e;
  filter: blur(40px);
  opacity: 0.25;
  transform: translateZ(-60px) scale(1.05);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.6; transform: translateZ(-60px) scale(1.12); } }

/* ---------------------------------------------------------------- Fan */

.fan { position: relative; height: min(70vh, 680px); min-height: 440px; }
.fan-slot { position: absolute; top: 50%; left: 50%; width: min(40vw, 540px); translate: -50% -50%; }
.fan-center { z-index: 3; }
.fan-left, .fan-right { width: min(30vw, 410px); z-index: 1; filter: saturate(0.85) brightness(0.8); transition: filter 0.4s; }
.fan-left { transform: translate(-50%, 4%) rotate(-11deg); }
.fan-right { transform: translate(50%, 4%) rotate(11deg); }
.fan-left:hover, .fan-right:hover { filter: none; }
.intro .fan-slot { opacity: 0; animation: deal 1.1s cubic-bezier(0.2, 0.9, 0.25, 1.1) forwards; }
.intro .fan-center { animation-delay: 0.35s; }
.intro .fan-left { animation-delay: 0.55s; }
.intro .fan-right { animation-delay: 0.65s; }
@keyframes deal {
  from { opacity: 0; translate: -50% -10%; }
  to { opacity: 1; translate: -50% -50%; }
}
/* An idle float, so the cards are alive before anyone moves. */
.fan-center .card { animation: float 6s ease-in-out infinite; }
.fan-left .card { animation: float 7s -2s ease-in-out infinite; }
.fan-right .card { animation: float 6.5s -4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }

/* ---------------------------------------------------------------- Highlights */

.highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.highlight { padding: 32px 32px 40px 0; }
.highlight + .highlight { padding-left: 32px; border-left: 1px solid var(--line); }
.highlight h2 { font-size: clamp(24px, 2.2vw, 30px); margin-bottom: 12px; }
.highlight p { color: var(--muted); font-size: 16px; max-width: 360px; }
.intro .highlight { opacity: 0; animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; transform: translateY(20px); }
.intro .highlight:nth-child(1) { animation-delay: 0.8s; }
.intro .highlight:nth-child(2) { animation-delay: 0.9s; }
.intro .highlight:nth-child(3) { animation-delay: 1s; }
.highlight .foil-text { font-weight: 800; font-style: italic; }
.highlight .num { color: var(--violet); margin-right: 0.2em; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: rgba(236, 232, 255, 0.4);
  font-size: 14px;
}
.footer a { text-decoration: none; }
.footer-links { display: flex; gap: 20px; }
.join-note a { color: inherit; text-underline-offset: 2px; }
.join-note a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- Privacy page */

.legal { max-width: 680px; padding: 48px 0 80px; }
.legal h1 { font-size: clamp(48px, 8vw, 88px); margin-bottom: 12px; }
.legal-updated { color: rgba(236, 232, 255, 0.45); font-size: 14px; margin-bottom: 40px; }
.legal h2 { font-size: 26px; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0; padding-left: 22px; }
.legal li + li { margin-top: 4px; }
.legal a { color: var(--ink); text-underline-offset: 2px; }
.legal strong { color: var(--ink); }
.footer a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; padding-top: 0; gap: 0; }
  .top { justify-content: center; }
  .hero-copy { margin: 0 auto; }
  .lede, .join { margin-left: auto; margin-right: auto; }
  .fan { order: -1; height: min(96vw, 600px); min-height: 0; margin: 0 calc(-1 * var(--gutter)); }
  .fan-slot { width: min(88vw, 520px); }
  .fan-left, .fan-right { width: min(64vw, 380px); }
  .fan-left { transform: translate(-50%, 4%) rotate(-11deg); }
  .fan-right { transform: translate(50%, 4%) rotate(11deg); }
  .highlights { grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
  .highlight, .highlight + .highlight { padding: 24px 0; border-left: 0; }
  .highlight + .highlight { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .logo { height: 26px; }
  .headline { font-size: clamp(46px, 13.5vw, 64px); }
  .join-field { flex-direction: column; }
  .join input[type='email'] { text-align: center; }
  .join-note { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .grain { display: none; }
}
