/* CrateMate website. Plain CSS, no build step. Colours and type follow docs/brand. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2ecdc;
  --forest: #2f5a49;
  --yellow: #f5d000;
  --deep: #1e3a2f;

  --bg: var(--paper);
  --bg-raised: #f8f4e9;
  --text: var(--deep);
  --muted: #4a5f55;
  --accent: var(--forest);
  --rule: rgba(30, 58, 47, 0.22);
  --rule-strong: var(--deep);
  --highlight: var(--yellow);
  --on-highlight: var(--deep);
  --code-bg: rgba(47, 90, 73, 0.09);
  --ok: #276b43;
  --check: #9a4a00;
  --miss: #b3261e;
  --grain-opacity: 0.35;

  color-scheme: light dark;
  --measure: 40rem;
  --wide: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--deep);
    --bg-raised: #244538;
    --text: var(--paper);
    --muted: #c9c6b5;
    --accent: var(--yellow);
    --rule: rgba(242, 236, 220, 0.2);
    --rule-strong: var(--paper);
    --code-bg: rgba(242, 236, 220, 0.08);
    --ok: #7fd3a0;
    --check: #ffb35c;
    --miss: #ff8a80;
    --grain-opacity: 0.18;
  }
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
  font-feature-settings: "ss01" 0;
}

/* A faint paper grain, drawn with an inline SVG filter. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.23 0 0 0 0 0.18 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * {
  position: relative;
  z-index: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration-thickness: 0.14em;
}

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

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

li + li {
  margin-top: 0.35em;
}

code,
kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0 0 1.2em;
}

pre code {
  background: none;
  padding: 0;
}

strong {
  font-weight: 600;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--highlight);
  color: var(--on-highlight);
  padding: 0.5rem 0.8rem;
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.prose {
  max-width: var(--measure);
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--rule);
}

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

.brand {
  display: block;
  line-height: 0;
}

.brand img {
  width: 172px;
  height: auto;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

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

.site-footer {
  margin-top: 5rem;
  border-top: 2px solid var(--rule-strong);
  padding: 2rem 0 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: grid;
  gap: 1.25rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a {
  color: var(--text);
}

.site-footer p {
  margin: 0;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--highlight);
  color: var(--on-highlight);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border: 2px solid var(--deep);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--deep);
}

.button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--deep);
}

@media (prefers-color-scheme: dark) {
  .button {
    border-color: var(--yellow);
    box-shadow: 4px 4px 0 #0f1f19;
  }
  .button:hover {
    box-shadow: 5px 5px 0 #0f1f19;
  }
}

.button svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

/* Hero */

.hero {
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.25rem;
  max-width: 34rem;
  color: var(--text);
}

.meta {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.meta li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.meta li::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.hero-art {
  justify-self: center;
  width: 100%;
  max-width: 340px;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* Sections */

.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
}

.label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* An empty export, shown as a printed slip. */
.slip {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92rem;
  box-shadow: 0 1px 0 var(--rule);
  transform: rotate(-0.6deg);
}

.slip .file {
  font-family: "Geist", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 0.7rem;
}

.slip .empty {
  color: var(--muted);
  font-style: italic;
  font-family: "Geist", system-ui, sans-serif;
}

/* Numbered steps, like index cards in a box. */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}

.steps li {
  margin: 0;
  counter-increment: step;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1.25rem 1.25rem 1.1rem;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

/* Screenshots */

.shots {
  display: grid;
  gap: 2.5rem;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -22px rgba(15, 31, 25, 0.55);
  background: var(--bg-raised);
}

.shot figcaption {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: var(--measure);
}

.shot-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}

/* Features */

.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 2px solid var(--rule-strong);
}

.features li {
  margin: 0;
  padding: 1.25rem 1.5rem 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

.features li:nth-child(odd) {
  padding-right: 2rem;
}

.features li:nth-child(even) {
  padding-left: 2rem;
  border-left: 1px solid var(--rule);
}

.features h3 {
  margin-bottom: 0.35rem;
}

.features p {
  margin: 0;
  color: var(--muted);
}

/* Status marks, as in the app's review list. */
.marks {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2em;
}

.marks li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.mark {
  flex: none;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  min-width: 6.5rem;
  text-align: center;
}

.mark.ok {
  color: var(--ok);
}

.mark.check {
  color: var(--check);
}

.mark.miss {
  color: var(--miss);
}

/* Callout */

.callout {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.5em;
}

.callout p:last-child {
  margin-bottom: 0;
}

.promise {
  background: var(--deep);
  color: var(--paper);
  border-radius: 8px;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.promise h2 {
  color: var(--paper);
}

.promise p {
  margin: 0;
  color: #d9d4c3;
}

.promise img {
  width: 96px;
  height: 96px;
}

@media (prefers-color-scheme: dark) {
  .promise {
    background: var(--bg-raised);
    border: 1px solid var(--rule);
  }
}

/* FAQ */

.faq {
  max-width: var(--measure);
}

.faq h3 {
  margin-top: 2rem;
}

.faq h3:first-child {
  margin-top: 0;
}

.faq p {
  color: var(--text);
}

/* Articles */

.article {
  padding: 3.5rem 0 0;
}

.article .prose h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  margin-top: 2.6rem;
}

.article .prose h3 {
  margin-top: 1.8rem;
}

.article .byline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.article .prose ol > li,
.article .prose ul > li {
  padding-left: 0.2rem;
}

.article .shot {
  margin: 1.8rem 0;
}

.cta-box {
  margin: 2.5rem 0 0;
  padding: 1.75rem;
  border: 2px solid var(--rule-strong);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.cta-box p {
  margin: 0;
}

.cta-box .meta {
  margin-top: 0;
}

.toc {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

/* 404 */

.lost {
  padding: 5rem 0 2rem;
  text-align: center;
}

.lost img {
  width: 140px;
  height: 140px;
  margin-bottom: 1.5rem;
}

.lost .prose {
  margin: 0 auto;
}

/* Phone widths */

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

  .wrap {
    padding: 0 1rem;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .hero .wrap,
  .split,
  .shot-pair,
  .promise {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    max-width: 132px;
    grid-row: 1;
    justify-self: start;
  }

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

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

  .features li:nth-child(odd),
  .features li:nth-child(even) {
    padding: 1.1rem 0;
    border-left: 0;
  }

  .section {
    padding: 3rem 0;
  }

  .promise {
    padding: 1.75rem;
    gap: 1.25rem;
  }

  .promise img {
    width: 72px;
    height: 72px;
  }

  .site-nav {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .brand img {
    width: 150px;
  }

  .button {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
