/* Smiley Libs public site. Colours are SmileyKit's tokens (web/smileykit-colors.css) plus the
   app's own readable inks (SmileyLibs/UI/ReadableStyle.swift: secondaryInk #545269, action #493679).
   Dark mode uses SmileyKit's night palette. */
:root {
  --bg: #fff6e8;            /* sk-cream */
  --paper: #fffdf8;         /* sk-paper */
  --paper-deep: #fff0d7;    /* sk-paper-deep */
  --ink: #292938;           /* sk-ink */
  --muted: #545269;         /* app secondaryInk */
  --action: #493679;        /* app action */
  --link: #493679;
  --line: rgba(41, 41, 56, .16);
  --edge: #292938;          /* card outlines and offset shadows */
  --shadow: #292938;
  --sun: #ffd83d;
  --sunshine: #ffc23d;
  --pink: #ff8caf;
  --sky: #78c9ff;
  --green: #7dca72;
  --purple: #be8ee8;
  --red: #f1241e;
  --chip-ink: #292938;      /* text on the bright colours above, in both modes */
  --hero-wash: #ffe9a8;
  --tile-sun: #fff6d4;
  --tile-pink: #ffe6ed;
  --tile-sky: #e1f3ff;
  --tile-green: #e2f3e0;
  --tile-purple: #f1e6fa;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", -apple-system, BlinkMacSystemFont, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a2e;          /* sk-night */
    --paper: #2d2d44;       /* sk-night-surface */
    --paper-deep: #24243a;
    --ink: #f7f3ff;
    --muted: #cdc7df;
    --action: #e0c3fc;      /* sk-night-glow */
    --link: #e0c3fc;
    --line: rgba(247, 243, 255, .18);
    --edge: #8c86a8;
    --shadow: #0d0d18;
    --hero-wash: #3a3354;
    --tile-sun: #3b3540;
    --tile-pink: #3d3045;
    --tile-sky: #2c3650;
    --tile-green: #2b3a3f;
    --tile-purple: #383055;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--round); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sun); color: var(--chip-ink); }

.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 780px); margin-inline: auto; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 10; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); }
.skip-link:focus { top: 12px; }
.kicker { margin: 0 0 12px; font-family: var(--round); font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Header */
header.site { background: var(--paper); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; min-height: 72px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--round); font-size: 20px; font-weight: 900; letter-spacing: -.03em; }
.brand img { width: 42px; height: 42px; border-radius: 11px; }
header.site nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-left: auto; }
header.site nav a { color: var(--ink); text-decoration: none; font-family: var(--round); font-weight: 800; font-size: 15px; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--action); text-decoration: underline; text-decoration-thickness: 2px; }

/* Buttons and badges */
.store-button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: 2px solid var(--edge); border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-family: var(--round); font-weight: 900; text-decoration: none;
  box-shadow: 4px 4px 0 var(--sun);
}
.store-button.soon { background: var(--sun); color: var(--chip-ink); box-shadow: 4px 4px 0 var(--shadow); }
.button { display: inline-block; padding: 12px 20px; border: 2px solid var(--edge); border-radius: 999px; background: var(--paper); color: var(--ink); font-family: var(--round); font-weight: 900; text-decoration: none; box-shadow: 3px 3px 0 var(--shadow); }
.button.primary { background: var(--sun); color: var(--chip-ink); }
.contact { display: inline-block; padding: 10px 16px; border: 2px solid var(--edge); border-radius: 14px; background: var(--sky); color: var(--chip-ink); font-family: var(--round); font-weight: 900; text-decoration: none; }

