/* Bunshin website. One stylesheet for every page.
   No web fonts, no images from elsewhere, no url() at all: the site makes no requests
   beyond its own files. Colours are the app's own palette (Apps/Bunshin/Theme/BunshinTheme.swift):
   espresso #140E0B, bronze #C08A5B / #8A5A36 / #E6C29B, sand #F5EEE6, rust #883E16. */

:root {
  color-scheme: light dark;

  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* The wordmark is drawn with round-ended strokes, so headings use the system's rounded face. */
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 40rem;
  --page: 70rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  /* Light */
  --bg: #F5EEE6;
  --bg-deep: #EFE5DA;
  --text: #140E0B;
  --muted: #5C4B3E;
  --link: #883E16;
  --rule: rgba(138, 90, 54, 0.28);
  --tint: rgba(138, 90, 54, 0.08);
  --button: #8A5A36;
  --button-hover: #6F4729;
  --on-button: #FBF7F2;
  --focus: #883E16;
  --number: #8A5A36;

  /* The illustration: a dark device in both themes. */
  --duo-body: #1E1611;
  --duo-edge: rgba(20, 14, 11, 0);
  --duo-screen: #8A5A36;
  --duo-menubar: rgba(245, 238, 230, 0.78);
  --duo-window: #F5EEE6;
  --duo-titlebar: #E4D7C8;
  --duo-light: #C08A5B;
  --duo-line: #CDBBA8;
  --duo-caret: #883E16;
  --duo-hinge: #45372D;
  --duo-deck: #140E0B;
  --duo-key: #2B221C;
  --duo-strip: #241B15;
  --duo-button: #2B221C;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140E0B;
    --bg-deep: #0B0806;
    --text: #F5EEE6;
    --muted: rgba(245, 238, 230, 0.70);
    --link: #E6C29B;
    --rule: rgba(230, 194, 155, 0.18);
    --tint: rgba(245, 238, 230, 0.05);
    --button: #C08A5B;
    --button-hover: #D4A276;
    --on-button: #140E0B;
    --focus: #E6C29B;
    --number: #C08A5B;

    --duo-body: #2B221C;
    --duo-edge: rgba(230, 194, 155, 0.22);
    --duo-hinge: #45372D;
    --duo-deck: #1E1611;
    --duo-key: #3A2E25;
    --duo-strip: #2A1F18;
    --duo-button: #3A2E25;
  }
}

/* Base */

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  overflow-wrap: break-word;
}

@media (prefers-color-scheme: dark) {
  /* The app's own background: espresso 700 fading into espresso 950. */
  body {
    background-image: linear-gradient(180deg, #2A1F18 0, var(--bg) 32rem, var(--bg-deep) 100%);
    background-attachment: scroll;
  }
}

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

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

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

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

strong {
  font-weight: 650;
}

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

code {
  overflow-wrap: anywhere;
}

kbd {
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 0.35em;
  background-color: var(--tint);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  text-wrap: balance;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.625rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

h3 {
  margin: 2rem 0 0.4rem;
  font-size: 1.1875rem;
  font-weight: 700;
}

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

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.4rem;
}

/* Skip link */

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  background-color: var(--button);
  color: var(--on-button);
  font-weight: 650;
  text-decoration: none;
  z-index: 10;
}

.skip:focus {
  top: 0.75rem;
}

/* Header and footer */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header .wrap {
  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.7rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 22.5%;
}

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

.site-nav li + li {
  margin-top: 0;
}

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

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

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer p {
  max-width: var(--measure);
  margin-bottom: 0.4rem;
}

/* Home page: hero */

.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-top: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 4rem;
  }
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.6rem, 1.4rem + 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 34rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 1.1875rem;
  line-height: 1.55;
}

.button {
  display: inline-block;
  padding: 0.95rem 1.5rem;
  border-radius: 0.9rem;
  background-color: var(--button);
  color: var(--on-button);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.button:hover {
  background-color: var(--button-hover);
}

.download-note {
  margin: 0.75rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.store-link {
  margin-bottom: 0;
}

.store-link a {
  font-weight: 650;
}

.hero-art {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 30rem;
}

.hero-art svg {
  width: 100%;
  height: auto;
}

/* The illustration's parts (inline SVG in index.html). */
.duo-body { fill: var(--duo-body); stroke: var(--duo-edge); stroke-width: 1.5; }
.duo-screen { fill: var(--duo-screen); }
.duo-menubar { fill: var(--duo-menubar); }
.duo-window { fill: var(--duo-window); }
.duo-titlebar { fill: var(--duo-titlebar); }
.duo-light { fill: var(--duo-light); }
.duo-line { fill: var(--duo-line); }
.duo-caret { fill: var(--duo-caret); }
.duo-hinge { fill: var(--duo-hinge); }
.duo-deck { fill: var(--duo-deck); }
.duo-key { fill: var(--duo-key); }
.duo-strip { fill: var(--duo-strip); }
.duo-button { fill: var(--duo-button); }

/* Home page: sections */

.section {
  padding-top: 3rem;
  padding-bottom: 0.5rem;
  border-top: 1px solid var(--rule);
}

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

/* Numbered steps: used only where the order matters. */
.steps {
  max-width: 46rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps > li + li {
  margin-top: 1rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  width: 1.9rem;
  color: var(--number);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
}

/* Term and description pairs: postures, privacy points, requirements. */
.pairs {
  display: grid;
  gap: 1.25rem 2.5rem;
  max-width: 56rem;
}

@media (min-width: 44rem) {
  .pairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pairs div {
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}

.pairs dt {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.pairs dd {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.promise {
  max-width: 44rem;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1rem + 1.6vw, 1.875rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Text pages: privacy policy and support */

.doc {
  max-width: var(--measure);
  padding-top: clamp(1rem, 4vw, 3rem);
}

.doc h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.doc h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.doc .meta {
  color: var(--muted);
}

.doc .lead {
  font-size: 1.125rem;
}

.toc {
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: 0.9rem;
  background-color: var(--tint);
}

.toc h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1rem;
}

.toc ul {
  margin: 0;
  padding-left: 1.1rem;
}

.toc li + li {
  margin-top: 0.2rem;
}

.problem {
  margin-top: 1.75rem;
}

.problem h3 {
  margin: 0 0 0.3rem;
}

.problem p {
  margin: 0;
}

.problem p + p {
  margin-top: 0.5rem;
}

.problem ul {
  margin: 0.5rem 0 0;
}

@media print {
  body {
    background: none;
    color: #000;
  }

  .skip,
  .site-nav,
  .hero-art {
    display: none;
  }

  a {
    color: #000;
  }
}
