/* Poke UI site. Light only: paper, ink and one accent for the marks. */
:root {
  color-scheme: light;
  --paper: #f4ecdc; --sheet: #f7f2e8; --sunken: #efe6d4; --hover: #ece4d4;
  --ink: #2a241e; --ink-2: #40372e; --muted: #6b6156; --faint: #9a8f80; --line: #d9ceba;
  --rust: #b4432a; --moss: #4d6b2c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "TeX Gyre Pagella", "URW Palladio L", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, 0, 0, 1);
  /* The proof-sheet grid: a text column and a margin column for notes and captions. */
  --side: clamp(20px, 5vw, 64px);
  --gutter: clamp(32px, 5vw, 72px);
  --margin-w: 272px;
  --pin-shadow: 0 0 0 1px rgba(26,20,14,.32), 0 2px 6px rgba(26,20,14,.30);
  --lift: 0 1px 2px rgba(26,20,14,.16), 0 12px 32px -10px rgba(26,20,14,.38);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; font: 400 17px/1.6 var(--sans); }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: var(--rust); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .88em; }
kbd {
  font: 500 .8em/1 var(--mono); padding: 2px 6px 3px; border: 1px solid var(--ink); border-bottom-width: 2px;
  border-radius: 2px; background: var(--sheet); white-space: nowrap;
}
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fine { font: 400 13px/1.5 var(--mono); color: var(--muted); }

.page { max-width: 1320px; margin: 0 auto; padding: 0 var(--side); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--margin-w); column-gap: var(--gutter); }
.grid > .margin { grid-column: 2; }

/* Masthead */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 22px; border-bottom: 1px solid var(--ink); }
.lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.lockup img { width: 36px; height: 36px; }
.wordmark { font: 700 30px/1 var(--serif); letter-spacing: -.02em; white-space: nowrap; }
.mast nav { display: flex; gap: 28px; font: 500 14px/1 var(--sans); color: var(--muted); }
.mast nav a { text-decoration: none; padding: 6px 0; }
.mast nav a:hover { color: var(--ink); }

/* Hero: the headline carries Poke UI's own mark, with its note in the margin. */
.hero { padding-top: clamp(64px, 10vw, 136px); padding-bottom: clamp(48px, 6vw, 72px); }
.marked { position: relative; }
h1 {
  margin: 0; font: 700 clamp(40px, 6vw, 84px)/1 var(--serif); letter-spacing: -.03em;
  text-wrap: balance; padding-top: .06em;
}
/* Pin geometry follows the extension: the sharp corner sits 3 px inside the element's top-left corner. */
.pin, .dpin {
  position: absolute; left: -19px; top: -19px; z-index: 2; min-width: 22px; height: 22px; padding: 0 5px;
  border: 2px solid #fff; border-radius: 11px 11px 3px 11px; background: var(--rust); color: #fff;
  font: 700 11px/18px var(--sans); font-variant-numeric: tabular-nums; text-align: center; box-shadow: var(--pin-shadow);
}
.leader { position: absolute; left: 3px; top: -9px; right: calc(-1 * var(--gutter)); height: 1px; background: var(--rust); transform-origin: left; }
.hl, .dhl {
  position: absolute; inset: 0; pointer-events: none; border: 2px solid var(--rust); border-radius: 2px;
  background: color-mix(in srgb, var(--rust) 8%, transparent); box-shadow: 0 0 0 1px rgba(255,255,255,.85);
}
.hl { opacity: 0; transition: opacity 140ms var(--ease); }
.hero:has(.mnote:hover) .hl { opacity: 1; }

