:root {
  --color-bg: #faf9f6;
  --color-fg: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-accent: #c14b2c;
  --color-accent-dark: #9c3a20;
  --color-border: #e6e3dc;
  --color-card: #ffffff;
  --color-card-alt: #f3efe7;
  --max-width: 1080px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Make the page a flex column so the footer sticks to the bottom on
   tall viewports even when there's only a hero on screen. */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.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;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow 0.2s ease;
}
/* Faint lift once the page scrolls off the hero (toggled by reveal.js). */
.site-header.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--color-fg);
}
/* Two-tone wordmark: "Table" in the terracotta accent, matching the app header. */
.brand .mark { color: var(--color-accent); }
.brand:hover { text-decoration: none; }
.site-header nav a {
  margin-left: 1.5rem;
  color: var(--color-fg);
}
.site-header nav a.cta {
  background: var(--color-fg);
  color: var(--color-bg);
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  margin-left: 1.5rem;
  transition: background-color 0.15s ease;
}
.site-header nav a.cta:hover {
  background: var(--color-accent);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 4rem; }
.kicker {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  max-width: 22ch;
}
.lede {
  font-size: 1.125rem;
  color: var(--color-muted);
  margin: 0 0 2rem;
  max-width: 58ch;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.button:hover { text-decoration: none; }
.button.primary {
  background: var(--color-accent);
  color: #fff;
}
.button.primary:hover { background: var(--color-accent-dark); }
.button.secondary {
  border-color: var(--color-border);
  color: var(--color-fg);
  background: #fff;
}
.button.secondary:hover { border-color: var(--color-fg); }

/* ---------- Features ---------- */
.features { padding: 3rem 0 4rem; }
.section-lede {
  font-size: 1.05rem;
  color: var(--color-muted);
  margin: 0 0 2rem;
  max-width: 60ch;
}
.features .section-lede { display: none; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.features article {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.feature-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-card-alt);
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}
.features h2 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.features p {
  margin: 0;
  color: var(--color-muted);
}

/* ---------- How ---------- */
.how { padding: 3rem 0 4rem; }
.how h2 {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.how .section-lede { margin-bottom: 1.75rem; }
.flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: none;
}
.flow li {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}
.flow li strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-fg);
}

/* ---------- Demo walk-through ---------- */
.demo {
  padding: 3rem 0 4rem;
  background: var(--color-card-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.demo h2 {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.demo-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.demo-step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--color-fg);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
}
.demo-step h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}
.demo-step p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* ---------- CTA strip ---------- */
.cta-strip {
  padding: 4rem 0;
}
.cta-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .cta-inner {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}
.cta-inner h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}
.cta-inner p {
  margin: 0;
  color: var(--color-muted);
}
.demo-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .demo-form {
    grid-template-columns: 1fr 1fr;
  }
  .demo-form .button {
    grid-column: 1 / -1;
  }
}
.demo-form input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-card);
  color: var(--color-fg);
}
.demo-form input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(193, 75, 44, 0.15);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  background: var(--color-card);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--color-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .hero { padding: 3.5rem 0 3rem; }
  .site-header nav a:not(.cta) { display: none; }
  .site-header nav a.cta { margin-left: 0; }
  .features, .how, .demo, .cta-strip { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .hero h1 { font-size: 1.85rem; }
  .lede { font-size: 1rem; }
  .features article { padding: 1.25rem; }
}

/* ---------- Motion ----------
   Progressive enhancement. The hidden initial states are scoped under
   `.js` (added inline before first paint), so no-JS visitors see every
   element immediately with no flash. The signature status pill below is
   pure CSS and animates with or without JS. All of this is neutralized
   in the prefers-reduced-motion block at the very end. */

/* Card hover lift — works with or without JS. */
.features article,
.demo-step {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.features article:hover,
.demo-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Scroll-reveal: fade + rise on enter (reveal.js toggles .is-visible). */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
/* Cards fade only (no rise), so transform stays free for the hover lift. */
.js .features article[data-reveal],
.js .demo-step[data-reveal] {
  transform: none;
  transition: opacity 0.5s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

/* Light stagger for items that reveal as a group. */
.js .grid > [data-reveal]:nth-child(2),
.js .demo-grid > [data-reveal]:nth-child(2),
.js .flow > [data-reveal]:nth-child(2) { transition-delay: 0.06s; }
.js .grid > [data-reveal]:nth-child(3),
.js .demo-grid > [data-reveal]:nth-child(3),
.js .flow > [data-reveal]:nth-child(3) { transition-delay: 0.12s; }
.js .grid > [data-reveal]:nth-child(4),
.js .demo-grid > [data-reveal]:nth-child(4),
.js .flow > [data-reveal]:nth-child(4) { transition-delay: 0.18s; }
.js .grid > [data-reveal]:nth-child(5) { transition-delay: 0.24s; }
.js .grid > [data-reveal]:nth-child(6) { transition-delay: 0.30s; }

/* Hero entrance — plays once on load under .js. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.js .hero .kicker,
.js .hero h1,
.js .hero .lede,
.js .hero .hero-actions {
  opacity: 0;
  animation: rise-in 0.6s ease forwards;
}
.js .hero h1 { animation-delay: 0.06s; }
.js .hero .lede { animation-delay: 0.12s; }
.js .hero .hero-actions { animation-delay: 0.18s; }

/* ---------- Signature: "on the line" status pill ----------
   A single ticket looping queued -> preparing -> ready. The dot advances
   through the existing accent/neutral ramp (no new hue) and the label
   cross-fades. Pure CSS; runs with or without JS. */
.line-demo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.75rem;
}
.line-demo-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--color-muted);
}
.line-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  box-shadow: var(--shadow-sm);
}
.line-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  animation: line-dot 6s infinite;
}
.line-states {
  position: relative;
  display: inline-block;
  min-width: 9ch;
  height: 1.25em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-fg);
}
.line-state {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  white-space: nowrap;
}
.line-state:nth-child(1) { animation: line-state-1 6s infinite; }
.line-state:nth-child(2) { animation: line-state-2 6s infinite; }
.line-state:nth-child(3) { animation: line-state-3 6s infinite; }

@keyframes line-dot {
  0%, 28%  { background: var(--color-border); box-shadow: none; }
  33%, 61% { background: var(--color-accent); box-shadow: 0 0 0 4px rgba(193, 75, 44, 0.12); }
  66%, 95% { background: var(--color-accent-dark); box-shadow: none; }
  100%     { background: var(--color-border); box-shadow: none; }
}
@keyframes line-state-1 { /* queued */
  0%, 28%  { opacity: 1; }
  33%, 95% { opacity: 0; }
  100%     { opacity: 1; }
}
@keyframes line-state-2 { /* preparing */
  0%, 28%  { opacity: 0; }
  33%, 61% { opacity: 1; }
  66%, 100% { opacity: 0; }
}
@keyframes line-state-3 { /* ready */
  0%, 61%  { opacity: 0; }
  66%, 95% { opacity: 1; }
  100%     { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .site-header,
  .site-header nav a.cta,
  .features article,
  .demo-step { transition: none; }

  /* Reveal everything up front; no entrance or hover motion. */
  .js [data-reveal],
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
  .features article:hover,
  .demo-step:hover { transform: none; }
  .js .hero .kicker,
  .js .hero h1,
  .js .hero .lede,
  .js .hero .hero-actions { opacity: 1; animation: none; }

  /* Freeze the status pill on a valid resting state: "ready". */
  .line-dot { animation: none; background: var(--color-accent-dark); box-shadow: none; }
  .line-state { animation: none; }
  .line-state:nth-child(3) { opacity: 1; }
}
