/*
  Pavio website.
  Colours, type and shapes follow Pavio's design system (R2 handoff, recorded in DESIGN.md in the
  app repository): cream canvas, warm ink, DM Sans, hairline edges, generous radii, no shadows.
  No animation, no scripts.
*/

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-sans-4004-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/dm-sans-4004-500.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/dm-sans-4004-600.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* R2 light palette */
  --bg: #f9f7f3;
  --ink: #1c1712;
  --soft: #706b64;
  --card: #fefdfb;
  --muted: #f3f0ea;
  --hairline: #e5e3de;
  --border: #e0ded8;
  --focus: #63533a;
  --gold: #ceac64;

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wide: 74rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 4.5vw, 3rem);
  --section: clamp(4.5rem, 11vw, 9rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* At very large text sizes a single word can be wider than a phone; let it break instead
     of pushing the page sideways. Normal line breaking is unaffected. */
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

/* An email address has no natural break; at very large text sizes let it wrap anywhere. */
a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

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

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Skip link: off screen until focused. */
.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 10;
  transform: translateY(-120%);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus-visible {
  transform: translateY(0.75rem);
}

/* Eyebrow labels (design.css .eyebrow, lifted for reading on the web). */
.eyebrow {
  color: var(--soft);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* Header */
.site-header {
  padding-block: 1.5rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.wordmark {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.site-nav {
  min-width: 0;
}

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

.site-nav a {
  display: inline-block;
  padding-block: 0.6rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Hero */
.hero {
  padding-block: clamp(3rem, 10vw, 8rem) var(--section);
}

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

.hero h1 {
  max-width: 13.5em;
  margin-top: 1.25rem;
  /* Fluid but text-relative: the maximum stays under 2.5 times the minimum, so browser zoom
     can still double it, and at 200% text the words fit a typical phone. */
  font-size: clamp(2.25rem, 0.9rem + 6.4vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero h1 span {
  display: block;
}

.hero h1 span + span {
  color: var(--soft);
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 36rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.lead {
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.45;
}

.hero-body .lead + p {
  color: var(--soft);
}

/* "In development" marker. The dashed ring echoes the app's in-progress day. */
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.65rem;
  margin-top: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

.status-chip {
  max-width: 100%;
}

.status-chip > span:last-child {
  min-width: 0;
}

.status-chip .ring {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px dashed var(--ink);
  border-radius: 50%;
}

/* Editorial sections: a label column and a reading column on wide screens. */
.section {
  border-top: 1px solid var(--hairline);
  padding-block: var(--section);
}

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

.section-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: var(--measure);
}

.section h2 {
  font-size: clamp(1.625rem, 1.35rem + 2.2vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.section-body > p {
  max-width: var(--measure);
}

.section-body .intro {
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  line-height: 1.55;
}

/* Four plain text points with a hairline above each: not cards, no icons. */
.points {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.25rem 3rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.points li {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.points h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.points p {
  color: var(--soft);
}

/* The "why" statement is set large, as the section's heading. */
.statement h2 {
  max-width: 18em;
  font-size: clamp(2rem, 1.25rem + 3.2vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.statement h2 span {
  color: var(--soft);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.contact h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

/* Development previews (app screenshots), when supplied: phone-shaped, hairline frame. */
.previews {
  display: grid;
  gap: 2rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.preview {
  margin: 0;
  display: grid;
  gap: 0.85rem;
  justify-items: start;
}

.preview img {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 2rem;
  background: var(--card);
}

.preview figcaption {
  color: var(--soft);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 3rem 3.5rem;
  color: var(--soft);
  font-size: 0.9375rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.footer-inner .wordmark {
  font-size: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-block;
  padding-block: 0.35rem;
  font-weight: 500;
}

/* Prose pages (privacy). */
.page {
  padding-block: clamp(2.5rem, 8vw, 6rem) var(--section);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 1rem;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  max-width: var(--measure);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.page-header h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.page-header .lead {
  font-weight: 400;
}

.prose {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  max-width: var(--measure);
}

.prose h2 {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.prose ul {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
}

.prose li::marker {
  color: var(--soft);
}

.prose .meta {
  color: var(--soft);
  font-size: 0.9375rem;
}

/* Review-only markers for facts still to be supplied. tools/check.mjs --publish fails while
   any element with data-pending remains, so none can reach the published site. */
.pending {
  padding: 0.1em 0.4em;
  border: 1px dashed var(--gold);
  border-radius: 0.4rem;
  background: #fbf3df;
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.preview-note {
  border-bottom: 1px dashed var(--gold);
  background: #fbf3df;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.preview-note .wrap {
  padding-block: 0.65rem;
}

/* Wider screens */
@media (min-width: 48rem) {
  .points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .previews {
    grid-template-columns: repeat(2, minmax(0, 20rem));
  }

  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 3rem;
  }

  .footer-inner .operator {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .section-grid {
    grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: clamp(3rem, 6vw, 6rem);
  }

  .section-label {
    padding-top: 0.6rem;
  }

  .section-body {
    max-width: 48rem;
  }

  /* The hero and the prose pages share the sections' reading column, so one vertical line
     runs through every page. */
  .hero-grid,
  .page-grid {
    grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: clamp(3rem, 6vw, 6rem);
  }

  .hero-grid > .eyebrow,
  .hero-grid > h1 {
    grid-column: 1 / -1;
  }

  .hero-grid > .hero-body,
  .page-grid > .page-header,
  .page-grid > .prose {
    grid-column: 2;
  }

  .page-grid > .page-label {
    grid-column: 1;
    grid-row: 1;
    padding-top: 0.6rem;
  }
}
