/* Datashaper marketing site. Tokens and rules: DESIGN.md */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/IBMPlexSerif-500italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #fafaf7;
  --surface: #ffffff;
  --sunken: #f2f1ec;
  --border: #e3e1d9;
  --border-strong: #cfccc1;
  --text: #17181a;
  --text-muted: #5c5f66;
  --primary: #17181a;
  --on-primary: #ffffff;
  --accent: #ffe45c;
  --create-bg: #e6f4ea;
  --create: #146c31;
  --update-bg: #fff3b0;
  --update: #7a5b00;
  --delete-bg: #fde8e8;
  --delete: #b42318;
  --focus: #2f5bd3;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-display: 56px;
  --lh-display: 60px;
  --fs-h2: 40px;
  --lh-h2: 46px;
  --fs-h3: 22px;
  --lh-h3: 30px;
  --fs-lead: 20px;
  --lh-lead: 30px;
  --fs-body: 17px;
  --lh-body: 28px;
  --fs-small: 15px;
  --lh-small: 22px;
  --fs-cell: 13px;
  --lh-cell: 18px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --s10: 128px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-panel: 0 0 0 1px rgb(0 0 0 / 0.02), 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 12px -4px rgb(0 0 0 / 0.06), 0 20px 40px -12px rgb(0 0 0 / 0.12), 0 48px 80px -32px rgb(0 0 0 / 0.14);

  --content: 1120px;
  --text-col: 680px;
  --gutter: var(--s5);
  --section: var(--s9);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #18191c;
    --sunken: #1f2024;
    --border: #2c2e33;
    --border-strong: #3a3d43;
    --text: #ecedee;
    --text-muted: #a0a3aa;
    --primary: #ecedee;
    --on-primary: #111214;
    --create-bg: #12301d;
    --create: #5fd383;
    --update-bg: #3a3210;
    --update: #ffe45c;
    --delete-bg: #3a1616;
    --delete: #ff8a80;
    --focus: #8fa9ff;
    --shadow-panel: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 2px 4px rgb(0 0 0 / 0.3), 0 24px 48px -16px rgb(0 0 0 / 0.6);
  }
}

@media (max-width: 720px) {
  :root {
    --fs-display: 38px;
    --lh-display: 42px;
    --fs-h2: 30px;
    --lh-h2: 36px;
    --fs-h3: 20px;
    --lh-h3: 28px;
    --fs-lead: 18px;
    --lh-lead: 28px;
    --fs-cell: 12px;
    --lh-cell: 16px;
    --section: var(--s8);
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: var(--s4);
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 112px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
code,
.mono {
  font-family: var(--font-mono);
}
p code,
li code,
dd code {
  font-size: 0.88em;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 5px;
}
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
svg {
  flex-shrink: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 100;
  background: var(--primary);
  color: var(--on-primary);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-md);
  font-size: var(--fs-small);
}
.skip-link:focus {
  top: var(--s3);
}

.wrap {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s5);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font: 500 var(--fs-small) / 1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 120ms ease, background-color 120ms ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  opacity: 0.88;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--sunken);
}
.btn-quiet {
  padding: 0;
  min-height: auto;
  color: var(--text);
}
.btn-quiet:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-sm {
  min-height: 36px;
  padding: 0 var(--s4);
}
.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--sunken);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 1;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark svg {
  width: 22px;
  height: 22px;
}
/* Rules for the glyph's <symbol> must be global: selectors don't reach into <use> */
.cell {
  fill: currentColor;
}
.cell-accent {
  fill: var(--accent);
  stroke: currentColor;
  stroke-width: 1;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s6);
}
.site-nav ul {
  display: flex;
  gap: var(--s5);
  list-style: none;
  padding: 0;
  font-size: var(--fs-small);
}
.site-nav ul a {
  text-decoration: none;
  color: var(--text-muted);
}
.site-nav ul a:hover {
  color: var(--text);
  text-decoration: underline;
}
@media (max-width: 720px) {
  .site-nav ul {
    display: none;
  }
}

/* Sections */