.mnote { align-self: start; margin-top: -18px; font: 400 15px/1.5 var(--sans); }
.meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.num {
  flex: none; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px 9px 2px 9px; background: var(--rust); color: #fff;
  font: 700 10.5px/18px var(--sans); font-variant-numeric: tabular-nums; text-align: center;
}
.sel { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 12px/1.2 var(--mono); color: var(--muted); }
.mnote-text { margin-top: 12px; font: 400 21px/1.3 var(--serif); letter-spacing: -.005em; }
.gloss { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.lede { margin-top: clamp(32px, 4vw, 48px); max-width: 33em; font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 32px; }
.button {
  display: inline-flex; align-items: center; height: 48px; padding: 0 24px; background: var(--ink); color: var(--sheet);
  border-radius: 2px; text-decoration: none; font: 600 15px/1 var(--sans); letter-spacing: .01em;
  transition: background-color 90ms var(--ease);
}
.button:hover { background: var(--ink-2); }

/* The one orchestrated moment: the mark lands, its leader runs out to the margin, the note appears. */
@media (prefers-reduced-motion: no-preference) {
  .pin { animation: fade 240ms var(--ease) 120ms backwards; }
  .leader { animation: draw 720ms var(--ease) 320ms backwards; }
  .mnote { animation: fade 360ms var(--ease) 880ms backwards; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes draw { from { transform: scaleX(0); } }

/* Film */
.film { margin: 0; }
.frame { position: relative; border: 1px solid var(--ink); background: var(--paper); aspect-ratio: 1280 / 800; }
.frame video { width: 100%; height: 100%; }
.film figcaption { align-self: end; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font: 400 13px/1.55 var(--mono); color: var(--muted); }
.quiet {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; margin: 0 0 0 -12px;
  border: 0; border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer;
  font: 600 13px/1 var(--sans); letter-spacing: .01em; transition: background-color 90ms var(--ease), opacity 90ms var(--ease);
}
.quiet:hover { background: var(--hover); }
.quiet:disabled { opacity: .38; cursor: default; background: transparent; }
.quiet svg { width: 12px; height: 12px; fill: currentColor; }
.play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 18px 0 15px; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); color: var(--ink);
  font: 600 14px/1 var(--sans); cursor: pointer; box-shadow: var(--lift);
}
.play svg { width: 14px; height: 14px; fill: currentColor; }
.play:hover { background: var(--hover); }

/* Sections */
.section { padding-top: clamp(88px, 11vw, 152px); }
h2 {
  margin: 0; font: 700 clamp(30px, 3.8vw, 48px)/1.08 var(--serif); letter-spacing: -.022em; text-wrap: balance; max-width: 17em;
}
h3 { margin: 10px 0 0; font: 700 22px/1.2 var(--serif); letter-spacing: -.01em; text-wrap: balance; }

/* A contact sheet: three frames in order, each with its number and caption underneath. */
.steps {
  grid-column: 1 / -1; list-style: none; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px clamp(24px, 3vw, 40px);
}
.steps img { border: 1px solid var(--ink); }
.step-text { margin-top: 18px; max-width: 26em; }
.step { font: 500 13px/1 var(--mono); color: var(--rust); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.steps p { margin-top: 10px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }

/* What you paste: a working page demo */
.intro { grid-column: 2; align-self: end; color: var(--muted); font-size: 15.5px; }
.try { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px var(--gutter); align-items: start; margin-top: clamp(40px, 5vw, 64px); }
.stage { position: relative; }
.try-hint { margin-bottom: 22px; font-size: 15.5px; color: var(--ink-2); max-width: 30em; }
.fields { margin: 0; border-bottom: 1px solid var(--line); }
.fields > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 20px; padding: 15px 0 16px; border-top: 1px solid var(--line); }
.fields dt { font: 700 19px/1.3 var(--serif); letter-spacing: -.005em; }
.fields dd { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; padding-top: 1px; }
.demo-on .fields > div { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.demo-on .fields > div:focus-visible { outline: none; }
.dhl { inset: auto; z-index: 1; }
.dpin { cursor: pointer; transition: box-shadow 90ms var(--ease); }
.dpin:hover { box-shadow: 0 0 0 1px rgba(26,20,14,.42), 0 4px 10px rgba(26,20,14,.34); }
.dpin[aria-expanded="true"] { outline: 2px solid var(--rust); outline-offset: 2px; }
.dpin:focus-visible { outline: 2px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 1px rgba(26,20,14,.32), 0 0 0 5px var(--ink); border-radius: 11px 11px 3px 11px; }

/* The demo editor matches the extension's editor. */
.editor {
  position: absolute; z-index: 3; width: min(320px, 100%); padding: 10px; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 4px; box-shadow: var(--lift); font-size: 13px; line-height: 1.4;
}
.editor .meta { margin-bottom: 8px; }
.editor .sel { font-size: 11px; }
.field { position: relative; }
.field textarea {
  display: block; width: 100%; min-height: 36px; max-height: 200px; padding: 8px 32px 8px 10px; margin: 0; resize: none;
  field-sizing: content; overflow-y: auto; color: var(--ink); background: #efe8da; border: 1px solid #ddd3c2; border-radius: 2px;
  font: 400 13px/1.45 var(--sans); transition: border-color 90ms var(--ease), box-shadow 90ms var(--ease);
}
.field textarea::placeholder { color: var(--faint); }
.field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(42,36,30,.12); }
.enter-hint { position: absolute; right: 9px; bottom: 9px; display: flex; color: var(--faint); pointer-events: none; }
.enter-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .editor { animation: fade 120ms var(--ease); }
}