/* Home: hero */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-block: 56px 64px; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 900; margin-bottom: 20px; }
.hero .lede { font-size: 20px; color: var(--muted); max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
.hero .note { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.hero-stage { position: relative; padding: 30px; border: 2px solid var(--edge); border-radius: 40px 40px 140px 40px; background: var(--hero-wash); box-shadow: 9px 9px 0 var(--shadow); }
.hero-stage .icon { width: min(58%, 260px); margin: 0 auto 22px; border-radius: 22%; border: 2px solid var(--edge); }
.story-card { padding: 18px 20px; border: 2px solid var(--edge); border-radius: 22px; background: var(--paper); font-size: 18px; line-height: 1.75; }
.story-card p { margin: 0; }
.word { padding: 1px 6px; border-radius: 6px; font-weight: 800; color: var(--chip-ink); white-space: nowrap; }
.word.pink { background: var(--pink); }
.word.sun { background: var(--sun); }
.word.green { background: var(--green); }

/* Home: sections */
section.band { padding-block: 56px; }
section.band.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { max-width: 46em; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 900; }
.section-head p { color: var(--muted); font-size: 19px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; list-style: none; margin: 0 0 36px; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 22px 20px 20px; border: 2px solid var(--edge); border-radius: 24px; background: var(--paper); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px; border: 2px solid var(--edge); border-radius: 50%; background: var(--sun); color: var(--chip-ink); font-family: var(--round); font-weight: 900; }
.steps li:nth-child(2)::before { background: var(--sky); }
.steps li:nth-child(3)::before { background: var(--pink); }
.steps li:nth-child(4)::before { background: var(--green); }
.steps h3 { font-size: 20px; }
.steps p { margin: 0; color: var(--muted); font-size: 16px; }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; gap: 28px; margin: 0; padding: 0; list-style: none; }
.shots figure { margin: 0; }
.shots img { width: 100%; border: 2px solid var(--edge); border-radius: 30px; box-shadow: 6px 6px 0 var(--shadow); }
.shots figcaption { margin-top: 14px; text-align: center; font-family: var(--round); font-weight: 800; color: var(--muted); font-size: 15px; }

.split { display: grid; grid-template-columns: .8fr 1.2fr; gap: 44px; align-items: center; }
.split .art { max-width: 320px; margin-inline: auto; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.tile { padding: 20px 22px; border: 2px solid var(--edge); border-radius: 22px; background: var(--tile-sun); }
.tile:nth-child(4n+2) { background: var(--tile-sky); }
.tile:nth-child(4n+3) { background: var(--tile-pink); }
.tile:nth-child(4n+4) { background: var(--tile-green); }
.tile strong { display: block; margin-bottom: 6px; font-family: var(--round); font-size: 19px; font-weight: 900; }
.tile span, .tile p { color: var(--muted); font-size: 16px; }
.tile p:last-child { margin: 0; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { padding: 24px; border: 2px solid var(--edge); border-radius: 26px; background: var(--paper); box-shadow: 5px 5px 0 var(--shadow); }
.plan.featured { background: var(--tile-sun); }
.plan h3 { font-size: 22px; }
.plan .price { font-family: var(--round); font-size: 30px; font-weight: 900; margin-bottom: 6px; }
.plan .price small { font-size: 16px; font-weight: 800; color: var(--muted); }
.plan ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.plan li { margin-bottom: 6px; }
.fine { margin-top: 20px; font-size: 15px; color: var(--muted); }

.faq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.faq h3 { font-size: 20px; margin-bottom: 6px; }
.faq p { color: var(--muted); }

.end-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 40px; padding: 28px; border: 2px solid var(--edge); border-radius: 28px; background: var(--paper); box-shadow: 6px 6px 0 var(--shadow); }
.end-cta h2 { font-size: 30px; margin-bottom: 4px; }
.end-cta p { margin: 0; color: var(--muted); }

/* Article pages: privacy, support */
.page-hero { background: var(--paper); border-bottom: 1px solid var(--line); }
.page-hero .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 36px; }
.page-hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 900; margin-bottom: 8px; }
.page-hero p { margin: 0; color: var(--muted); }
.page-hero img { width: 150px; flex: none; }
.back-link { display: inline-block; margin-bottom: 14px; font-family: var(--round); font-weight: 800; text-decoration: none; }
.page-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding-block: 40px 64px; }
.toc { position: sticky; top: 20px; align-self: start; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 40px); overflow: auto; font-size: 15px; }
.toc strong { font-family: var(--round); }
.toc a { color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--action); text-decoration: underline; }
article.doc { min-width: 0; max-width: 780px; }
article.doc h2 { margin: 44px 0 14px; font-size: clamp(26px, 3vw, 34px); font-weight: 900; scroll-margin-top: 20px; }
article.doc h2:first-of-type { margin-top: 8px; }
article.doc h3 { margin: 26px 0 8px; font-size: 21px; }
article.doc p, article.doc li, article.doc dd { color: var(--ink); }
article.doc ul, article.doc ol { padding-left: 24px; margin: 0 0 1.1em; }
article.doc li { margin-bottom: 6px; }
.callout { margin: 0 0 24px; padding: 18px 22px; border: 2px solid var(--edge); border-radius: 22px; background: var(--tile-sun); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 28px; padding: 18px 22px; border: 2px solid var(--edge); border-radius: 20px; background: var(--paper); }
.facts dt { font-weight: 800; font-family: var(--round); }
.facts dd { margin: 0; color: var(--muted); }

