/* qnotes product page. Plain CSS, no build step. */

:root {
  --paper: #f6f1e8;
  --paper-2: #efe7da;
  --paper-3: #e7dccb;
  --ink: #2a2420;
  --ink-2: #5c5249;
  --ink-3: #8b7f73;
  --rule: #ddd2c1;
  --accent: #a8532a;
  --accent-ink: #fbf7f0;
  --accent-soft: #f0dccb;
  --ok: #4f6b3a;
  --warn: #a33b2b;
  --shadow: 0 1px 0 rgba(60, 40, 20, .05), 0 12px 32px -16px rgba(60, 40, 20, .28);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", "Source Serif Pro", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 40rem;
  --wide: 72rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #1b1714;
  --paper-2: #231e1a;
  --paper-3: #2e2722;
  --ink: #ece3d6;
  --ink-2: #bcae9e;
  --ink-3: #8d8174;
  --rule: #3a312a;
  --accent: #e08a55;
  --accent-ink: #1b1714;
  --accent-soft: #3d2a1e;
  --ok: #9bb57f;
  --warn: #e57a66;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1714;
    --paper-2: #231e1a;
    --paper-3: #2e2722;
    --ink: #ece3d6;
    --ink-2: #bcae9e;
    --ink-3: #8d8174;
    --rule: #3a312a;
    --accent: #e08a55;
    --accent-ink: #1b1714;
    --accent-soft: #3d2a1e;
    --ok: #9bb57f;
    --warn: #e57a66;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

::selection { background: var(--accent-soft); color: var(--ink); }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }

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

h1, h2, h3 { font-weight: 600; line-height: 1.18; margin: 0; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
em { font-style: italic; }
code { font-family: var(--mono); font-size: .82em; background: var(--paper-2); border: 1px solid var(--rule); padding: .05em .35em; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem .8rem; z-index: 10; }

.prose { max-width: var(--measure); margin-inline: auto; padding-inline: 1.5rem; }

/* ───────── Masthead ───────── */

.masthead {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .25s ease;
}
.masthead.scrolled { border-bottom-color: var(--rule); }
.masthead-inner {
  max-width: var(--wide); margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem 1.5rem;
}
.wordmark {
  font-family: var(--serif); font-size: 1.45rem; font-weight: 600;
  text-decoration: none; letter-spacing: -.01em; color: var(--ink);
}
.wordmark span { font-style: italic; color: var(--accent); margin-right: .02em; }
.wordmark.small { font-size: 1.15rem; }
.masthead nav { margin-left: auto; display: flex; gap: 1.4rem; align-items: center; font-family: var(--sans); font-size: .9rem; }
.masthead nav a { text-decoration: none; color: var(--ink-2); }
.masthead nav a:hover { color: var(--ink); }
.masthead nav .nav-cta {
  color: var(--accent-ink); background: var(--accent);
  padding: .38rem .85rem; border-radius: 999px;
}
.masthead nav .nav-cta:hover { color: var(--accent-ink); filter: brightness(1.06); }

.theme-toggle {
  width: 2.1rem; height: 2.1rem; padding: .4rem;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme-toggle svg path { fill: currentColor; stroke: none; }

@media (max-width: 720px) {
  .masthead nav a:not(.nav-cta) { display: none; }
  .masthead nav { gap: .8rem; }
  .masthead-inner { gap: .8rem; padding: .7rem 1.1rem; }
}

/* ───────── Hero ───────── */

.hero {
  max-width: 50rem; margin: 0 auto;
  padding: clamp(3rem, 9vw, 7rem) 1.5rem 2.5rem;
  text-align: center;
}
.eyebrow {
  font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 6.2vw, 4.1rem);
  font-weight: 500; line-height: 1.07; letter-spacing: -.02em;
  text-wrap: balance;
}
.hero h1 em { color: var(--accent); }
.lede {
  text-wrap: balance;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-2);
  max-width: 36rem; margin: 1.6rem auto 2rem;
}
.cta-row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.fineprint { font-family: var(--sans); font-size: .82rem; color: var(--ink-3); margin-top: 1rem; }