.section {
  padding-block: var(--section);
}
.section + .section {
  border-top: 1px solid var(--border);
}
.band {
  background: var(--sunken);
}
.section h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--text-muted);
  max-width: 34em;
}
.section-head {
  max-width: var(--text-col);
  margin-bottom: var(--s7);
}
.section-head .lead {
  margin-top: var(--s4);
}
.prose {
  max-width: 68ch;
}
.prose > * + * {
  margin-top: var(--s4);
}

/* Split layout: text beside a product panel */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s8);
  align-items: center;
}
.split.flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.split.flip > .split-text {
  order: 2;
}
.split-text h2 {
  margin-bottom: var(--s4);
}
.split-text .lead {
  margin-bottom: var(--s5);
}
@media (max-width: 960px) {
  .split,
  .split.flip {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s7);
  }
  .split.flip > .split-text {
    order: 0;
  }
}

.checks {
  padding-left: 1.25em;
  display: grid;
  gap: var(--s3);
}
.checks li::marker {
  color: var(--text-muted);
}

/* Hero */

.hero {
  padding-block: var(--s9) var(--s9);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s8);
  align-items: center;
}
.hero h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
  margin-bottom: var(--s5);
}
/* Headline written as a diff: "after" struck out in red, "before" highlighted */
.hero {
  --highlight: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .hero {
    --highlight: #6b5a12;
  }
}
.hero del {
  color: var(--delete);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 58% / 100% 0.07em;
}
.hero mark {
  color: inherit;
  padding: 0 2px;
  background: linear-gradient(transparent 58%, var(--highlight) 58%, var(--highlight) 92%, transparent 92%) no-repeat 0 0 / 100% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .hero del {
    animation: strike 450ms 500ms ease-out both;
  }
  .hero mark {
    animation: highlight 450ms 1000ms ease-out both;
  }
}
@keyframes strike {
  from {
    background-size: 0% 0.07em;
  }
}
@keyframes highlight {
  from {
    background-size: 0% 100%;
  }
}
.hero .lead {
  margin-bottom: var(--s6);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4) var(--s5);
}
.hero-note {
  margin-top: var(--s5);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
}
@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s7);
  }
  .hero .lead {
    max-width: 36em;
  }
}
@media (max-width: 720px) {
  .hero {
    padding-block: var(--s8);
  }
}

/* Product panel */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  font-size: var(--fs-cell);
  line-height: var(--lh-cell);
}
.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 44px;
  padding: var(--s2) var(--s4);
  background: var(--sunken);
  border-bottom: 1px solid var(--border);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-weight: 500;
  min-width: 0;
}
.panel-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-title svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.panel-bar .fake-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 var(--s3);
  border-radius: 6px;
  font: 500 12px / 1 var(--font-sans);
  background: var(--primary);
  color: var(--on-primary);
  white-space: nowrap;
}
.panel-bar .fake-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.panel-bar .fake-btn svg {
  width: 14px;
  height: 14px;
}
.panel-bar .bar-actions {
  display: flex;
  gap: var(--s2);
}
.panel-scroll {
  overflow-x: auto;
}
.panel-scroll:focus-visible {
  outline-offset: -2px;
}
.panel-tabs {
  display: flex;
  gap: var(--s1);
  padding: var(--s2) var(--s4) 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 12px;
  overflow: hidden; /* decorative and aria-hidden: clip, don't scroll (a scroller would take a tab stop) */
  white-space: nowrap;
}
.panel-tabs span {
  padding: 6px var(--s2) 8px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}