.table-wrap { margin: 0 0 24px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; border: 2px solid var(--edge); border-radius: 18px; overflow: hidden; background: var(--paper); font-size: 16px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--paper-deep); font-family: var(--round); font-weight: 900; }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody th { font-weight: 700; }
table.data td { color: var(--muted); }

/* Download and 404 */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; text-align: center; }
.center-page .icon { width: 132px; margin: 0 auto 22px; border-radius: 28%; border: 2px solid var(--edge); }
.center-page h1 { font-size: clamp(34px, 6vw, 52px); font-weight: 900; }
.center-page p { color: var(--muted); font-size: 19px; max-width: 30em; margin-inline: auto; }
.center-page .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; margin-top: 20px; font-family: var(--round); font-weight: 800; }

/* Footer */
footer.site { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 15px; }
footer.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-block: 26px 36px; }
footer.site a { color: var(--muted); }
footer.site .made { flex-basis: 100%; margin: 0; }

@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .tiles.four { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-block: 36px 48px; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split .art { max-width: 200px; }
  .faq { grid-template-columns: 1fr; }
  .page-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .toc { position: static; max-height: none; padding: 16px 18px; border: 2px solid var(--edge); border-radius: 18px; background: var(--paper); }
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .shots img { border-radius: 18px; box-shadow: 4px 4px 0 var(--shadow); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  header.site nav { margin-left: 0; width: 100%; gap: 4px 16px; }
  header.site nav a { font-size: 14px; }
  .hero .lede { font-size: 18px; }
  .hero-stage { padding: 20px; border-radius: 30px 30px 90px 30px; box-shadow: 6px 6px 0 var(--shadow); }
  .story-card { font-size: 16px; }
  .steps, .tiles, .tiles.four { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; max-width: 240px; margin-inline: auto; }
  section.band { padding-block: 44px; }
  .page-hero img { width: 92px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  /* Tables become stacked cards so nothing scrolls sideways. */
  table.data, table.data thead, table.data tbody, table.data tr, table.data th, table.data td { display: block; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data th, table.data td { border: 0; padding: 4px 14px; }
  table.data td::before { content: attr(data-label) ": "; font-weight: 800; color: var(--ink); }
  .end-cta { padding: 22px; }
}

.split-title { font-size: clamp(30px, 4vw, 46px); font-weight: 900; margin-bottom: 18px; }

/* Download and 404 keep the template's markup (main.wrap > section.hero), so new_site.py --only
   download/index.html can re-render the download page when the app goes live. */
main > .hero:only-child { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 32px); gap: 0; padding-block: 40px; text-align: center; }
main > .hero:only-child .icon { width: 132px; margin: 0 auto 22px; border-radius: 28%; border: 2px solid var(--edge); }
main > .hero:only-child h1 { font-size: clamp(34px, 6vw, 52px); font-weight: 900; }
main > .hero:only-child p { color: var(--muted); font-size: 19px; max-width: 30em; }
main > .hero:only-child .store-button { margin-top: 8px; }
main > .hero:only-child .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px; margin-top: 24px; font-family: var(--round); font-weight: 800; font-size: 17px; }