.button {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .98rem; font-weight: 550;
  padding: .78rem 1.35rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background-color .15s ease;
}
.button:hover { color: var(--accent-ink); filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.button.quiet:hover { border-color: var(--ink-3); color: var(--ink); filter: none; }
.button.small { font-size: .88rem; padding: .5rem 1rem; }
.button svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Screenshots ───────── */

.shot { max-width: var(--wide); margin: 1rem auto 0; padding: 0 1.5rem; }
.shot-frame {
  border: 1px solid var(--rule); border-radius: 12px; overflow: hidden;
  background: var(--paper-2); box-shadow: var(--shadow);
}
.shot img { display: block; width: 100%; height: auto; }
:root[data-theme="dark"] .shot img { filter: brightness(.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shot img { filter: brightness(.92); } }
.shot figcaption, .shot.small figcaption {
  font-size: .9rem; font-style: italic; color: var(--ink-3);
  text-align: center; margin-top: .9rem;
}

/* ───────── Section titles ───────── */

section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.hero { padding-bottom: 2.5rem; }

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem); font-weight: 500; letter-spacing: -.015em;
  margin-bottom: 1.2rem; display: flex; align-items: baseline; gap: .7rem;
}
.section-title .num {
  font-family: var(--serif); font-style: italic; font-size: .62em; color: var(--accent);
  min-width: 1.6em;
}

/* ───────── Short version ───────── */

.short { max-width: var(--wide); }
.short .section-title { max-width: var(--measure); }
.three {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem;
  counter-reset: s;
}
.three li { counter-increment: s; border-top: 1px solid var(--ink); padding-top: 1.1rem; }
.three li::before {
  content: counter(s); display: block;
  font-family: var(--sans); font-size: .75rem; color: var(--ink-3); margin-bottom: .55rem;
  letter-spacing: .08em;
}
.three h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.three p { color: var(--ink-2); font-size: 1.05rem; }
@media (max-width: 820px) { .three { grid-template-columns: 1fr; gap: 1.8rem; } }

/* ───────── Sync demo ───────── */

.demo-section { background: var(--paper-2); border-block: 1px solid var(--rule); }

.sync-demo {
  max-width: 60rem; margin: 2.2rem auto 0; padding: 0 1.5rem;
  display: grid; grid-template-columns: 1.55fr auto 1fr; align-items: stretch; gap: 0;
}
.device {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px;
  display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden;
  min-width: 0;
}
.device.phone { border-radius: 22px; max-width: 19rem; justify-self: start; width: 100%; }
.device-bar {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .6rem .95rem; border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: .78rem; color: var(--ink-3);
}
.device.phone .device-bar { padding-inline: 1.2rem; }
.device-name { font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.status { display: inline-flex; align-items: center; gap: .4rem; }
.status::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--ok); transition: background-color .2s ease;
}
.status[data-state="syncing"]::before { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.status[data-state="saved"]::before { background: var(--ink-3); }
.status[data-state="attention"] { color: var(--warn); }
.status[data-state="attention"]::before { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }

.device textarea {
  flex: 1; width: 100%; min-height: 15rem; resize: none;
  border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.6;
  padding: 1rem 1.1rem 1.2rem;
}
.device.phone textarea { font-size: 1rem; padding-inline: 1.2rem; }
.device textarea:focus { background: color-mix(in srgb, var(--accent-soft) 18%, var(--paper)); }

.link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: 0 .6rem; min-width: 8.5rem;
}
.link-toggle {
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  background: none; border: 0; cursor: pointer; padding: .5rem .3rem; color: var(--ink-2);
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
}
.link-line { display: block; width: 6.5rem; height: auto; overflow: visible; }
.link-line circle { fill: var(--paper-2); stroke: var(--accent); stroke-width: 1.6; }
.link-line .seg { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; animation: flow .9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -9; } }
.link-hint { font-family: var(--sans); font-size: .72rem; color: var(--ink-3); }

.sync-demo[data-online="false"] .link-line .seg { stroke: var(--ink-3); animation: none; stroke-dasharray: 2 4; }
.sync-demo[data-online="false"] .link-line .mid { visibility: hidden; }
.sync-demo[data-online="false"] .link-line circle { stroke: var(--ink-3); }
.sync-demo[data-online="false"] .link-label { color: var(--ink-3); }
.link-toggle:hover .link-label { color: var(--accent); }

.demo-foot { margin-top: 1.6rem; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.demo-note { font-size: .95rem; color: var(--ink-3); margin: 0; }
.text-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: .85rem; color: var(--accent);
  text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px;
}
.text-button:hover { color: var(--ink); }