.panel-tabs span b {
  font-weight: 500;
  font-family: var(--font-mono);
  margin-left: 4px;
}
.panel-tabs .on {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 500;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
}
.grid-table th,
.grid-table td {
  text-align: left;
  padding: 9px var(--s4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
.grid-table th {
  font: 500 11px / 16px var(--font-sans);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
}
.grid-table tr:last-child td {
  border-bottom: 0;
}
.grid-table .muted {
  color: var(--text-muted);
}
.grid-table .sans {
  font-family: var(--font-sans);
}
.cell-old {
  color: var(--delete);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.cell-new {
  background: var(--update-bg);
  color: var(--text);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: -4px;
}
.cell-add {
  background: var(--create-bg);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: -4px;
}
.arrow {
  color: var(--text-muted);
  margin-inline: 6px;
}

.badge {
  display: inline-block;
  font: 500 11px / 16px var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: var(--sunken);
  color: var(--text-muted);
}
.badge.create {
  background: var(--create-bg);
  color: var(--create);
}
.badge.update {
  background: var(--update-bg);
  color: var(--update);
}
.badge.delete {
  background: var(--delete-bg);
  color: var(--delete);
}


/* Record diff (field level) */

.record {
  padding: var(--s4);
  display: grid;
  gap: var(--s3);
}
.record-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
}
.record-head .mono {
  font-weight: 400;
  font-size: var(--fs-cell);
  color: var(--text-muted);
}
.diff {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  font-family: var(--font-mono);
}
.diff > div {
  padding: 8px var(--s3);
  background-color: var(--surface);
  min-width: 0;
  overflow-wrap: break-word;
}
.diff[data-filter="chg"] > [data-row="same"],
.diff[data-filter="same"] > [data-row="chg"] {
  display: none;
}
.diff > .h {
  font: 500 11px / 16px var(--font-sans);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--sunken);
}
.diff > .f {
  color: var(--text-muted);
}
.diff > .chg {
  background: var(--update-bg);
}
.diff > .add {
  background: var(--create-bg);
}
.diff > .del {
  background: var(--delete-bg);
  color: var(--delete);
}
.diff > .last {
  border-bottom: 0;
}
@media (max-width: 480px) {
  .diff {
    grid-template-columns: minmax(84px, 0.7fr) 1fr 1fr;
    font-size: 11px;
  }
  .diff > div {
    padding-inline: var(--s2);
  }
}

/* Steps */

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.steps li {
  padding: var(--s5);
  border-right: 1px solid var(--border);
  display: grid;
  align-content: start;
  gap: var(--s2);
}
.steps li:last-child {
  border-right: 0;
}
.steps .n {
  font: 500 var(--fs-cell) / var(--lh-cell) var(--font-mono);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.steps li.stop .n {
  background: var(--accent);
  border-color: var(--accent);
  color: #17181a;
}
.steps h3 {
  font-size: 18px;
  line-height: 26px;
  margin-top: var(--s2);
}
.steps p {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
}
@media (max-width: 960px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    grid-template-columns: auto 1fr;
    column-gap: var(--s4);
  }
  .steps li:last-child {
    border-bottom: 0;
  }
  .steps h3 {
    margin-top: 0;
  }
  .steps .n {
    grid-row: span 2;
    margin-top: 2px;
  }
}
@media (max-width: 480px) {
  .steps li {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps .n {
    grid-row: auto;
  }
}

/* Commands table */

.commands {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}
.commands th,
.commands td {
  text-align: left;
  vertical-align: top;
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--border);
}
.commands tr:last-child th,
.commands tr:last-child td {
  border-bottom: 0;
}
.commands th {
  width: 160px;
  font: 500 var(--fs-cell) / var(--lh-small) var(--font-mono);
}
.commands th small {
  display: block;
  font: 400 12px / 18px var(--font-sans);
  color: var(--text-muted);
  letter-spacing: 0;
}
.commands td {
  color: var(--text-muted);
}
@media (max-width: 560px) {
  .commands th,
  .commands td {
    display: block;
    width: auto;
    padding: var(--s3) var(--s4) 0;
    border-bottom: 0;
  }
  .commands td {
    padding-bottom: var(--s4);
    border-bottom: 1px solid var(--border);
  }
  .commands tr:last-child td {
    border-bottom: 0;
  }
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s8);
  align-items: start;
}
@media (max-width: 960px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s6);
  }
}

/* FAQ */

.faq {
  border-top: 1px solid var(--border);
}
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  padding: var(--s5) 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 150ms ease;
}
.faq details[open] summary svg {
  transform: rotate(45deg);
}
.faq summary:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.faq .answer {
  padding-bottom: var(--s5);
  color: var(--text-muted);
  max-width: 68ch;
}
.faq .answer > * + * {
  margin-top: var(--s3);
}

