/* Resiboo public site. Same world as the app (DESIGN.md): receipt slips on a counter. Dark by default, light when the phone is. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Azeret Mono";
  src: url("/fonts/azeret-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #15131b;
  --paper: #25222d;
  --shade: #2d2a36;
  --fg: #f5f3f7;
  --legit: #a99cff;
  --danger: #ff6b6b;
  --brand: #c2410c;
  --on-brand: #fff;
  --tape: #e9dba8;
  --highlighter: #ffc145;
  --slip-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), 0 10px 24px -8px rgb(0 0 0 / 0.55);
  --font-display: "Archivo", system-ui, sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, monospace;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #e8e9e3;
    --paper: #fbfbf8;
    --shade: #eef0e9;
    --fg: #1d1b22;
    --legit: #4b34c9;
    --danger: #c8102e;
    --slip-shadow: inset 0 0 0 1px rgb(29 27 34 / 0.07), 0 8px 20px -10px rgb(29 27 34 / 0.22);
  }
}
/* Faint ink for secondary copy: 68% of the foreground is about 5.5:1 on both paper and counter. */
:root {
  --muted: color-mix(in oklab, var(--fg) 68%, transparent);
  --rule: color-mix(in oklab, var(--fg) 30%, transparent);
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--font-body);
  /* viewport-fit=cover paints under the notch; pad it back. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
img,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--highlighter);
  color: #1d1b22;
}
html {
  scrollbar-color: color-mix(in oklab, var(--fg) 30%, transparent) var(--bg);
}
.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  font-stretch: 75%;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
.print {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}

/* Layout */
.wrap {
  width: min(100% - 2.5rem, 46rem);
  margin-inline: auto;
}
.wrap-wide {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  font-stretch: 75%;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
/* The app icon's torn receipt slip, stamped "R" (components/Brand.tsx in the app). */
.mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 2.6rem;
  padding-top: 0.45rem;
  box-sizing: border-box;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 90%, 87.5% 100%, 75% 90%, 62.5% 100%, 50% 90%, 37.5% 100%, 25% 90%, 12.5% 100%, 0 90%);
  transform: rotate(-6deg);
  color: var(--brand);
}
.mark span {
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-stretch: 62%;
  font-size: 1rem;
  line-height: 1;
  padding: 0.12rem 0.22rem;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(-10deg);
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.nav a:not(.btn) {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Buttons: orange primary, ink-outline ghost */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.5rem;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1), filter 150ms;
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-sm {
  min-height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.9375rem;
}
.btn-ghost {
  background: var(--paper);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--rule);
}

/* Hero */
.hero {
  padding-block: clamp(2rem, 6vw, 4.5rem) 1rem;
}
.hero h1 {
  font-size: clamp(3.4rem, 15vw, 6rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero .en {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.875rem, 3.6vw, 1.0625rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d1b22;
  background: color-mix(in oklab, var(--highlighter) 85%, transparent);
  border-radius: 2px;
}
.hero .lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 3.8vw, 1.25rem);
  line-height: 1.5;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
}
.cta-row .print {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* The slip: raised paper, offset shadow. .receipt adds the torn bottom edge. */
.slip {
  position: relative;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: var(--slip-shadow);
  padding: clamp(1.25rem, 4vw, 2rem);
}
.receipt {
  --tear: 7px;
  padding-bottom: calc(var(--tear) + 1.5rem);
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tear) * 2) var(--tear) repeat-x,
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tear) + 0.5px) no-repeat;
}
/* The mask would clip the shadow, so a receipt sits in a wrapper that carries it. */
.shadowed {
  filter: drop-shadow(0 10px 14px rgb(0 0 0 / 0.3));
}
@media (prefers-color-scheme: light) {
  .shadowed {
    filter: drop-shadow(0 8px 12px rgb(29 27 34 / 0.16));
  }
}
.tape {
  position: absolute;
  z-index: 2;
  width: 4.5rem;
  height: 1.25rem;
  background: color-mix(in oklab, var(--tape) 80%, transparent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}
.perf {
  border: 0;
  border-top: 2px dashed var(--rule);
  margin: 0;
}

/* The hero's receipt: the Remotion loop, taped on. */
.demo {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  position: relative;
  transform: rotate(-0.8deg);
}
.demo .slip {
  padding: 0;
  overflow: hidden;
}
.demo video,
.demo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: var(--paper);
}
.demo .tape.a {
  top: -0.6rem;
  left: 12%;
  transform: rotate(-7deg);
}
.demo .tape.b {
  top: -0.6rem;
  right: 12%;
  transform: rotate(6deg);
}
.demo figcaption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8125rem;
}

/* Sections */
.section {
  margin-top: clamp(3.5rem, 9vw, 6rem);
}
.section > h2 {
  font-size: clamp(2rem, 8vw, 3rem);
  margin-bottom: 0.75rem;
}
.section > .intro {
  max-width: 36rem;
  font-size: 1.0625rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lines li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.25rem 1.25rem;
  padding-block: 1rem;
  border-top: 2px dashed var(--rule);
}
.lines li:first-child {
  border-top: 0;
  padding-top: 0;
}
.lines li:last-child {
  padding-bottom: 0;
}
.lines .term {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}
.lines .what {
  max-width: 34rem;
}
.lines .what strong {
  font-weight: 700;
}
@media (max-width: 34rem) {
  .lines li {
    grid-template-columns: 1fr;
  }
}

