/* StickyWords 3 — one stylesheet, no dependencies, no webfonts. */

/* ---------- palette ---------- */
:root {
  color-scheme: light dark;

  --paper:      #faf6ef;
  --paper-2:    #f2ece1;
  --surface:    #fffdf9;
  --ink:        #241f18;
  --ink-2:      #574f44;
  --muted:      #7d7365;
  --line:       #e3dacb;
  --line-2:     #d3c7b2;

  --amber:      #b46f0b;
  --amber-hot:  #8f5606;
  --amber-soft: #fbeed3;

  --note-bg:    #ffdf9e;
  --note-bg-2:  #ffd070;
  --note-ink:   #3a2a08;
  --note-ink-2: #7a5c1d;
  --desk:       #6f6455;
  --desk-2:     #4a4238;

  --code-key:   #8a5b12;
  --code-str:   #4a6b2a;
  --code-num:   #2f6a8f;
  --code-lit:   #8a3f6b;

  --shadow:     0 1px 2px rgba(60,45,20,.06), 0 8px 28px rgba(60,45,20,.09);
  --shadow-lg:  0 2px 6px rgba(60,45,20,.10), 0 26px 60px rgba(60,45,20,.20);

  --radius:     14px;
  --wrap:       1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14120e;
    --paper-2:    #1b1813;
    --surface:    #1e1a15;
    --ink:        #efe8dc;
    --ink-2:      #c6bcac;
    --muted:      #9a8f7e;
    --line:       #322c24;
    --line-2:     #443c31;

    --amber:      #e9a63b;
    --amber-hot:  #f7bd60;
    --amber-soft: #2c2216;

    --desk:       #241f19;
    --desk-2:     #12100d;

    --code-key:   #e0a955;
    --code-str:   #9fc271;
    --code-num:   #78b6dc;
    --code-lit:   #d295bd;

    --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.45);
    --shadow-lg:  0 2px 6px rgba(0,0,0,.5), 0 26px 60px rgba(0,0,0,.6);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -.018em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(2rem, 1.4rem + 2.5vw, 3.15rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 1.16rem + 1.5vw, 2.1rem); }
h3 { font-size: 1.06rem; font-weight: 640; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--amber); text-decoration-color: color-mix(in srgb, var(--amber) 40%, transparent); text-underline-offset: .18em; }
a:hover { color: var(--amber-hot); text-decoration-color: currentColor; }