@media (max-width: 760px) {
  .sync-demo { grid-template-columns: 1fr; gap: .4rem; }
  .device.phone { justify-self: center; max-width: 22rem; }
  .device textarea { min-height: 10rem; }
  .link { flex-direction: row; padding: .4rem 0; min-width: 0; }
  .link-toggle { flex-direction: row; gap: .9rem; }
  .link-line { width: 5rem; }
}

/* ───────── Design choices ───────── */

.why .intro { color: var(--ink-2); }
.eng-switch { font-family: var(--sans); font-size: .85rem; color: var(--ink-3); margin-bottom: 2.5rem; }
.eng-switch label { display: inline-flex; gap: .5rem; align-items: center; cursor: pointer; }
.eng-switch input { accent-color: var(--accent); width: 1rem; height: 1rem; }

.choice { position: relative; padding: 2.4rem 0 2rem; border-top: 1px solid var(--rule); }
.choice-n {
  position: absolute; left: -4.2rem; top: 2.55rem;
  font-family: var(--sans); font-size: .8rem; font-variant-numeric: tabular-nums;
  color: var(--ink-3); letter-spacing: .06em;
}
@media (max-width: 960px) {
  .choice-n { position: static; display: block; margin-bottom: .5rem; }
}
.choice h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: .8rem; text-wrap: balance; }
.choice > p { color: var(--ink); text-wrap: pretty; }

.tag {
  font-family: var(--sans); font-size: .78em; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent); padding: .1em .5em; border-radius: 5px;
}

details.eng { margin-top: 1.1rem; }
details.eng summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .82rem; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-2); padding: .3rem .1rem; user-select: none;
}
details.eng summary::-webkit-details-marker { display: none; }
details.eng summary::before {
  content: ""; width: .5rem; height: .5rem;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease; margin-right: .1rem;
}
details.eng[open] summary::before { transform: rotate(45deg) translate(-2px, -2px); }
details.eng summary:hover { color: var(--accent); }
details.eng > div {
  margin-top: .6rem; padding: 1rem 1.15rem; border-left: 2px solid var(--accent);
  background: var(--paper-2); border-radius: 0 8px 8px 0;
  font-family: var(--sans); font-size: .92rem; line-height: 1.65; color: var(--ink-2);
}
details.eng > div p:last-child { margin-bottom: 0; }

/* Server-view toggle */
.viewer {
  margin: 1.6rem 0 .4rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); overflow: hidden;
}
.viewer-tabs { display: flex; border-bottom: 1px solid var(--rule); }
.viewer-tabs button {
  flex: 1; background: transparent; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: .85rem; color: var(--ink-3);
  padding: .7rem .6rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.viewer-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.viewer-tabs button:hover { color: var(--ink); }
.viewer-body { position: relative; padding: 1.2rem 1.3rem; min-height: 13.5rem; }
.as-you p { margin-bottom: .6em; font-size: 1.02rem; }
.as-you .v-title { font-weight: 600; font-size: 1.15rem; }
.as-server { display: none; }
.viewer[data-view="server"] .as-you { display: none; }
.viewer[data-view="server"] .as-server { display: block; }
.cipher {
  margin: 0 0 1rem; white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: .74rem; line-height: 1.55; color: var(--ink-3);
}
.meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.2rem; font-family: var(--sans); font-size: .8rem; }
.meta div { display: flex; justify-content: space-between; gap: .6rem; border-top: 1px dashed var(--rule); padding-top: .3rem; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 0; font-weight: 600; color: var(--ink-2); }
@media (max-width: 560px) { .meta { grid-template-columns: 1fr; } }

