/* Context Clipboard website. A plain project page: serif headings, prose
   at reading width, one accent colour used sparingly. Dark or light follows
   the system, with a toggle (data-theme on <html>). No web fonts or other
   third-party requests. */

:root {
  --bg: #121212;
  --bg-2: #1a1a1a;
  --surface: #1c1c1c;
  --surface-2: #242424;
  --rule: #2c2c2c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ececea;
  --text-2: #b4b4ae;
  --muted: #84847e;
  --accent: #f2b53a;
  --accent-ink: #1b1405;
  --accent-soft: rgba(242, 181, 58, 0.14);
  --danger: #ff8a8a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --tile-l: 18%;
  --tile-ink-l: 78%;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf8f4;
    --bg-2: #f2efe8;
    --surface: #ffffff;
    --surface-2: #f4f1ea;
    --rule: #e4dfd4;
    --border: rgba(40, 30, 10, 0.1);
    --border-strong: rgba(40, 30, 10, 0.18);
    --text: #1d1b17;
    --text-2: #4d4a42;
    --muted: #87837a;
    --accent: #b8650a;
    --accent-ink: #ffffff;
    --accent-soft: rgba(184, 101, 10, 0.1);
    --danger: #c0392b;
    --shadow: 0 18px 44px rgba(60, 45, 20, 0.12);
    --tile-l: 93%;
    --tile-ink-l: 34%;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #faf8f4;
  --bg-2: #f2efe8;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --rule: #e4dfd4;
  --border: rgba(40, 30, 10, 0.1);
  --border-strong: rgba(40, 30, 10, 0.18);
  --text: #1d1b17;
  --text-2: #4d4a42;
  --muted: #87837a;
  --accent: #b8650a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(184, 101, 10, 0.1);
  --danger: #c0392b;
  --shadow: 0 18px 44px rgba(60, 45, 20, 0.12);
  --tile-l: 93%;
  --tile-ink-l: 34%;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* Author display rules (e.g. .demo-detail's flex) must not beat [hidden]. */
[hidden] { display: none !important; }
html { scroll-padding-top: 64px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.86em; padding: 0.08em 0.3em; border-radius: 4px; background: var(--surface-2); }
kbd {
  display: inline-block;
  min-width: 1.55em;
  padding: 0 0.35em;
  font-size: 0.76em;
  line-height: 1.6;
  text-align: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}
strong { font-weight: 650; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 6px 10px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--rule); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.name { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; text-decoration: none; }
.name img { border-radius: 5px; }
.top nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.top nav a { color: var(--text-2); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.theme { display: inline-flex; padding: 5px; color: var(--text-2); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.theme:hover { color: var(--text); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.i-moon { display: none !important; }
:root[data-theme="light"] .i-sun { display: none !important; }
:root[data-theme="light"] .i-moon { display: block !important; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: none !important; }
  :root:not([data-theme="dark"]) .i-moon { display: block !important; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  font: 600 15.5px/1.2 var(--sans);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 7px 12px; font-size: 13px; }

/* Intro */
.intro { padding: 64px 0 72px; }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 64px; align-items: start; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { margin: 12px 0 18px; font-size: clamp(38px, 5vw, 54px); line-height: 1.08; }
.lede { margin: 0 0 26px; font-size: 19.5px; color: var(--text-2); max-width: 31em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.small { font-size: 14.5px; color: var(--muted); }
.intro .small { margin: 18px 0 0; line-height: 1.75; }

/* Sections */
.block { padding: 56px 0 64px; border-top: 1px solid var(--rule); }
h2 { margin: 0 0 14px; font-size: 32px; line-height: 1.2; }
.para { margin: 0 0 22px; max-width: 40em; color: var(--text-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.two .para { margin-bottom: 0; }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 48px; margin: 34px 0 0; }
.features dt { font-weight: 650; margin-bottom: 4px; }
.features dd { margin: 0; color: var(--text-2); font-size: 16px; }

table { border-collapse: collapse; width: 100%; max-width: 760px; font-size: 16px; }
td { padding: 9px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; color: var(--text-2); }
td:first-child { width: 1%; padding-right: 28px; white-space: nowrap; }
.ops button {
  padding: 0;
  font: 14.5px var(--mono);
  color: var(--accent);
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  cursor: pointer;
}
.ops button:hover { border-bottom-style: solid; }

.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 6px 0 0; border-bottom: 1px solid var(--rule); }
.tabs button {
  margin-bottom: -1px;
  padding: 9px 14px;
  font: 600 15px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { padding: 18px 0 0; max-width: 760px; }
.tab-panel ol { margin: 0; padding-left: 22px; color: var(--text-2); }
.tab-panel li { margin: 6px 0; }
.tab-panel .small { margin: 14px 0 0; }
.code-block { position: relative; }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.7; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 8px; }
.code-block code { padding: 0; background: none; }
.copy-btn { position: absolute; top: 9px; right: 9px; padding: 4px 9px; font: 600 12px var(--sans); color: var(--text-2); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; }
.copy-btn.done { color: var(--accent); }
.copy-btn.done::after { content: " ✓"; }

.notes { margin: 0; padding-left: 20px; max-width: 44em; color: var(--text-2); }
.notes li { margin: 0 0 10px; }

.foot { padding: 26px 0 40px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14.5px; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

/* Demo: a working copy of the extension popup */
.demo-wrap { margin: 0; }
.demo-wrap figcaption { margin-top: 14px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.demo-wrap figcaption button {
  padding: 0;
  font: 13px var(--mono);
  color: var(--accent);
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  cursor: pointer;
}
.demo {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
}
.demo-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.demo-search { position: relative; display: flex; align-items: center; }
.demo-search svg { position: absolute; left: 11px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.demo-search input {
  width: 100%; height: 34px; padding: 0 12px 0 34px;
  font: 13.5px var(--sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px;
}
.demo-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demo-kinds { display: flex; gap: 2px; margin-top: 8px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.demo-kinds button { flex: 1; padding: 4px 0; font: 600 12px var(--sans); color: var(--text-2); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.demo-kinds button[aria-pressed="true"] { color: var(--accent); background: var(--surface-2); }

.demo-list { list-style: none; margin: 0; padding: 6px; height: 380px; overflow-y: auto; scrollbar-width: thin; }
.row { position: relative; display: flex; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.row:hover { background: var(--surface-2); }
.row.active { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.tile {
  position: relative; flex: 0 0 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: hsl(var(--hue) 70% var(--tile-ink-l));
  background: hsl(var(--hue) 55% var(--tile-l));
  border: 1px solid hsl(var(--hue) 50% 50% / 0.3);
  border-radius: 9px;
}
.tile.plain { --hue: 240; color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.badge {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 15px; height: 15px; padding: 0 2px;
  display: flex; align-items: center; justify-content: center;
  font: 700 8px var(--mono); color: var(--text-2);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 999px;
}
.badge.accent { top: -4px; bottom: auto; color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.preview { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.code .preview { font: 12px var(--mono); }
.meta { display: flex; gap: 4px; min-width: 0; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.meta .src { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .when { flex: none; white-space: nowrap; }
.meta .pin { color: var(--accent); font-size: 9px; line-height: 1.9; }
.tags { display: flex; gap: 4px; margin-top: 5px; }
.tags span { font-size: 10.5px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-2); }
.note { margin-top: 4px; font-size: 11px; color: var(--danger); font-style: italic; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 80px 20px; color: var(--muted); text-align: center; }
.empty strong { color: var(--text); font-size: 14px; }
.empty button { font: 12px var(--mono); padding: 1px 6px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; cursor: pointer; }
.demo-foot { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--border); background: var(--bg-2); color: var(--muted); font-size: 11.5px; }
.demo-foot kbd { font-size: 10px; }

.demo-detail {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 12px;
  padding: 0 0 14px;
  overflow-y: auto;
  background: var(--surface);
}
.d-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-weight: 650; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.d-back { width: 30px; height: 30px; font-size: 16px; color: var(--text); background: none; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; }
.d-body { margin: 0 14px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font: 14px/1.55 var(--sans); background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.d-body.code { font: 12px/1.6 var(--mono); }
.d-facts { display: grid; grid-template-columns: 70px 1fr; gap: 8px 12px; margin: 0 14px; font-size: 12.5px; }
.d-facts dt { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.d-facts dd { margin: 0; color: var(--text-2); min-width: 0; word-break: break-word; }
.d-facts .ctx { font-style: italic; }
.d-facts mark { background: var(--accent-soft); color: var(--text); font-style: normal; border-radius: 3px; padding: 0 2px; }
.d-actions { display: flex; gap: 8px; margin: auto 14px 0; }
.d-actions .btn { flex: 1; text-align: center; }

.demo-toast {
  position: absolute; left: 50%; bottom: 44px;
  transform: translate(-50%, 10px);
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent);
  border-radius: 999px;
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.demo-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Narrow screens */
@media (max-width: 900px) {
  .intro { padding: 40px 0 56px; }
  .intro-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .demo-wrap { max-width: 460px; }
  .two, .features { grid-template-columns: 1fr; }
  .two { gap: 18px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .top nav a:not([href^="https"]) { display: none; }
  .lede { font-size: 18px; }
  h2 { font-size: 27px; }
  .block { padding: 44px 0 52px; }
  .demo-list { height: 340px; }
  .demo-foot .keys { display: none; }
  td:first-child { padding-right: 16px; }
  .ops td:first-child, .keys td:first-child { white-space: normal; }
}
