/* Shared by index.html and showcase.html.
   Swatch-sheet look: flat colour chips with their hex next to them, on a
   mid-grey ground so the chips read true. White is only for the two things
   you can actually use, the demo and the editor. */

:root {
  --surround: #D6D3CC;
  --card: #ffffff;
  --ink: #23222A;
  --ink-soft: rgba(35, 34, 42, 0.72);
  --rule: rgba(35, 34, 42, 0.22);
  --pink: #DA4167;
  --navy: #2E4057;
  --gold: #F4D35E;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--surround);
  color: var(--ink);
  font-family: Archivo, system-ui, sans-serif;
  font-variation-settings: 'wdth' 100;
  font-size: 15px;
  line-height: 1.55;
  padding: 1.75rem 1.25rem 4rem;
}

.page { max-width: 1120px; margin: 0 auto; }

/* ── Type ──────────────────────────────────────────────── */

/* Fraunces for headings. The SOFT and WONK axes round the terminals and tilt
   the odd letter so it doesn't read like a software company. Archivo does
   everything else. */
h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-variation-settings: 'opsz' 144, 'SOFT' 70, 'WONK' 1;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.6rem, 7vw, 4rem); }

h2 {
  font-size: 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1rem;
}

h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }

p { max-width: 62ch; }
p + p { margin-top: 0.7rem; }

a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--pink); }

code, .mono { font-family: var(--mono); font-size: 0.85em; }

:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

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

.masthead {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.mark {
  width: clamp(86px, 11vw, 116px);
  aspect-ratio: 1;
  flex: none;
  display: flex;
  align-items: flex-end;
  padding: 0.5rem;
  background: var(--pink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.mark:hover { background: var(--ink); color: #fff; }

.tagline {
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 2rem;
  font-weight: 700;
}

.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--pink); }
.nav a[aria-current] { color: var(--pink); text-decoration: underline; }

/* ── Two-column shell ──────────────────────────────────── */

.cols {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2.5rem;
  align-items: start;
}

.col-left { position: sticky; top: 1.5rem; }

.col-right > section + section { margin-top: 2.5rem; }

@media (max-width: 900px), (max-height: 900px) {
  .col-left { position: static; }
}

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ── Pitch ─────────────────────────────────────────────── */

.lede { font-size: 1.15rem; line-height: 1.45; }

.cta {
  display: inline-block;
  margin: 1.1rem 0 1.75rem;
  padding: 0.65rem 1.4rem;
  background: var(--ink);
  color: var(--surround);
  font-weight: 700;
  font-variation-settings: 'wdth' 112;
  text-decoration: none;
}

.cta:hover { background: var(--pink); color: #fff; }

/* ── The demo and the editor ───────────────────────────── */

.panel {
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 0.9rem;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.panel-note { font-size: 0.78rem; color: var(--ink-soft); font-weight: 400; }

.demo-frame { width: 100%; height: 400px; border: 0; display: block; }

/* ── Swatch controls ───────────────────────────────────── */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 0.5rem;
}

.swatch { display: block; }

.swatch input[type="color"] {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule);
  background: none;
  cursor: pointer;
}

.swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type="color"]::-webkit-color-swatch { border: 0; }
.swatch input[type="color"]::-moz-color-swatch { border: 0; }

.swatch-label {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.25rem;
  line-height: 1.3;
}

.swatch-hex {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.slider { font-size: 0.78rem; }
.slider input[type="range"] { width: 100%; accent-color: var(--pink); }
.slider select, .slider input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.25rem;
  border: 1px solid var(--rule);
  background: #fff;
  color: inherit;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.9rem 0 0.5rem;
}

.btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.btn:hover { background: var(--ink); color: var(--card); }
.btn-preset { font-weight: 400; border-width: 1px; }

.css-box {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 0.55rem;
  border: 1px solid var(--rule);
  background: #FBFBF9;
  color: inherit;
}

.ref { margin-top: 0.75rem; font-size: 0.8rem; }
.ref summary { cursor: pointer; font-weight: 700; padding: 0.3rem 0; }
.ref table { width: 100%; border-collapse: collapse; margin-bottom: 0.5rem; }
.ref td {
  padding: 0.2rem 0.4rem 0.2rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.76rem;
  vertical-align: top;
}
.ref td:first-child { width: 45%; }

/* ── Roadmap ───────────────────────────────────────────── */

.roadmap { list-style: none; }

.roadmap li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.32rem 0;
  font-size: 0.9rem;
}

.roadmap li + li { border-top: 1px solid var(--rule); }

/* Filled chip shipped, hollow one didn't. */
.chip {
  flex: none;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--ink);
  transform: translateY(1px);
}

.chip-done { background: var(--navy); border-color: var(--navy); }
.chip-wip { background: var(--gold); }
.chip-todo { background: none; }

.status {
  flex: none;
  min-width: 5.5em;
  font-size: 0.72rem;
  font-weight: 700;
  font-variation-settings: 'wdth' 88;
}

.roadmap .done { color: var(--ink-soft); }

/* ── FAQ, tables, footer ───────────────────────────────── */

.faq > div + div { margin-top: 1.1rem; }
.faq dt { font-weight: 700; }
.faq dd { font-size: 0.93rem; }
.faq dd a { color: var(--navy); }

.tags { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tags td { padding: 0.3rem 0.5rem 0.3rem 0; border-bottom: 1px solid var(--rule); }
.tags td:first-child { width: 45%; }
.tags code {
  background: rgba(35, 34, 42, 0.08);
  padding: 0.1rem 0.3rem;
}

.thanks { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.9rem; }

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  font-size: 0.82rem;
}

/* ── Showcase ──────────────────────────────────────────── */

.showcase-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.showcase-card {
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 0.5rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
}

.showcase-card img { width: 100%; display: block; }
.showcase-card .cap { display: block; font-weight: 700; font-size: 0.85rem; margin-top: 0.4rem; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(35, 34, 42, 0.75);
  padding: 1.5rem;
  overflow: auto;
}

.modal-overlay.open { display: flex; align-items: center; justify-content: center; }

.modal {
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 1rem;
  max-width: 680px;
  width: 100%;
  position: relative;
}

.modal img { width: 100%; display: block; margin-bottom: 0.75rem; }

.modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