.output { min-width: 0; }
pre.md {
  margin: 0; padding: 22px 26px; max-height: min(640px, 80vh); overflow: auto; position: relative; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 2px; font: 400 13px/1.65 var(--mono); tab-size: 2;
  white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
pre.md .h { font-weight: 700; }
pre.md .k { color: var(--moss); }
pre.md .f { color: var(--faint); }
pre.md .block { display: block; margin: 0 -26px; padding: 0 26px; }
@media (prefers-reduced-motion: no-preference) {
  pre.md .block.fresh { animation: settle 1400ms var(--ease); }
}
@keyframes settle { from { background: color-mix(in srgb, var(--rust) 10%, transparent); } }
.output-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-top: 14px; }
.output-foot .fine { flex: 1 1 18em; max-width: 34em; }
.output-actions { display: flex; gap: 8px; margin-right: -12px; }
.output-actions .quiet { margin: 0; }

/* Privacy */
.privacy-body > p { margin-top: 24px; max-width: 36em; }
.perms { width: 100%; margin-top: 36px; border-collapse: collapse; font-size: 15.5px; }
.perms caption { text-align: left; padding-bottom: 10px; font: 400 13px/1.4 var(--mono); color: var(--muted); }
.perms th, .perms td { text-align: left; vertical-align: baseline; padding: 13px 0; border-top: 1px solid var(--line); }
.perms tr:last-child th, .perms tr:last-child td { border-bottom: 1px solid var(--line); }
.perms th { width: 9em; padding-right: 20px; font: 500 14px/1.4 var(--mono); }
.perms td { color: var(--muted); }
.aside-note { align-self: end; display: grid; gap: 14px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.aside-note p:last-child { color: var(--ink); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: clamp(88px, 11vw, 144px);
  padding: 20px 0 44px; border-top: 1px solid var(--ink); font: 400 13px/1.5 var(--mono); color: var(--muted);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Privacy policy page */
.doc { max-width: 680px; padding-top: clamp(56px, 9vw, 112px); }
.doc h1 { font-size: clamp(40px, 6vw, 72px); max-width: none; }
.doc .updated { margin: 14px 0 44px; }
.doc h2 { font-size: 24px; margin: 48px 0 10px; }
.doc p, .doc li { max-width: 38em; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 12px 0; padding-left: 1.2em; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--rust); }

@media (max-width: 1040px) {
  .try { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  :root { --margin-w: 0px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .grid > .margin, .intro { grid-column: 1; }
  .leader { display: none; }
  .mnote { margin-top: 44px; max-width: 30em; padding-left: 16px; border-left: 1px solid var(--rust); }
  .film figcaption { margin-top: 16px; }
  .intro { margin-top: 20px; max-width: 34em; }
  .aside-note { margin-top: 32px; max-width: 36em; }
}
@media (max-width: 560px) {
  .mast nav { display: none; }
  .lede { font-size: 17.5px; }
  pre.md { padding: 18px 16px; font-size: 12px; }
  pre.md .block { margin: 0 -16px; padding: 0 16px; }
  .fields > div { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