code, pre, kbd { font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace; }
code { font-size: .88em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(18px, 5vw, 32px); }
.lede { font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.center { text-align: center; margin-inline: auto; }

section { padding-block: clamp(48px, 7vw, 88px); }
section + section { border-top: 1px solid var(--line); }

.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 .7em;
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 670; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 26px; height: 26px; flex: none; border-radius: 6px; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(12px, 2.4vw, 26px); }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: .94rem; }
.site-nav a:hover { color: var(--amber); }
@media (max-width: 640px) { .site-nav .opt { display: none; } }
@media (max-width: 420px) {
  .site-head .wrap { gap: 12px; }
  .site-nav .opt-sm { display: none; }
  .brand { font-size: .96rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: 10px;
  font-size: .97rem; font-weight: 620; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { flex: none; }
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: var(--amber-hot); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #201803; } .btn-primary:hover { color: #201803; } }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { color: var(--ink); border-color: var(--amber); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn-note { font-size: .87rem; color: var(--muted); margin-top: 14px; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(44px, 6vw, 76px) clamp(48px, 7vw, 84px); border-top: 0; }
.hero .wrap { display: grid; gap: clamp(36px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); } }
.hero h1 { margin-bottom: .38em; }
.hero .lede { max-width: 34ch; }
.version-pill {
  display: inline-block; margin-bottom: 16px; padding: 4px 11px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  font-size: .78rem; font-weight: 640; letter-spacing: .02em;
}

/* ---------- the note mock ---------- */
.desk {
  position: relative; border-radius: var(--radius); padding: clamp(20px, 3.5vw, 40px);
  background: linear-gradient(150deg, var(--desk), var(--desk-2));
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; justify-content: center; align-items: center;
}
.note-stage { position: relative; width: 100%; max-width: 470px; margin-bottom: 8px; container-type: inline-size; }

.note {
  position: relative; width: 100%; aspect-ratio: 247 / 103;
  background: linear-gradient(165deg, var(--note-bg), var(--note-bg-2));
  color: var(--note-ink);
  border-radius: 2.4cqw; opacity: .9;
  box-shadow: 0 10px 30px rgba(0,0,0,.34);
  /* the toolbar strip is a fixed share of the note, as in the app */
  display: grid; grid-template-rows: 8.5cqw 1fr; overflow: hidden;
}

/* toolbar: reserved space always, ink only on hover — as in the app */
.note-bar {
  display: flex; align-items: center; justify-content: center; gap: 2.1cqw;
  padding-top: 1.6cqw; opacity: 0; transition: opacity .16s ease;
}
.note:hover .note-bar, .note:focus-within .note-bar { opacity: .82; }
@media (hover: none) { .note-bar { opacity: .82; } }
.note-bar svg { width: 4.2cqw; height: 4.2cqw; color: var(--note-ink-2); }

.note-body { display: grid; align-content: center; justify-items: center; gap: .5cqw; padding: 0 3cqw 2cqw; text-align: center; }
.note-body > * { transition: opacity .32s ease; }
.note-stage[data-swapping="1"] .note-body > * { opacity: 0; }
.w-word { font-size: 6.6cqw; font-weight: 640; letter-spacing: -.01em; }
.w-pron { font-size: 4.1cqw; color: var(--note-ink-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.w-mean { font-size: 4.6cqw; color: color-mix(in srgb, var(--note-ink) 82%, transparent); }

.desk-caption {
  position: absolute; left: 0; right: 0; bottom: 10px;
  text-align: center; font-size: .78rem; color: rgba(255,255,255,.5);
}

/* ---------- premise band ---------- */
.premise { background: var(--paper-2); }
.premise .wrap { max-width: 780px; text-align: center; }
.premise .big { font-size: clamp(1.25rem, 1.05rem + 1.1vw, 1.75rem); line-height: 1.42; letter-spacing: -.02em; margin-bottom: .7em; }

/* ---------- feature cards ---------- */
.cards { display: grid; gap: 22px; margin-top: 34px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 2.4vw, 28px); box-shadow: var(--shadow);
}
.card > h3:first-of-type { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.card-head svg { width: 20px; height: 20px; color: var(--amber); flex: none; }
.card-head h3 { margin: 0; font-size: 1.14rem; }
.card dl { margin: 0; display: grid; gap: 15px; }
.card dt { font-weight: 640; font-size: .97rem; }
.card dd { margin: 2px 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }

/* ---------- screenshots ---------- */
.shots { display: grid; gap: 26px; margin-top: 34px; }
@media (min-width: 800px) { .shots { grid-template-columns: 1fr 1fr; } }
.shot { margin: 0; }
.shot img,
.shot .shot-ph {
  display: block; width: 100%; aspect-ratio: var(--ar, 16 / 10);
  border-radius: 10px; border: 1px solid var(--line-2);
}
.shot img { object-fit: cover; box-shadow: var(--shadow); background: var(--paper-2); }
.shot .shot-ph {
  border-style: dashed; background: var(--paper-2);
  display: grid; place-content: center; gap: 6px; text-align: center; padding: 16px;
  color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .8rem;
}
.shot .shot-ph strong { display: block; color: var(--ink-2); font-size: .86rem; font-family: inherit; }
.shot figcaption { margin-top: 10px; font-size: .9rem; color: var(--ink-2); }

/* ---------- code ---------- */
.codebox {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.codebox .codebar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-bottom: 1px solid var(--line);
  background: var(--paper-2); font-size: .82rem; color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
}
.codebox pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .84rem; line-height: 1.62; }
.tk-k { color: var(--code-key); }
.tk-s { color: var(--code-str); }
.tk-n { color: var(--code-num); }
.tk-l { color: var(--code-lit); }
.tk-p { color: var(--muted); }

.split { display: grid; gap: clamp(28px, 4vw, 44px); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--paper-2); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

kbd {
  display: inline-block; padding: 2px 7px; font-size: .8rem;
  background: var(--paper-2); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 6px; color: var(--ink);
  white-space: nowrap;
}

/* ---------- heritage ---------- */
.timeline { display: grid; gap: 20px; margin-top: 32px; }
@media (min-width: 760px) { .timeline { grid-template-columns: repeat(3, 1fr); } }
.era { border-top: 2px solid var(--line-2); padding-top: 16px; }
.era .yr { font-size: 1.6rem; font-weight: 660; letter-spacing: -.02em; color: var(--amber); line-height: 1; }
.era p { margin: 8px 0 0; font-size: .95rem; color: var(--ink-2); }

/* ---------- download band ---------- */
.download { background: var(--paper-2); }
.download .wrap { max-width: 760px; text-align: center; }
.download .btn-row { justify-content: center; }

/* ---------- prose (privacy) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.2em; scroll-margin-top: 80px; }
.prose h2:first-of-type { margin-top: 1.4em; }
.prose h3 { margin-top: 1.8em; }
.prose ul { padding-left: 1.15em; margin: 0 0 1em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--amber); }
.callout {
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 26%, transparent);
  border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px); margin: 26px 0;
}
.callout p:first-child { margin-top: 0; }
.updated { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 30px 0 40px; }
.toc h2 { font-size: .78rem !important; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px !important; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 30px; font-size: .94rem; }
@media (max-width: 620px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: 6px; break-inside: avoid; }

.page-head { padding-block: clamp(40px, 6vw, 64px) 0; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: .92rem; text-decoration: none; margin-bottom: 20px; }
.back-link:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 40px; font-size: .9rem; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: baseline; justify-content: space-between; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--amber); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-credit { max-width: 46ch; }

/* ---------- 404 ---------- */
.notfound { min-height: 56vh; display: grid; place-content: center; text-align: center; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* pending CTA — remove .is-pending once the Store listing is live */
.btn.is-pending { opacity: .6; pointer-events: none; }