/* Final CTA */

.cta {
  text-align: center;
}
.cta h2 {
  margin-inline: auto;
  margin-bottom: var(--s6);
}
.cta .actions {
  justify-content: center;
}

/* Footer */

.site-footer {
  background: var(--sunken);
  border-top: 1px solid var(--border);
  padding-block: var(--s7);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
}
.footer-brand .wordmark {
  color: var(--text);
  margin-bottom: var(--s3);
}
.footer-legal {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s3);
}

.rec small {
  display: block;
  font: 400 12px / 16px var(--font-sans);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Hero demo (working Apply / Undo) */

.demo .v-preview,
.demo .v-applied,
.demo .v-undone {
  display: none;
}
.demo tr[data-s="preview"] .v-preview,
.demo tr[data-s="applied"] .v-applied,
.demo tr[data-s="undone"] .v-undone,
.demo[data-state="preview"] .panel-title .v-preview,
.demo[data-state="applied"] .panel-title .v-applied,
.demo[data-state="undone"] .panel-title .v-undone {
  display: inline;
}
.demo[data-state="preview"]:not([data-busy]) .panel-tabs {
  display: flex;
}
.demo-status {
  margin: 0;
  padding: 10px var(--s4);
  border-bottom: 1px solid var(--border);
  font: 500 12px / 18px var(--font-sans);
  color: var(--text-muted);
}
.demo-status:empty {
  padding: 0;
  border: 0;
}
.demo[data-state="applied"]:not([data-busy]) .demo-status {
  color: var(--create);
}
.demo-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--s3);
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
  font: 500 13px / 1 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}
.demo-btn:hover {
  opacity: 0.88;
}
.demo-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: progress;
}
.demo tr.flash td {
  animation: row-flash 700ms ease-out;
}
@keyframes row-flash {
  from {
    background: var(--update-bg);
  }
  to {
    background: transparent;
  }
}
.demo-hint {
  margin-top: var(--s3);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
  text-align: right;
}

/* Serif italic accent: a few words per heading, never whole headings */

h1 em,
h2 em {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Ink band: the Undo section uses the opposite palette from the page */

.ink {
  --bg: #111214;
  --surface: #18191c;
  --sunken: #1f2024;
  --border: #2c2e33;
  --border-strong: #3a3d43;
  --text: #ecedee;
  --text-muted: #a0a3aa;
  --primary: #ecedee;
  --on-primary: #111214;
  --create-bg: #12301d;
  --create: #5fd383;
  --update-bg: #3a3210;
  --update: #ffe45c;
  --delete-bg: #3a1616;
  --delete: #ff8a80;
  --focus: #8fa9ff;
  --shadow-panel: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 2px 4px rgb(0 0 0 / 0.3), 0 24px 48px -16px rgb(0 0 0 / 0.6);
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  .ink {
    --bg: #fafaf7;
    --surface: #ffffff;
    --sunken: #f2f1ec;
    --border: #e3e1d9;
    --border-strong: #cfccc1;
    --text: #17181a;
    --text-muted: #5c5f66;
    --primary: #17181a;
    --on-primary: #ffffff;
    --create-bg: #e6f4ea;
    --create: #146c31;
    --update-bg: #fff3b0;
    --update: #7a5b00;
    --delete-bg: #fde8e8;
    --delete: #b42318;
    --focus: #2f5bd3;
    --shadow-panel: 0 0 0 1px rgb(0 0 0 / 0.02), 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 12px -4px rgb(0 0 0 / 0.06), 0 20px 40px -12px rgb(0 0 0 / 0.12), 0 48px 80px -32px rgb(0 0 0 / 0.14);
    color-scheme: light;
  }
}
.section.ink + .section,
.section + .section.ink {
  border-top: 0;
}

::selection {
  background: var(--accent);
  color: #17181a;
}

/* ---------------------------------------------------------------
   Texture, depth, motion
   --------------------------------------------------------------- */

/* Texture: a faint paper grain on every solid background */
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.09'/%3E%3C/svg%3E");
}
body,
.band,
.ink,
.site-footer {
  background-image: var(--grain);
  background-size: 180px 180px;
}
.ink {
  box-shadow: inset 0 16px 32px -16px rgb(0 0 0 / 0.45), inset 0 -16px 32px -16px rgb(0 0 0 / 0.45);
}

