/* Wishboard — product site v2
   One screen, no scrolling: logo / headline, subtext, phone / footer.
   The phone takes the height that's left and fades out at the bottom. */

:root {
  --ink: #1c1c1c;
  --soft: #7a746c;        /* supporting copy */
  --faint: #a39d95;       /* footer */
  --warm: #f8f4f3;        /* page */

  --display: "Instrument Serif", ui-serif, Georgia, serif;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);   /* the app's motion curve */
  --gutter: clamp(20px, 2.8vw, 40px);
  /* top of the logo = bottom of the footer text */
  --edge: clamp(18px, 2.2vw, 30px);
  --gutter-l: max(var(--gutter), env(safe-area-inset-left));
  --gutter-r: max(var(--gutter), env(safe-area-inset-right));

  /* Phone width: from the window's width, but never so wide that too little
     of it shows above the footer on a short window */
  --pw: clamp(220px, min(18vw, 34svh), 340px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--warm);
}

/* Three bands: logo, hero, footer. Exactly one screen tall; on very short
   windows (phones on their side) it may scroll rather than squash. */
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--warm);
  color: var(--ink);
  font-family: var(--rounded);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
@media (min-height: 560px) {
  html:not(.doc), html:not(.doc) body { height: 100svh; overflow: hidden; }
}
/* Long pages (html.doc, e.g. privacy/) scroll like a normal page */

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

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

/* ---------- Logo ---------- */

.top {
  display: flex;
  align-items: center;
  padding: max(var(--edge), env(safe-area-inset-top)) var(--gutter-r) 0 var(--gutter-l);
}

/* assets/img/logo.svg. Both logos are boxes the size of the visible
   wordmark + asterisk (1313 × 263 in the SVG); the image overflows them by
   the room its canvas leaves for the asterisk's shadow. */
.logo {
  position: relative;
  display: block;
  width: clamp(94px, 7.2vw, 108px);
  aspect-ratio: 1313 / 263;
}

.logo img,
.demo-logo img {
  position: absolute;
  left: 0;
  top: -71.86%;      /* asterisk top sits at y 189 of the 668 canvas */
  width: 115.61%;    /* 1518 / 1313 */
  height: auto;
  max-width: none;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(8px, 5svh, 64px) var(--gutter-r) 0 var(--gutter-l);
}

/* Instrument Serif is tall and narrow, so it runs large; sized from the
   window's height as well as its width so the page always fits. */
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(35px, min(4.32vw, 8svh), 77px);
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
}

.sub {
  margin: clamp(12px, 2.2svh, 22px) auto 0;
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.45;
  color: var(--soft);
}

/* ---------- Breadcrumb (support/, privacy/) ---------- */

/* wishboard / support — where you are, and the way back home */
.crumbs ol {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 clamp(18px, 3svh, 28px);
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--faint);
}
.crumbs li + li::before { content: "/"; margin-right: 8px; color: #cdc6bd; }
.crumbs [aria-current] { color: var(--soft); }
.crumbs a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--ink); }

/* ---------- Reading pages (privacy/, support/) ----------
   One left-aligned column, 680px at most. Serif for the title and section
   headings, the rounded sans for everything else. */

.doc-page {
  width: 100%;
  max-width: calc(680px + var(--gutter-l) + var(--gutter-r));
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) var(--gutter-r) clamp(72px, 9vw, 112px) var(--gutter-l);
}
.doc-page .crumbs ol { justify-content: flex-start; }

.doc-body {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(28, 26, 23, 0.85);
  overflow-wrap: anywhere;   /* long URLs and emails never push the page sideways */
}
.doc-body h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
}
/* .doc-body .x so these win over the general ".doc-body p" margins */
.doc-body .doc-updated {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--soft);
}
.doc-body .doc-summary { margin: 28px 0 0; }   /* same type as the body; set apart by space and the rule below */
.doc-body hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid rgba(28, 26, 23, 0.1);
}
.doc-body h2 {
  margin: 48px 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1.2;
  color: var(--ink);
  scroll-margin-top: 24px;   /* #data-retention etc. land with a little air */
}
.doc-body h3 {
  margin: 28px 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.doc-body p { margin: 0 0 16px; }
.doc-body h2 + p, .doc-body h3 + p { margin-top: 0; }
.doc-body ul { margin: 0 0 16px; padding-left: 1.25em; }
.doc-body li { margin: 0 0 8px; padding-left: 0.2em; }
.doc-body li::marker { color: var(--faint); }
.doc-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(28, 26, 23, 0.25);
}
.doc-body a:hover { text-decoration-color: currentColor; }