/* Rubber stamps. They slam in once when scrolled into view. */
.stamp {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 3px solid currentColor;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-stretch: 62%;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.05'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp.legit {
  color: var(--legit);
  transform: rotate(-6deg);
}
.stamp.sus {
  color: var(--danger);
  transform: rotate(-4deg);
}
@keyframes slam {
  0% {
    transform: scale(1.8) rotate(-12deg);
    opacity: 0;
  }
  60% {
    transform: scale(0.9) rotate(4deg);
    opacity: 1;
  }
}
.js .stamp[data-slam]:not(.in) {
  opacity: 0;
}
.stamp.in {
  animation: slam 450ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

/* The two verdicts, as in the app's vote slabs */
.verdicts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.slab {
  background: var(--shade);
  border-radius: 6px;
  padding: 1.25rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}
.slab .stamp {
  font-size: clamp(2.75rem, 9vw, 3.75rem);
  border-width: 4px;
  padding: 0.2rem 0.9rem;
}
.slab p {
  font-size: 0.9375rem;
  line-height: 1.45;
}
@media (max-width: 34rem) {
  .verdicts {
    grid-template-columns: 1fr;
  }
}

/* The day's timeline: times in print type */
.times li {
  grid-template-columns: 4.5rem 1fr;
}
.times .term {
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}
.times .what {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "wdth" 75;
  font-stretch: 75%;
  font-size: 1.5rem;
  line-height: 1.15;
}
.times .what small {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-variation-settings: normal;
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--muted);
}
.prose-after {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px dashed var(--rule);
  display: grid;
  gap: 0.9rem;
  max-width: 36rem;
}

.closing {
  text-align: center;
}
.closing h2 {
  font-size: clamp(2.25rem, 10vw, 3.5rem);
}
.closing p {
  margin: 0.9rem auto 1.5rem;
  max-width: 28rem;
  color: var(--muted);
}
.closing .btn {
  margin: 0.25rem 0.375rem;
}

/* Footer */
.foot {
  margin-top: clamp(3.5rem, 9vw, 6rem);
  padding-block: 2rem 3rem;
  border-top: 2px dashed var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-size: 0.875rem;
}
.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.foot .print {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Guides: a document first. The frame (counter, slip, headings, labels) is the world; the column stays calm. */
.guides {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  margin-top: 1rem;
}
.toc {
  position: sticky;
  top: 1.5rem;
}
.toc ol {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.toc a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.3;
}
.toc a:hover {
  background: var(--shade);
}
.toc a[aria-current="page"] {
  background: var(--paper);
  box-shadow: var(--slip-shadow);
  font-weight: 700;
}
.doc {
  padding: clamp(1.5rem, 5vw, 3rem);
}
.doc h1 {
  font-size: clamp(2.25rem, 8vw, 3.25rem);
}
.doc .sub {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 62ch;
}
.doc .meta {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px dashed var(--rule);
}
.doc .body {
  max-width: 68ch;
  margin-top: 2rem;
}
.doc h2 {
  font-size: 1.75rem;
  margin: 2.75rem 0 0.75rem;
}
.doc h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
}
.doc .body > p,
.doc .body > ul,
.doc .body > ol {
  margin-top: 1rem;
}
.doc ul,
.doc ol {
  padding-left: 1.4rem;
}
.doc li {
  margin-top: 0.5rem;
  padding-left: 0.2rem;
}
.doc ol {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
}
.doc ol > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
}
.doc ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 6px;
  background: var(--shade);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
}
.doc code,
.doc kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--shade);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}
.doc .note {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--shade);
  border-radius: 6px;
  font-size: 0.9375rem;
}
.doc table {
  width: 100%;
  margin-top: 1.25rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-top: 2px dashed var(--rule);
}
.doc th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 2px dashed var(--rule);
}
.pager a {
  display: block;
  max-width: 48%;
  text-decoration: none;
}
.pager a .title {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  font-size: 1.25rem;
  line-height: 1.1;
}
.pager a:hover .title {
  text-decoration: underline;
}
.pager .next {
  margin-left: auto;
  text-align: right;
}
.crumb {
  display: none;
  margin-bottom: 1rem;
}
.guide-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.guide-list li {
  padding-block: 1.25rem;
  border-top: 2px dashed var(--rule);
}
.guide-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.guide-list a {
  text-decoration: none;
  display: block;
}
.guide-list .title {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  font-size: 1.75rem;
  line-height: 1.1;
}
.guide-list a:hover .title {
  text-decoration: underline;
}
.guide-list p {
  margin-top: 0.35rem;
  color: var(--muted);
  max-width: 52ch;
}
@media (max-width: 52rem) {
  .guides {
    grid-template-columns: 1fr;
  }
  .toc {
    display: none;
  }
  .crumb {
    display: block;
  }
}

/* Legal pages (generated by scripts/sync-legal.mjs): one centered slip. */
.legal {
  max-width: 46rem;
  margin: 1rem auto 0;
}

/* Desktop: the page widens; the hero and each section split into a column of words and a slip. */
@media (min-width: 64rem) {
  .wrap {
    width: min(100% - 2.5rem, 68rem);
  }
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 4rem;
    align-items: start;
  }
  .hero > * {
    grid-column: 1;
    justify-self: start;
  }
  .hero .demo {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    margin-top: 0;
  }
  .section {
    display: grid;
    grid-template-columns: 19rem minmax(0, 1fr);
    /* The heading's row hugs it; the intro's row takes the rest of the slip's height. */
    grid-template-rows: auto 1fr;
    column-gap: 4rem;
    align-items: start;
  }
  .section > * {
    grid-column: 2;
  }
  .section > h2,
  .section > .intro {
    grid-column: 1;
  }
  .section > .slip {
    grid-row: 1 / span 2;
  }
  .section.closing {
    display: block;
    max-width: 46rem;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp.in {
    animation: none;
  }
  .btn,
  .btn:hover {
    transition: none;
    transform: none;
  }
}