/* Texture: graph paper behind the hero, fading out from the top left */
.hero {
  position: relative;
  overflow-x: clip;
}
.hero > .wrap {
  position: relative;
  z-index: 1;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --grid: color-mix(in srgb, var(--border) 75%, transparent);
  background:
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 96px 32px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 96px 32px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 35% 35%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 85% at 35% 35%, #000 25%, transparent 78%);
}

/* Delight: a spreadsheet cell selection that follows the pointer, fill handle included */
.hero-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 97px;
  height: 33px;
  border: 2px solid var(--text);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 200ms ease;
}
.hero-cursor::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 7px;
  height: 7px;
  background: var(--text);
  border: 1px solid var(--bg);
}
.hero-cursor.on {
  opacity: 0.55;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-cursor {
    transition: opacity 200ms ease, transform 90ms ease-out;
  }
}

/* Depth: the raw spreadsheet the preview came from, stacked behind it */
.stage {
  position: relative;
}
.sheet {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 72px 36px;
  background-position: 27px 19px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 24px -12px rgb(0 0 0 / 0.12);
  overflow: hidden;
}
.stack {
  --s1x: -18px;
  --s1y: -18px;
  --s1r: -1.5deg;
  --s2x: -34px;
  --s2y: -30px;
  --s2r: -3.5deg;
}
.stack.mirror {
  --s1x: 18px;
  --s1r: 1.5deg;
  --s2x: 34px;
  --s2r: 3.5deg;
}
.sheet-1 {
  transform: translate3d(var(--s1x), var(--s1y), var(--s1z, 0)) rotate(var(--s1r));
}
.sheet-2 {
  transform: translate3d(var(--s2x), var(--s2y), var(--s2z, 0)) rotate(var(--s2r));
  opacity: 0.6;
}
.sheet-cols,
.sheet-rows {
  position: absolute;
  display: flex;
  font: 500 10px / 1 var(--font-mono);
  color: var(--text-muted);
  background: var(--sunken);
}
.sheet-cols {
  top: 0;
  left: 27px;
  right: 0;
  height: 19px;
  border-bottom: 1px solid var(--border);
}
.sheet-cols span {
  flex: 0 0 72px;
  display: grid;
  place-items: center;
}
.sheet-rows {
  top: 19px;
  left: 0;
  bottom: 0;
  width: 27px;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.sheet-rows span {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
}
.stage > .panel {
  position: relative;
}
@media (max-width: 640px) {
  .stack {
    --s1x: -8px;
    --s1y: -12px;
    --s2x: -14px;
    --s2y: -22px;
    --s2r: -3deg;
  }
  .stack.mirror {
    --s1x: 8px;
    --s2x: 14px;
    --s2r: 3deg;
  }
}

/* Depth: every stack tilts toward the pointer (fine pointers, motion allowed; set up in script) */
.stack.tilt {
  perspective: 1400px;
  --s1z: -40px;
  --s2z: -80px;
}
.stack.tilt .stage {
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.stack.tilt .stage > .panel {
  transform: translateZ(0);
}

/* Demo: keyboard shortcut chip */
.demo-status kbd {
  font: 500 11px / 1 var(--font-mono);
  padding: 2px 5px;
  margin-inline: 2px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
}

/* Depth: buttons press in */
.btn,
.demo-btn {
  transition: opacity 120ms ease, background-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
.btn-primary:hover {
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.35);
}
.btn:active,
.demo-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Delight: the logo's yellow cell wanders the grid on hover */
@media (prefers-reduced-motion: no-preference) {
  .wordmark:hover .hop,
  .wordmark:focus-visible .hop {
    animation: hop 1.6s steps(1, end) infinite;
  }
}
@keyframes hop {
  0% { transform: translate(0, 0); }
  12.5% { transform: translate(8px, 0); }
  25% { transform: translate(8px, 8px); }
  37.5% { transform: translate(0, 8px); }
  50% { transform: translate(-8px, 8px); }
  62.5% { transform: translate(-8px, 0); }
  75% { transform: translate(-8px, -8px); }
  87.5% { transform: translate(0, -8px); }
}

/* FAQ: answers slide open where the browser supports it; instant elsewhere */
@media (prefers-reduced-motion: no-preference) {
  :root {
    interpolate-size: allow-keywords;
  }
  .faq details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 260ms ease, content-visibility 260ms allow-discrete;
  }
  .faq details[open]::details-content {
    block-size: auto;
  }
}

/* Motion on scroll (browsers with scroll-driven animations; others show everything as is) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    /* Header gains depth once the page scrolls */
    .site-header {
      animation: header-lift linear both;
      animation-timeline: scroll(root);
      animation-range: 0 120px;
    }

    /* Sections rise in */
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .split.flip .panel.reveal,
    .split .panel.reveal {
      animation-range: entry 10% entry 70%;
    }

    /* Steps: progress fills to the preview and stops there */
    .steps::before {
      animation: fill-x linear both;
      animation-timeline: view();
      animation-range: entry 60% cover 50%;
    }
    .steps li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 80%;
    }

    /* Field diff: changed cells get highlighted like a marker pass */
    .diff > .chg,
    .diff > .add,
    .diff > .del {
      animation: marker linear both;
      animation-timeline: view();
      animation-range: entry 30% entry 100%;
    }

    /* Mapping: Shopify fields fill in row by row */
    #mapping .grid-table td:last-child {
      animation: map-in linear both;
      animation-timeline: view();
      animation-range: entry 20% entry 100%;
    }

    /* Undo: the icon rewinds */
    .rewind {
      animation: rewind linear both;
      animation-timeline: view();
      animation-range: entry 50% cover 50%;
    }
  }
}