/* ---------- Phone ---------- */

/* The rest of the screen. The phone runs past its bottom edge and fades
   out into the page above the footer. */
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: clamp(20px, 4svh, 44px) 0 clamp(24px, 6svh, 64px);   /* bottom: clear air between the faded phone and the footer */
  padding-top: 2px;   /* room for the phone's top edge highlight */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - clamp(75px, 15svh, 164px)), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - clamp(75px, 15svh, 164px)), transparent);
}

.tilt { perspective: 1600px; }

.phone {
  position: relative;
  width: var(--pw);
  aspect-ratio: 1133 / 2361;
  transform-origin: 50% 30%;
  will-change: transform;
  /* a simple translucent body: the warm background shows
     faintly through the edge around the screen */
  border-radius: calc(var(--pw) * 0.155);
  background: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 24px 60px -28px rgba(0, 0, 0, 0.12);
}

/* The screen sits inside the body with an even edge of 4.4% of the phone's
   width all round (the design's slot was ~3.5%). Vertical values are that
   edge as a share of the height (width × 2361 / 1133). Corner = body corner
   minus the edge, so the curves stay parallel. */
.screen {
  position: absolute;
  left: 4.4%;
  top: 2.111%;
  width: 91.2%;
  height: 95.778%;
  border-radius: calc(var(--pw) * 0.111);
  overflow: hidden;
  background: #fff;
  container-type: inline-size;
}

/* ---------- Demo on the screen (assets/demo.js) ----------
   Positions come from the Figma storyboard in 279-unit screen coordinates;
   --u (px per unit) is set by demo.js from the screen's width. */

.demo {
  --u: 1px;
  position: absolute;
  inset: 0;
}

.demo-item {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  will-change: transform, opacity;
}
.demo-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Figma: drop shadow, black 10%, blur ≈ 15% of the item's width */
  filter: drop-shadow(0 0 var(--shadow, 10px) rgba(0, 0, 0, 0.1));
}
.demo-item:has(img.is-cropped) { overflow: hidden; }
.demo-item img.is-cropped { position: absolute; top: 0; max-width: none; }

.demo-logo {
  position: absolute;
  left: calc(var(--u) * 103.8);   /* centred: 139 − width / 2 */
  top: calc(var(--u) * 23);
  width: calc(var(--u) * 70.4);
  aspect-ratio: 1313 / 263;
  opacity: 0;
}

/* The app's filter bar (ContentView.filterBar / HamburgerButton /
   FilterPill), at 0.69 screen units per point: menu icon at 26pt, pills from
   68pt, 8pt apart; pill text 12pt mono medium, 0.6pt tracking, padded
   14 × 8pt. Row centred 68 units down. */
