/* Sundrop landing page. Every value here is lifted from the app: Polymath
   from the bundle, ink #222222, the paywall's accent-blue capsule, the five
   brand shapes, and the sticker board's spring-in entrance. */

@font-face {
  font-family: "Polymath Display";
  src: url("/assets/fonts/polymath-display-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Polymath Display";
  src: url("/assets/fonts/polymath-display-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Polymath";
  src: url("/assets/fonts/polymath-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Polymath";
  src: url("/assets/fonts/polymath-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #222222;
  --ink-muted: rgba(0, 0, 0, 0.5); /* black at 50%, same as the app */
  --accent: #4f6aff;
  --paper: #ffffff;
  --display: "Polymath Display", "Polymath", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --text: "Polymath", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

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

.sticker-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.landing-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.wordmark {
  position: absolute;
  z-index: 6;
  top: 40px;
  left: 48px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* The wall ------------------------------------------------------------- */

.wall {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.seat {
  position: absolute;
  top: var(--y);
  left: var(--x);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  /* The wall ignores the pointer; the pieces themselves answer to hover. */
  pointer-events: auto;
}

.seat img {
  display: block;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.seat.shape img {
  width: var(--w);
  height: auto;
}

.seat.cutout img {
  width: auto;
  height: var(--h);
  filter: url("#sticker");
}

/* Hover: a brand shape spins clockwise (script-driven so it finishes its
   turn on the way out); a photo sticker tilts a touch and springs back. */
.seat.cutout {
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seat.cutout:hover {
  transform: translate(-50%, -50%) rotate(calc(var(--r, 0deg) + 7deg));
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--s0, 0.3));
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.pop {
  animation: pop 300ms cubic-bezier(0.2, 1.25, 0.4, 1) both;
  animation-delay: var(--d, 0s);
}

.pop.pending {
  animation-play-state: paused;
}

/* The copy ------------------------------------------------------------- */

.hero {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(800px, calc(100% - 48px));
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform: translate(-50%, -50%);
  text-align: center;
}

h1,
.hero p {
  margin: 0;
}

h1 {
  width: 100%;
  font-family: var(--display);
  /* Tracks the viewport's short side too, so laptop windows keep one screen. */
  font-size: clamp(64px, min(7.8vw, 12.4vh), 112px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.hero p {
  max-width: 600px;
  color: var(--ink-muted);
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  text-wrap: pretty;
}

/* The button: the paywall's accent-blue capsule. With a mouse it grows into
   a card holding the App Store QR code — the same reveal as trysabbath.com. */

.cta-shell {
  position: relative;
  z-index: 5;
  width: 198px;
  height: 56px;
  margin-top: 12px;
}

.cta {
  position: absolute;
  z-index: 1;
  right: 50%;
  bottom: 0;
  display: inline-flex;
  width: 198px;
  height: 56px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #ffffff;
  background: var(--accent);
  border-radius: 1000px;
  text-decoration: none;
  white-space: nowrap;
  isolation: isolate;
  transform: translateX(50%);
  box-shadow: 0 0 0 rgba(34, 34, 34, 0);
  transition:
    width 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    height 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    border-radius 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 280ms ease;
}

.cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.cta-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.005em;
  transition: opacity 140ms ease;
}

.cta-apple {
  width: 18px;
  height: 18px;
  margin-top: -2px;
  flex: 0 0 auto;
}

.cta-qr {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease 80ms;
}

/* The code sits on a white tile so any phone camera reads it off the blue card. */
.qr-tile {
  display: block;
  padding: 8px;
  background: #ffffff;
  border-radius: 16px;
}

.cta-qr img {
  display: block;
  width: 184px;
  height: 184px;
}

.cta-caption {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
}

/* The footer ----------------------------------------------------------- */

.site-footer {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 28px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}

/* Pointer devices: the QR reveal --------------------------------------- */

@media (hover: hover) and (pointer: fine) {
  .cta-shell::before {
    position: absolute;
    z-index: 0;
    right: 50%;
    bottom: -4px;
    width: 206px;
    height: 64px;
    border-radius: 1000px;
    content: "";
    transform: translateX(50%);
  }

  .cta-shell:hover::before,
  .cta-shell:has(:focus-visible)::before {
    width: 272px;
    height: 312px;
    border-radius: 32px;
  }

  .cta-shell:hover .cta,
  .cta-shell:has(:focus-visible) .cta {
    width: 264px;
    height: 304px;
    border-radius: 28px;
    box-shadow:
      0 60px 140px -20px rgba(34, 34, 34, 0.32),
      0 30px 80px -10px rgba(34, 34, 34, 0.2),
      0 8px 24px rgba(34, 34, 34, 0.16);
  }

  .cta-shell:hover .cta-text,
  .cta-shell:has(:focus-visible) .cta-text {
    opacity: 0;
  }

  .cta-shell:hover .cta-qr,
  .cta-shell:has(:focus-visible) .cta-qr {
    opacity: 1;
  }
}

/* Desktop: one screen, no scroll ---------------------------------------- */

@media (min-width: 1024px) {
  html,
  body {
    overscroll-behavior-y: none;
  }

  .landing-page {
    height: 100vh;
    height: 100svh;
    min-height: 560px;
  }
}

/* Phones and small tablets ---------------------------------------------- */

@media (max-width: 1023px) {
  .wordmark {
    top: 24px;
    left: 24px;
    font-size: 24px;
    line-height: 28px;
  }

  .seat {
    top: var(--my, var(--y));
    left: var(--mx, var(--x));
  }

  .seat.desktop-only {
    display: none;
  }

  .seat.shape img {
    width: var(--mw, var(--w));
  }

  .seat.cutout img {
    height: var(--mh, var(--h));
  }

  .hero {
    width: calc(100% - 48px);
    gap: 18px;
  }

  h1 {
    font-size: clamp(42px, 13.5vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.02em;
  }

  .hero p {
    max-width: 420px;
    font-size: 17px;
    line-height: 24px;
  }

  .cta-shell {
    margin-top: 10px;
  }

  .site-footer {
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pop {
    animation: none;
  }

  .seat.cutout {
    transition: none;
  }

  .seat.cutout:hover {
    transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  }

  .cta,
  .cta-text,
  .cta-qr {
    transition: none;
  }
}