/* Steps progress bar (static where it can't animate) */
.steps {
  position: relative;
}
.steps::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 50%;
  height: 3px;
  background: var(--accent);
  transform-origin: left center;
}
@media (max-width: 960px) {
  .steps::before {
    width: 3px;
    height: 50%;
    transform-origin: center top;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}
@keyframes fill-x {
  from {
    transform: scaleX(0);
  }
}
@media (max-width: 960px) {
  @keyframes fill-x {
    from {
      transform: scaleY(0);
    }
  }
}
@keyframes marker {
  from {
    background-size: 0% 100%, auto;
  }
}
.diff > .chg {
  background: linear-gradient(var(--update-bg), var(--update-bg)) no-repeat 0 0 / 100% 100%, var(--surface);
}
.diff > .add {
  background: linear-gradient(var(--create-bg), var(--create-bg)) no-repeat 0 0 / 100% 100%, var(--surface);
}
.diff > .del {
  background: linear-gradient(var(--delete-bg), var(--delete-bg)) no-repeat 0 0 / 100% 100%, var(--surface);
}
@keyframes map-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}
@keyframes rewind {
  from {
    transform: rotate(360deg);
  }
}
@keyframes header-lift {
  to {
    box-shadow: 0 1px 0 var(--border), 0 8px 24px -12px rgb(0 0 0 / 0.18);
  }
}

/* ---------------------------------------------------------------
   The page as a spreadsheet
   --------------------------------------------------------------- */

/* Faint graph paper on the bands too */
.band {
  --band-grid: color-mix(in srgb, var(--border) 45%, transparent);
  background-image:
    var(--grain),
    linear-gradient(to right, var(--band-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--band-grid) 1px, transparent 1px);
  background-size: 180px 180px, 96px 32px, 96px 32px;
}

/* Formula bar under the nav: names the section in view as a formula */
.formula-bar {
  border-top: 1px solid var(--border);
  font: 400 13px / 1 var(--font-mono);
}
.site-header .formula-bar .wrap {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  height: 34px;
}
.namebox {
  display: grid;
  place-items: center;
  width: 56px;
  flex: none;
  border-right: 1px solid var(--border);
  font-weight: 500;
  color: var(--text);
}
.fx {
  display: grid;
  place-items: center;
  width: 40px;
  flex: none;
  border-right: 1px solid var(--border);
  font: italic 500 14px / 1 "IBM Plex Serif", Georgia, serif;
  color: var(--text-muted);
}
.formula {
  display: flex;
  align-items: center;
  padding-left: var(--s3);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}