.demo-bar {
  position: absolute;
  left: 0;
  top: calc(var(--u) * 57.5);
  width: 100%;
  height: calc(var(--u) * 20.8);
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 5.52);
  padding-left: calc(var(--u) * 47);
  opacity: 0;
}
.demo-menu {
  position: absolute;
  left: calc(var(--u) * 17.9);
  top: 50%;
  width: calc(var(--u) * 16.56);
  height: calc(var(--u) * 16.56);
  translate: 0 -50%;
}
.demo-chip {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 calc(var(--u) * 9.66);
  border: calc(var(--u) * 0.69) solid #e5e5e5;
  border-radius: 999px;
  background: #fff;
  color: #1c1c1c;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-size: calc(var(--u) * 8.28);
  letter-spacing: calc(var(--u) * 0.41);
  line-height: 1;
  white-space: nowrap;
}
.demo-chip.is-active { background: #1c1c1c; border-color: #1c1c1c; color: #fff; }

.demo-meta {
  position: absolute;
  left: calc(var(--u) * 87);
  top: calc(var(--u) * 371);
  width: calc(var(--u) * 106);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 4.642);
  font-family: var(--rounded);
  white-space: nowrap;
  opacity: 0;
}
.demo-name { margin: 0; font-size: calc(var(--u) * 9.285); color: #000; }
.demo-sub { margin: 0; font-size: calc(var(--u) * 7.737); color: #5f5f63; }
.demo-sub .dot { margin: 0 calc(var(--u) * 4); }


/* ---------- Footer ---------- */

/* Copyright and links together on the left, the App Store note on the right */
.site-footer {
  display: grid;
  grid-template-columns: auto auto 1fr;
  column-gap: clamp(20px, 2.2vw, 32px);
  align-items: baseline;
  row-gap: 12px;
  padding: clamp(10px, 1.6svh, 16px) var(--gutter-r) max(var(--edge), env(safe-area-inset-bottom)) var(--gutter-l);
  font-size: 14px;
  line-height: 1.4;
  color: var(--faint);
}
.footer-note { justify-self: start; white-space: nowrap; }
.footer-soon { justify-self: end; }
.footer-links { display: flex; gap: clamp(20px, 2.2vw, 32px); }
/* links look exactly like the plain-text items next to them */
.footer-links a { color: inherit; text-decoration: none; }

/* ---------- Motion ----------
   One load sequence: headline settles, subtext follows, the phone rises;
   then the screen runs its own demo loop. */

@keyframes rise   { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes phone-in { from { opacity: 0; translate: 0 60px; } to { opacity: 1; translate: 0 0; } }

.js .top        { animation: fade 0.9s var(--ease) both; }
.js h1          { animation: rise 1s var(--ease) 0.05s both; }
.js .sub        { animation: rise 1s var(--ease) 0.18s both; }
.js .phone-in   { animation: phone-in 1.2s var(--ease) 0.3s both; }
.js .site-footer { animation: fade 0.9s var(--ease) 0.4s both; }
.js .crumbs     { animation: fade 0.9s var(--ease) both; }

/* ---------- Peel-off stickers (physics.js, experiment) ---------- */

.drop-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 4;
  overflow: clip;
  pointer-events: none;      /* clicks pass through to the page… */
}

.drop-item {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;      /* …except on the stickers themselves */
  touch-action: none;        /* dragging a sticker doesn't scroll the page */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}
.drop-item.is-dragging { cursor: grabbing; z-index: 2; }

.drop-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  transition: scale 0.35s var(--ease), opacity 0.25s var(--ease), filter 0.3s var(--ease);
}
/* While peeling, the shadow deepens as the sticker lifts off the screen
   (--lift 0–1, set per frame by physics.js) */
.drop-item.is-peeling img {
  transition: none;
  filter: drop-shadow(0 calc(2px + 14px * var(--lift, 0)) calc(6px + 16px * var(--lift, 0))
          rgb(0 0 0 / calc(0.12 + 0.08 * var(--lift, 0))));
}
.drop-item.is-dragging img {
  scale: 1.06;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18));
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  /* Narrow enough that most of the phone shows above the footer and it
     keeps a phone's proportions (Safari's address bar takes a lot of the
     height), wide enough that it still runs past the bottom and fades out */
  :root { --pw: clamp(200px, min(62vw, 36svh), 300px); }
  .top { justify-content: center; }
  .hero { padding-top: clamp(8px, 3svh, 32px); }
  .stage { margin-top: clamp(16px, 3svh, 28px); }
  h1 { font-size: clamp(32px, min(10vw, 6.8svh), 48px); }
  .sub { font-size: 15px; }
  /* a shorter fade and almost no gap above the footer, so the phone keeps
     the height */
  .stage {
    margin-bottom: 4px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 10svh), transparent);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 10svh), transparent);
  }
  /* everything centred: links on one row, copyright and App Store note on
     the next */
  .site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 18px;
    padding-top: 4px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    font-size: 13px;
    text-align: center;
  }
  .footer-links { flex-basis: 100%; justify-content: center; order: -1; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