/* Pairing demo */
.pair-demo {
  margin: 1.6rem 0 .4rem; padding: 1.3rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper);
}
.pair-screens { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pair-screen {
  border: 1px solid var(--rule); border-radius: 8px; padding: .8rem 1rem 1rem;
  display: flex; flex-direction: column; gap: .3rem; background: var(--paper-2);
  transition: border-color .2s ease;
}
.ps-label { font-family: var(--sans); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.ps-code {
  font-family: var(--mono); font-size: clamp(1.5rem, 4.5vw, 2rem); letter-spacing: .08em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.pair-msg { font-family: var(--sans); font-size: .9rem; color: var(--ink-2); margin: 1rem 0 .9rem; min-height: 1.5em; }
.pair-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.pair-demo[data-state="match"] .pair-screen { border-color: var(--ok); }
.pair-demo[data-state="match"] .pair-msg { color: var(--ok); }
.pair-demo[data-state="mismatch"] .pair-screen { border-color: var(--warn); }
.pair-demo[data-state="mismatch"] .pair-msg { color: var(--warn); }
.pair-demo[data-state="done"] .pair-msg { color: var(--ok); }
.ps-code .diff { color: var(--warn); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
@media (max-width: 340px) { .pair-screens { grid-template-columns: 1fr; } }

/* ───────── Writing ───────── */

.writing-grid {
  max-width: var(--wide); margin: 2.4rem auto 0; padding: 0 1.5rem;
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 3rem; align-items: start;
}
.features { list-style: none; margin: 0; padding: 0; }
.features li { padding: .85rem 0; border-top: 1px solid var(--rule); font-size: 1.02rem; color: var(--ink-2); }
.features li:last-child { border-bottom: 1px solid var(--rule); }
.features strong { color: var(--ink); font-weight: 600; display: block; margin-bottom: .1rem; }
.shot.small { padding: 0; margin: 0; position: sticky; top: 6rem; max-width: 34rem; justify-self: center; width: 100%; }
@media (max-width: 900px) {
  .writing-grid { grid-template-columns: 1fr; gap: 2rem; }
  .shot.small { position: static; }
}

.status-line { margin-top: 2.6rem; color: var(--ink-2); font-size: 1rem; }
.st {
  font-family: var(--sans); font-size: .8rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--rule); border-radius: 999px; padding: .12rem .6rem; color: var(--ink);
  background: var(--paper-2);
}
.st.warn { color: var(--warn); }

/* ───────── Limits ───────── */

.limits, .writing { border-top: 1px solid var(--rule); }
.limit-list { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.limit-list li { padding: 1.1rem 0 1.1rem 1.6rem; position: relative; border-top: 1px solid var(--rule); }
.limit-list li::before {
  content: ""; position: absolute; left: 0; top: 1.95rem; width: .7rem; height: 2px; background: var(--accent);
}
.limit-list h3 { font-size: 1.12rem; margin-bottom: .35rem; }
.limit-list p { margin: 0; color: var(--ink-2); font-size: 1.02rem; }

/* ───────── Download ───────── */

.download { background: var(--paper-2); border-top: 1px solid var(--rule); }
.dl-lede { color: var(--ink-2); }
.dl-primary { margin: 1.6rem 0 .4rem; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.dl-primary .fineprint { margin: 0; }

.dl-table {
  max-width: var(--measure); margin: 2.4rem auto 0; padding: 0 1.5rem;
}
.dl-row {
  display: grid; grid-template-columns: 8rem 1fr auto; gap: 1rem; align-items: baseline;
  padding: .95rem 0; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: .92rem;
}
.dl-row:last-child { border-bottom: 1px solid var(--rule); }
.dl-row.current { background: transparent; }
.dl-row.current .dl-os::after { content: " · you"; color: var(--accent); font-weight: 500; }
.dl-os { font-weight: 600; color: var(--ink); }
.dl-desc { color: var(--ink-3); }
.dl-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.dl-links a { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.dl-links a:hover { text-decoration: underline; }
.dl-soon { color: var(--ink-3); font-style: italic; white-space: nowrap; }
@media (max-width: 600px) {
  .dl-row { grid-template-columns: 1fr auto; }
  .dl-desc { grid-column: 1 / -1; grid-row: 2; }
}

.dl-extra { margin-top: 2.6rem; }
.dl-extra p { font-size: 1rem; color: var(--ink-2); }
.copy-line {
  display: flex; align-items: center; gap: .8rem; justify-content: space-between;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  padding: .6rem .9rem; margin-bottom: 1rem; overflow-x: auto;
}
.copy-line code { background: none; border: 0; padding: 0; white-space: nowrap; color: var(--ink); }

/* ───────── Footer ───────── */

.foot { border-top: 1px solid var(--rule); }
.foot-inner {
  max-width: var(--wide); margin: 0 auto; padding: 2.4rem 1.5rem 3rem;
  display: flex; gap: 1.5rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
}
.foot p { margin: 0; font-style: italic; color: var(--ink-3); font-size: .95rem; }