.f-fn {
  color: var(--text);
  font-weight: 500;
}
.f-str {
  color: var(--create);
}
.f-ref {
  color: var(--text);
}
.caret {
  display: inline-block;
  width: 1px;
  height: 15px;
  margin-left: 2px;
  background: var(--text);
}
@media (prefers-reduced-motion: no-preference) {
  .caret {
    animation: blink 1.1s steps(1) infinite;
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@media (max-width: 960px) {
  .formula-bar {
    display: none;
  }
  html {
    scroll-padding-top: 80px;
  }
}

/* Real buttons inside panels */
.demo-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.demo-btn.ghost:hover {
  background: var(--sunken);
  opacity: 1;
}

/* Filter tabs that work */
.panel-tabs.filter {
  display: flex;
  gap: var(--s1);
  padding: var(--s2) var(--s4) 0;
}
.panel-tabs.filter[hidden] {
  display: none;
}
.panel-tabs.filter button {
  padding: 6px var(--s2) 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font: 400 12px / 1.2 var(--font-sans);
  cursor: pointer;
}
.panel-tabs.filter button b {
  font: 500 12px / 1 var(--font-mono);
  margin-left: 4px;
}
.panel-tabs.filter button:hover {
  color: var(--text);
}
.panel-tabs.filter button[aria-pressed="true"] {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 500;
}

/* Undo panel: rows restore one at a time */
.undo-panel .u-now {
  display: none;
}
.undo-panel.js .u-now {
  display: inline;
}
.undo-panel.js .u-was {
  display: none;
}
.undo-panel.js tr.done .u-now {
  display: none;
}
.undo-panel.js tr.done .u-was {
  display: inline;
}
.undo-panel.js tr:not(.done) .badge {
  opacity: 0.45;
}
.grid-table tr.flash td {
  animation: row-flash 700ms ease-out;
}
.scrub {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  background: var(--sunken);
  font: 500 12px / 1 var(--font-sans);
  color: var(--text-muted);
}
.scrub[hidden] {
  display: none;
}
.scrub label {
  white-space: nowrap;
}
.scrub output {
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
  min-width: 4ch;
}
.scrub input[type="range"] {
  flex: 1;
  min-width: 80px;
  accent-color: var(--text);
  cursor: grab;
}
.scrub input[type="range"]:active {
  cursor: grabbing;
}

/* Mapping: Claude fills the leftover columns */
.unmapped {
  display: inline-block;
  padding: 1px 6px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  font: 400 12px / 18px var(--font-sans);
  color: var(--text-muted);
}
.thinking {
  display: inline-flex;
  gap: 3px;
  padding: 6px 0;
}
.thinking i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
}
@media (prefers-reduced-motion: no-preference) {
  .thinking i {
    animation: think 900ms ease-in-out infinite;
  }
  .thinking i:nth-child(2) {
    animation-delay: 150ms;
  }
  .thinking i:nth-child(3) {
    animation-delay: 300ms;
  }
  .badge.pop {
    animation: pop 320ms cubic-bezier(0.3, 1.6, 0.5, 1);
  }
}
@keyframes think {
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

/* Row commands: try one */
.cmd-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin: 0;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  font: 500 12px / 1.4 var(--font-sans);
  color: var(--text-muted);
}
.cmd-file code {
  font: 400 12px / 1 var(--font-mono);
  padding: 4px 6px;
  border-radius: var(--r-sm);
  background: var(--update-bg);
  color: var(--text);
}
.cmd-tabs {
  display: flex;
  gap: 2px;
  margin: var(--s3) var(--s4) 0;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--sunken);
  overflow-x: auto;
  scrollbar-width: none;
}
.cmd-tabs button {
  flex: 1 0 auto;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: 500 12px / 1 var(--font-mono);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.cmd-tabs button:hover {
  color: var(--text);
}
.cmd-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px var(--border);
}
.cmd-body:focus-visible {
  outline-offset: -2px;
}
.cmd-say {
  margin: 0;
  padding: var(--s3) var(--s4) var(--s2);
  min-height: calc(2 * var(--lh-small) + var(--s3) + var(--s2));
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text);
}
.cmd-body .grid-table td[colspan] {
  white-space: normal;
}

