/* foldypets.com: shared by the waitlist page and /confirmed. Pocket Paper tokens (spec §9.2). */
:root {
  --room: #2a1d36;
  --plum: #3D2A4E;
  --plum-deep: #2E1F3B;
  --cream: #F6EBD3;
  --cream-dim: rgba(246, 235, 211, 0.84);
  --ink: #2A1C34;
  --lamp: #FFB868;
  --glow: #7EF2D6;
  --display: "Fraunces", Georgia, serif;
  --ui: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --gutter: clamp(16px, 6vw, 88px);
}
* { box-sizing: border-box; }
html { background: var(--room); color: var(--cream); scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: var(--room);
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }

/* The live Duo fills the window behind everything. */
#duo {
  position: fixed; left: 0; top: 0;
  width: 100%; height: 100vh; height: 100lvh;
  display: block;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.duo-ready #duo { opacity: 1; }
/* A soft vignette keeps the eye on the Duo and the words readable at the edges. */
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 95% at 62% 52%, transparent 42%, rgba(30, 20, 40, 0.55) 100%);
}
/* Without WebGL, the Pixel Mote stands in for the scene. */
.poster {
  display: none;
  position: fixed; z-index: 0;
  width: min(46vmin, 380px);
  left: 50%; top: 32%;
  transform: translate(-50%, -50%);
  image-rendering: auto;
}
.no-3d .poster { display: block; animation: hop 1.2s steps(2, jump-none) infinite; }
@keyframes hop { 0% { translate: 0 0; } 100% { translate: 0 -3%; } }

.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(16px, 2.6vw, 28px) var(--gutter);
  pointer-events: none;
}
.bar a { pointer-events: auto; text-decoration: none; }
.wordmark {
  font-family: var(--display);
  font-variation-settings: "opsz" 48, "SOFT" 100;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.bar-join {
  font-weight: 800;
  font-size: 0.98rem;
  padding: 6px 0;
  border-bottom: 2px solid rgba(246, 235, 211, 0.35);
  transition: border-color 0.2s, opacity 0.3s;
}
.bar-join:hover { border-color: var(--cream); }
.at-join .bar-join { opacity: 0; pointer-events: none; }

/* The story scrolls over the scene; only its links and the form take the pointer. */
.story { position: relative; z-index: 2; pointer-events: none; }
.story a, .story button, .story input, .story form { pointer-events: auto; }
.beat { position: relative; min-height: 190vh; min-height: 190svh; padding: 0 var(--gutter); }
.cap {
  position: sticky; top: 0;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: min(31rem, 38vw);
  padding: 96px 0 72px;
}

h1, h2 {
  margin: 0 0 0.32em;
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h1 { font-size: clamp(3.4rem, 8.4vw, 7.25rem); }
h2 { font-size: clamp(2.6rem, 5.4vw, 4.75rem); }
.cap p { margin: 0; font-size: clamp(1.08rem, 1.35vw, 1.25rem); color: var(--cream-dim); max-width: 27rem; text-wrap: pretty; }
.cap p + p { margin-top: 0.8em; }

/* The primary paper tab, with a single centre crease (spec §9.2). */
.tab {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-start;
  min-height: 52px; padding: 0 28px; margin-top: 30px;
  border: 0; border-radius: 4px;
  color: var(--ink); text-decoration: none;
  font-family: var(--display); font-variation-settings: "opsz" 36, "SOFT" 100; font-weight: 800; font-size: 1.15rem;
  cursor: pointer;
  background:
    linear-gradient(90deg, rgba(255, 250, 235, 0.12) 0 50%, rgba(255, 255, 255, 0.8) 50% calc(50% + 1px), rgba(95, 60, 25, 0.15) calc(50% + 1px), rgba(95, 60, 25, 0.05) 100%),
    var(--cream) url("paper-cream.webp") 0 0 / 512px;
  box-shadow: inset 0 0 0 1px rgba(90, 60, 30, 0.12), inset 0 -2px 0 rgba(90, 60, 30, 0.1), 0 1px 1px rgba(30, 15, 35, 0.4), 0 12px 22px -8px rgba(10, 6, 16, 0.68);
  transition: transform 0.14s cubic-bezier(0.3, 0.7, 0.4, 1), box-shadow 0.14s;
}
.tab:hover { transform: translateY(-1px); }
.tab:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(90, 60, 30, 0.14), 0 4px 8px -5px rgba(10, 6, 16, 0.6); }

footer {
  position: relative; z-index: 2;
  padding: 28px var(--gutter) 40px;
  font-size: 0.9rem;
  color: rgba(246, 235, 211, 0.6);
  background: var(--plum-deep) url("paper-plum.webp") 0 0 / 512px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}

/* Narrow or portrait windows: the Duo sits in the upper part, the words underneath. */
@media (max-width: 759.98px), (max-aspect-ratio: 109/100) {
  .cap {
    max-width: none;
    justify-content: flex-end;
    padding: 0 0 max(30px, env(safe-area-inset-bottom));
  }
  .vignette {
    background:
      linear-gradient(to top, var(--room) 0 27%, rgba(42, 29, 54, 0.86) 40%, rgba(42, 29, 54, 0) 56%),
      radial-gradient(130% 70% at 50% 30%, transparent 45%, rgba(30, 20, 40, 0.5) 100%);
  }
  h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  h2 { font-size: clamp(2.3rem, 10.5vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #duo { transition: none; }
  .no-3d .poster { animation: none; }
}
