/* Poof website. One stylesheet, no web fonts, no scripts.
   Colours follow apps/mobile/src/ui/tokens.ts ("a one-time ticket stub"):
   page background = the launch screen colour, one accent ("Stamp Ink"),
   monospace for everything the machine generates (addresses, codes). */

:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #e9ebf3;
  --text: #000000;
  --muted: #575a63;
  --accent: #1f3a93;
  --on-accent: #ffffff;
  --code-tint: #e4e8f4;
  --rule: #c6c6c8;
  --watch: #8a5100;
  --shadow: rgba(31, 58, 147, 0.16);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 68ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10121a;
    --surface: #1c1d24;
    --surface-2: #262833;
    --text: #ffffff;
    --muted: #a7a8b0;
    --accent: #8fa8ff;
    --on-accent: #0b1230;
    --code-tint: #1f2742;
    --rule: #3a3c46;
    --watch: #ffb340;
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--sans);
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 0.75rem;
}

/* ---- Site header and footer ------------------------------------------- */

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font: 700 1.25rem/1 var(--display);
  letter-spacing: -0.01em;
}

.brand svg {
  width: 1.9rem;
  height: auto;
  color: var(--accent);
}

.site-nav ul,
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a,
.site-footer a {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0;
  display: inline-block;
}

.site-nav a:hover,
.site-footer a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p {
  margin: 0;
}

/* ---- Landing ---------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(1.5rem, 6vh, 4.5rem) 0 clamp(2rem, 6vh, 4rem);
}

.hero h1 {
  font: 800 clamp(2.4rem, 1.4rem + 4.2vw, 4.25rem)/1.02 var(--display);
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
  max-width: 13ch;
}

.hero .lede {
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 34rem;
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.4rem;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
}

.store-button:hover {
  text-decoration: underline;
}

.store-note {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The ticket stub: an address above a torn edge, a code below it. */
.stub {
  position: relative;
  max-width: 26rem;
  width: 100%;
  justify-self: end;
  transform: rotate(-1.5deg);
  /* On the parent so the shadow follows the clipped, torn outline. */
  filter: drop-shadow(0 0 0.5px var(--rule)) drop-shadow(0 14px 28px var(--shadow));
}

.stub-top,
.stub-bottom {
  background: var(--surface);
  padding: 1.4rem 1.5rem;
}

.stub-top {
  border-radius: 18px 18px 0 0;
  padding-bottom: 1.9rem;
  /* Zigzag tear along the bottom edge, the same edge as the app icon. */
  clip-path: polygon(
    0 0, 100% 0, 100% calc(100% - 10px),
    95% 100%, 90% calc(100% - 10px), 85% 100%, 80% calc(100% - 10px), 75% 100%,
    70% calc(100% - 10px), 65% 100%, 60% calc(100% - 10px), 55% 100%, 50% calc(100% - 10px),
    45% 100%, 40% calc(100% - 10px), 35% 100%, 30% calc(100% - 10px), 25% 100%,
    20% calc(100% - 10px), 15% 100%, 10% calc(100% - 10px), 5% 100%, 0 calc(100% - 10px)
  );
}

.stub-bottom {
  margin-top: 0.6rem;
  border-radius: 0 0 18px 18px;
  background: var(--code-tint);
  clip-path: polygon(
    0 10px, 5% 0, 10% 10px, 15% 0, 20% 10px, 25% 0, 30% 10px, 35% 0, 40% 10px, 45% 0,
    50% 10px, 55% 0, 60% 10px, 65% 0, 70% 10px, 75% 0, 80% 10px, 85% 0, 90% 10px, 95% 0,
    100% 10px, 100% 100%, 0 100%
  );
  padding-top: 1.8rem;
}

.stub-label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.address {
  font: 500 clamp(1rem, 0.85rem + 0.8vw, 1.3rem)/1.3 var(--mono);
  margin: 0;
  word-break: break-all;
}

.code {
  font: 700 clamp(2.6rem, 2rem + 3vw, 3.6rem)/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0.15rem 0 0.6rem;
}

.stub-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 2.25rem 0 0;
  border-top: 1px solid var(--rule);
}

.facts div {
  margin: 0;
}

.facts dt {
  font-weight: 650;
  font-size: 1.0625rem;
  margin-bottom: 0.35rem;
}

.facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.96875rem;
}