/* Coverage as a sheet: row numbers, hover highlights the row like a spreadsheet */
.sheet-table th[scope="row"] {
  font: 500 var(--fs-cell) / var(--lh-cell) var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.sheet-table .rn {
  width: 36px;
  padding-inline: 0;
  text-align: center;
  background: var(--sunken);
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font: 400 11px / 1 var(--font-mono);
}
.sheet-table .wrap-cell {
  white-space: normal;
  min-width: 240px;
  color: var(--text-muted);
}
.sheet-table tbody tr:hover td,
.sheet-table tbody tr:hover th {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.sheet-table tbody tr:hover .rn {
  background: var(--text);
  color: var(--bg);
}
.sheet-table tr.later th[scope="row"] {
  font-weight: 400;
  color: var(--text-muted);
}

/* FAQ: each question carries a spreadsheet comment marker */
.faq details {
  position: relative;
}
.faq details::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 9px 9px 0;
  border-color: transparent var(--accent) transparent transparent;
  transition: border-color 150ms ease;
}
.faq details[open]::before {
  border-right-color: var(--text);
}

/* Final CTA: a selected cell, fill handle and all */
.cell-select {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: var(--s7) var(--s7) var(--s6);
  border: 2px solid var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.cta .wrap {
  text-align: center;
}
.cell-ref {
  position: absolute;
  top: -2px;
  left: -2px;
  padding: 3px 8px;
  background: var(--text);
  color: var(--bg);
  font: 500 11px / 1 var(--font-mono);
}
.fill-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--text);
  border: 2px solid var(--bg);
  cursor: crosshair;
}
@media (prefers-reduced-motion: no-preference) {
  .cell-select:hover .fill-handle {
    animation: nudge 900ms ease-in-out infinite;
  }
}
@keyframes nudge {
  50% {
    transform: translate(3px, 3px);
  }
}
@media (max-width: 640px) {
  .cell-select {
    padding: var(--s7) var(--s5) var(--s6);
  }
}

/* Footer: sheet tabs */
.footer-brand {
  margin-bottom: var(--s6);
}
.sheet-tabs {
  display: flex;
  align-items: flex-start;
  border-top: 1px solid var(--border-strong);
  overflow-x: auto;
  scrollbar-width: none;
}
.sheet-tabs ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}
.sheet-tabs li {
  flex: none;
}
.sheet-tabs a {
  display: block;
  margin-top: -1px;
  margin-right: -1px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-top-color: transparent;
  border-radius: 0 0 6px 6px;
  background: var(--sunken);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  text-decoration: none;
}
.sheet-tabs li:first-child a {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  border-top-color: var(--surface);
}
.sheet-tabs a:hover {
  background: var(--surface);
  color: var(--text);
}
.sheet-add {
  flex: none;
  padding: 8px 12px;
  color: var(--text-muted);
  font: 400 15px / 18px var(--font-mono);
}

/* Header is solid: the formula bar must stay legible over scrolling content */
.site-header {
  background-color: var(--bg);
  background-image: var(--grain);
  background-size: 180px 180px;
}

/* Sheets peeking past a full-width panel on small screens must not widen the page */
main {
  overflow-x: clip;
}

/* Small screens: command tabs wrap; coverage folds "Includes" under each name */
.sheet-table .m-only {
  display: none;
}
@media (max-width: 640px) {
  .cmd-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .sheet-table .wrap-cell,
  .sheet-table thead th:nth-child(3) {
    display: none;
  }
  .sheet-table th[scope="row"] {
    white-space: normal;
  }
  .sheet-table .m-only {
    display: block;
    margin-top: 2px;
    font: 400 12px / 16px var(--font-sans);
    color: var(--text-muted);
  }
}
