/* www.ludoapps.com — one family style for the 15 pages.
   The palette is the App Store posters': cream paper, ink, and the one caldera orange. */

:root {
  --paper: #F6F3EE;
  --paper-deep: #E2DCD2;
  --ink: #17161A;
  --ink-soft: #55504A;
  --accent: #E25822;
  --accent-text: #B5421A;   /* the accent, darkened to read as text on the paper */
  --washi: #F4C9B3;
  --card: rgba(255, 255, 255, .58);
  --line: rgba(23, 22, 26, .11);
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 7.5rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper) linear-gradient(var(--paper), var(--paper-deep)) fixed;
  font: 1.125rem/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: 8px; z-index: 20; }
.skip:focus { left: .5rem; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 243, 238, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.bar { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; }
.brand { font: 700 1.5rem/1 var(--serif); letter-spacing: -.01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; }
.brand-dot { width: .32em; height: .32em; margin-left: .12em; border-radius: 50%; background: var(--accent); }
.apps { display: flex; gap: .35rem; }
.apps a, .subnav a {
  color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: .4rem .8rem; border-radius: 999px; white-space: nowrap;
}
.apps a:hover, .subnav a:hover { color: var(--ink); background: rgba(23, 22, 26, .06); }
.apps a[aria-current] { color: var(--ink); background: rgba(23, 22, 26, .08); }
.subbar { border-top: 1px solid var(--line); }
.subbar nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 3rem; }
.subnav { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; margin-left: -.8rem; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { font-size: .9rem; padding: .3rem .8rem; }
.subnav a[aria-current] { color: var(--accent-text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  padding: .85rem 1.35rem; border-radius: 999px;
  color: var(--ink); background: transparent; border: 1.5px solid var(--ink);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-small { font-size: .85rem; padding: .5rem .9rem; flex: none; }
.cta { margin: 1.6rem 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.cta-note { margin: .8rem 0 0; font: .9rem/1.4 var(--sans); color: var(--ink-soft); }

/* ---------- shared pieces ---------- */
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.3rem; line-height: 1.25; }
h3 em, h1 em { color: var(--accent-text); }
p, ul, ol { margin: 1rem 0; }
ul { padding-left: 1.2rem; }
li { margin: .5rem 0; padding-left: .2rem; }
li::marker { color: var(--accent); }
strong { font-weight: 650; }
code { font: .86em ui-monospace, "SF Mono", Menlo, monospace; background: rgba(23, 22, 26, .07); padding: .1em .35em; border-radius: 5px; }
mark { color: inherit; background: linear-gradient(transparent 58%, var(--washi) 58%, var(--washi) 94%, transparent 94%); padding: 0 .08em; }
figure { margin: 2rem 0; }
figure img { width: 100%; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(23, 22, 26, .35); }
blockquote {
  margin: 1.8rem 0; padding: .2rem 0 .2rem 1.3rem; border-left: 3px solid var(--accent);
  font-size: 1.35rem; line-height: 1.4; font-style: italic;
}
blockquote p { margin: 0; }
blockquote em { font-style: normal; }
hr {
  border: 0; height: 12px; width: 120px; margin: 3.5rem auto;
  background: var(--washi);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6q5-8 10 0t10 0 10 0 10 0' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 40px 12px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6q5-8 10 0t10 0 10 0 10 0' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 40px 12px repeat-x;
}

.note {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; margin: 1.4rem 0;
}
.note p { margin: 0; font-size: 1.02rem; line-height: 1.55; }
.note-icon { font-size: 1.5rem; line-height: 1.25; flex: none; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.notes .note { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin: 1.8rem 0; }
.card {
  display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; row-gap: .25rem; align-content: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.3rem; color: var(--ink); text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 30px -20px rgba(23, 22, 26, .4); }
.card-icon { font-size: 1.3rem; line-height: 1.3; }
.card-title { font-weight: 700; font-size: 1.15rem; }
.card-desc { grid-column: 1 / -1; font: .93rem/1.45 var(--sans); color: var(--ink-soft); }

/* ---------- the two kinds of home page ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 1rem; text-align: center; }
.hero-text { max-width: 46rem; margin-inline: auto; }
.hero h1 { font-size: clamp(2.5rem, 1.4rem + 5vw, 4.6rem); line-height: 1.02; letter-spacing: -.03em; }
.lead { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); margin: 1.4rem 0 0; }
.lead mark { color: var(--ink); }
.hero .cta-row { justify-content: center; }
.hero .cta { margin-top: 2rem; }
.hero-img { margin: 3rem 0 0; }
.band { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.band > h2 { margin-bottom: 1.2rem; }
.band > h2 + p, .band > p, .band > ul, .band > blockquote, .band > h3, .band > .cta { max-width: 44rem; }
.band > h3 { margin-top: 2.4rem; }
.band > h2::before, .split-text > h2::before, .prose h2:not(.version)::before {
  content: ""; display: block; width: 2.2rem; height: 4px; border-radius: 2px; background: var(--accent); margin-bottom: 1rem;
}
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.split + .split { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.split figure { margin: 0; }
.split-flip > figure { order: -1; }
.split-text > h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.band > h2 + .split { margin-top: 2rem; }

/* ---------- inner pages ---------- */
.doc { padding: clamp(2rem, 5vw, 4rem) 0 2rem; }
.prose { max-width: 44rem; margin-inline: auto; }
.prose.has-toc { max-width: none; display: grid; grid-template-columns: 15rem minmax(0, 44rem); column-gap: 3.5rem; justify-content: center; }
.has-toc > .page-head { grid-column: 2; grid-row: 1; }
.has-toc > .body { grid-column: 2; grid-row: 2; }
.has-toc > .toc { grid-column: 1; grid-row: 1 / 3; }
.page-head { margin-bottom: 2.5rem; }
.eyebrow { margin: 0 0 .6rem; font: 600 .82rem/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.eyebrow a { text-decoration: none; }
.page-head h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); letter-spacing: -.025em; }
.intro { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); }
.intro .note { font-size: 1rem; color: var(--ink); }
.prose h2 { margin: 3rem 0 1rem; }
.prose hr + h2 { margin-top: 0; }
.prose h3 { margin: 2.2rem 0 .6rem; }
.prose h2.version { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.prose h2.version span { color: var(--accent-text); }
.prose h2.version time { font: 500 .95rem/1.3 var(--sans); letter-spacing: 0; color: var(--ink-soft); }
.toc { font-family: var(--sans); }
.toc details { position: sticky; top: 8rem; max-height: calc(100vh - 9.5rem); overflow-y: auto; }
.toc summary { font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); list-style: none; margin-bottom: .6rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; padding: 0; }
.toc a { display: block; padding: .32rem 0 .32rem .9rem; margin-left: -1px; border-left: 1px solid transparent; font-size: .88rem; line-height: 1.35; color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }

/* ---------- footer ---------- */
.site-foot { margin-top: 4rem; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .9rem; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2rem; padding: 3rem 0 3.5rem; }
.foot-brand p { color: var(--ink-soft); max-width: 18rem; margin: .8rem 0 0; }
.site-foot h2 { font: 600 .78rem/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .9rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: .45rem 0; padding: 0; }
.site-foot li a { color: var(--ink); text-decoration: none; }
.site-foot li a:hover { color: var(--accent-text); text-decoration: underline; }

/* ---------- small screens ---------- */
@media (max-width: 62rem) {
  .prose.has-toc { display: block; max-width: 44rem; }
  .toc details { position: static; max-height: none; }
  .toc { margin: 0 0 2.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.2rem; }
  .toc summary { margin: 0; cursor: pointer; }
  .toc details[open] summary { margin-bottom: .6rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 46rem) {
  body { font-size: 1.06rem; }
  .split, .notes { grid-template-columns: 1fr; }
  .split-flip > figure { order: 0; }
  .btn-small { display: none; }
  .apps a { padding: .4rem .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
}
@media print {
  .site-head, .site-foot, .toc, .skip { display: none; }
  body { background: #fff; font-size: 11pt; }
}