/* ---- Long-form pages (privacy, terms, support, acknowledgements) ------ */

.doc {
  max-width: var(--measure);
  padding: 1.5rem 0 0;
}

.doc h1 {
  font: 800 clamp(2rem, 1.5rem + 2.4vw, 3rem)/1.08 var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.doc .meta {
  color: var(--muted);
  margin: 0 0 2rem;
}

.doc h2 {
  font: 700 1.5rem/1.25 var(--display);
  letter-spacing: -0.015em;
  margin: 3rem 0 0.75rem;
  scroll-margin-top: 1rem;
}

.doc h3 {
  font: 650 1.1875rem/1.3 var(--display);
  margin: 2rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

.doc p,
.doc ul,
.doc ol,
.doc dl {
  margin: 0 0 1rem;
}

.doc li {
  margin-bottom: 0.4rem;
}

.doc li > ul {
  margin-top: 0.4rem;
}

.doc code,
.doc kbd,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.summary {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.1rem 1.35rem;
  margin: 0 0 2rem;
}

.summary p:last-child,
.summary ul:last-child {
  margin-bottom: 0;
}

.toc {
  margin: 0 0 2rem;
  padding: 1rem 1.35rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.toc h2 {
  font-size: 1.0625rem;
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0 0 0.75rem;
  padding-left: 1.4rem;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc li {
  margin-bottom: 0.25rem;
  break-inside: avoid;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
  line-height: 1.45;
}

caption {
  text-align: left;
  padding: 0.85rem 1rem 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

thead th {
  font-weight: 650;
  background: var(--surface-2);
}

tbody th {
  font-weight: 600;
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

.placeholder {
  background: var(--code-tint);
  color: var(--watch);
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 0 0.25em;
  border-radius: 4px;
}

/* Support FAQ: each question is a heading so it can be linked from the app. */
.faq h3 {
  margin-top: 2.25rem;
}

.contact-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  margin: 2.5rem 0 0;
}

.contact-card h2 {
  margin-top: 0;
}

/* Acknowledgements */
.license-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--rule);
}

.license-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

.pkg {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
}

.pkg-version {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
  margin-left: 0.4rem;
}

.pkg-notice {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

pre.license-text {
  white-space: pre-wrap;
  font: 0.8125rem/1.5 var(--mono);
  background: var(--surface);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
  max-height: 32rem;
  overflow: auto;
}

details {
  margin: 0.35rem 0 0;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.875rem;
}

/* ---- 404 --------------------------------------------------------------- */

.not-found {
  padding: 3rem 0 0;
  max-width: 40rem;
}

.not-found .code {
  font-size: clamp(3rem, 2rem + 6vw, 5.5rem);
  margin-bottom: 1rem;
}

/* ---- Responsive -------------------------------------------------------- */

/* Real captures in a phone outline: the video first, then three screens. */
.showcase {
  padding: clamp(1.5rem, 5vh, 3.5rem) 0 clamp(2rem, 6vh, 4rem);
}

.showcase h2 {
  font: 800 clamp(1.8rem, 1.2rem + 2.4vw, 2.75rem)/1.05 var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}

.showcase-lede {
  color: var(--muted);
  font-size: 1.125rem;
  margin: 0 0 2rem;
  max-width: 34rem;
}

.phones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

.phone {
  margin: 0;
}

.phone img,
.phone video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9% / 4.2%;
  border: 6px solid #14161e;
  background: #14161e;
  box-shadow: 0 18px 40px var(--shadow);
}

.phone p {
  margin: 0.9rem 0 0;
  font-weight: 600;
  font-size: 1rem;
}

.phone-video {
  transform: translateY(-0.75rem);
}

@media (max-width: 60rem) {
  .phones {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(15rem, 62%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
  }

  .phone {
    scroll-snap-align: start;
  }

  .phone-video {
    transform: none;
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 46rem) {

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 1rem;
  }

  .stub {
    justify-self: start;
    transform: none;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  th,
  td {
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 22rem) {
  body {
    font-size: 1rem;
  }

  .stub-top,
  .stub-bottom {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .stub {
    animation: settle 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .stub-bottom {
    animation: tear 700ms 250ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: rotate(-4deg) translateY(12px);
    }
  }

  @keyframes tear {
    from {
      transform: translateY(-0.6rem);
    }
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 46rem) {
  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}

@media print {
  .site-nav,
  .skip,
  .toc {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
