/* Notestark — shared stylesheet.
   Tokens match the extension's popup and the original site/ pages. */

:root {
  --bg: #ffffff;
  --panel: #f7f8fa;
  --ink: #1f2937;
  --muted: #5b6675;
  --line: #e3e6ea;
  --brand: #ffc933;
  --accent: #b45309;
  --mark: #ffd54a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161c24;
    --panel: #1f2937;
    --ink: #e8ecf1;
    --muted: #9aa6b4;
    --line: #2d3947;
    --accent: #ffc933;
    --mark: #8a6d1f;
  }
}

:root[data-theme="dark"] {
  --bg: #161c24;
  --panel: #1f2937;
  --ink: #e8ecf1;
  --muted: #9aa6b4;
  --line: #2d3947;
  --accent: #ffc933;
  --mark: #8a6d1f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 54rem; margin: 0 auto; padding: 1.75rem 1.25rem 5rem; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- site header ---------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink); font-weight: 700;
  letter-spacing: -.01em; font-size: 1.05rem;
}
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--brand);
  display: grid; place-items: center; flex: none;
}
.brand .mark svg { width: 19px; height: 19px; }
.topbar nav { margin-left: auto; display: flex; gap: 1.15rem; flex-wrap: wrap; }
.topbar nav a {
  color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 500;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* --- hero ----------------------------------------------------------------- */

.hero { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 1.5rem; }
.hero .glyph {
  width: 76px; height: 76px; border-radius: 17px; background: var(--brand);
  display: grid; place-items: center; flex: none;
}
.hero .glyph svg { width: 44px; height: 44px; }

h1 { font-size: 2.35rem; line-height: 1.1; letter-spacing: -.025em; margin: .15rem 0 .35rem; }
.tag { color: var(--muted); font-size: 1.12rem; margin: 0; }

h2 {
  font-size: 1.35rem; letter-spacing: -.015em; margin: 3rem 0 1rem;
  padding-top: 1.5rem; border-top: 1px solid var(--line);
}
h3 { font-size: 1rem; margin: 0 0 .4rem; }

.stamp { color: var(--muted); font-size: .92rem; margin: 0 0 2rem; }

.lede {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 1.1rem 1.25rem; margin: 0 0 2rem;
}
.lede p:first-child { margin-top: 0; }
.lede p:last-child { margin-bottom: 0; }

mark { background: var(--mark); color: inherit; padding: 0 .12em; border-radius: 2px; }

/* --- swatches + buttons --------------------------------------------------- */

.swatches { display: flex; gap: .5rem; margin: 1.75rem 0 2rem; }
.swatches i { width: 22px; height: 22px; border-radius: 50%; display: block; }

.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0 0 3rem; }
.btn {
  display: inline-block; padding: .7rem 1.25rem; border-radius: 8px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid var(--line); color: var(--ink); background: var(--panel);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #1f2937; }
.btn.primary:hover { filter: brightness(.95); }

/* --- cards ---------------------------------------------------------------- */

.grid {
  display: grid; gap: 1rem; margin: 1.5rem 0;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.1rem 1.25rem;
}
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* --- tables --------------------------------------------------------------- */

.scroll { overflow-x: auto; margin: 1.25rem 0; }
.tbl { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .95rem; }
.tbl th, .tbl td {
  text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl th { background: var(--panel); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }

/* --- figures -------------------------------------------------------------- */

figure { margin: 1.5rem 0; }
figure img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 10px;
}
figcaption { color: var(--muted); font-size: .9rem; margin-top: .6rem; }

/* --- misc ----------------------------------------------------------------- */

code {
  background: var(--panel); border: 1px solid var(--line);
  padding: .08em .35em; border-radius: 4px;
  font: .88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: .2rem .5rem; border-radius: 5px;
  background: var(--brand); color: #1f2937; vertical-align: middle;
}

.faq { margin: 1.25rem 0; }
.faq details {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .85rem 1.1rem; margin-bottom: .6rem; background: var(--panel);
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: .6rem; }
.faq p { margin: .5rem 0 0; color: var(--muted); font-size: .95rem; }

/* --- footer --------------------------------------------------------------- */

footer {
  margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}
footer nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

@media (max-width: 34rem) {
  h1 { font-size: 1.9rem; }
  .hero { gap: 1rem; }
  .hero .glyph { width: 60px; height: 60px; border-radius: 14px; }
  .hero .glyph svg { width: 35px; height: 35px; }
}

/* --- swatch colours (kept out of inline styles so the CSP can stay strict) -- */

.swatches .s1 { background: #ffd54a; }
.swatches .s2 { background: #8ee6a8; }
.swatches .s3 { background: #ffa8c5; }
.swatches .s4 { background: #ff9c47; }
.swatches .s5 { background: #9ecbff; }
.swatches .s6 { background: #d9c4ff; }

/* --- spacing utilities ----------------------------------------------------- */

.mt-2 { margin-top: 2rem; }
