/* TabCraft home page. Same palette and type as the app (css/styles.css). */
:root {
  color-scheme: light dark;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --text: #211f1a;
  --text-muted: #6b6a61;
  --border: #dedad0;
  --border-strong: #c7c1b3;
  --accent: #2f6e46;
  --accent-hover: #255939;
  --accent-soft: rgba(47, 110, 70, 0.1);
  --accent-contrast: #ffffff;
  --radius-sm: 6px;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30, 28, 20, 0.08), 0 1px 2px rgba(30, 28, 20, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a17;
    --surface: #232420;
    --text: #ece9e0;
    --text-muted: #a3a294;
    --border: #3a3830;
    --border-strong: #4c493d;
    --accent: #6fbf6f;
    --accent-hover: #82cc82;
    --accent-soft: rgba(111, 191, 111, 0.15);
    --accent-contrast: #12200e;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 1040px;
  padding: 0 24px;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: block;
  color: var(--text);
  line-height: 0;
}

.logo {
  display: block;
  height: 32px;
  /* explicit width: with width:auto a narrow layout can shrink an inline SVG to nothing */
  width: 122px;
  max-width: 100%;
}

.logo-accent {
  fill: var(--accent);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}

.site-header nav a:not(.button) {
  color: var(--text-muted);
  text-decoration: none;
}

.site-header nav a:not(.button):hover {
  color: var(--text);
}

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: background-color 0.15s ease;
}

.button:hover {
  background: var(--accent-hover);
}

.button-small {
  padding: 7px 14px;
  font-size: 14px;
}

.button-quiet {
  background: transparent;
  color: var(--accent);
}

.button-quiet:hover {
  background: var(--accent-soft);
}

.hero {
  padding: 72px 0 40px;
  max-width: 760px;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0 0 28px;
  font-size: 19px;
  color: var(--text-muted);
  max-width: 640px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fine {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.demo {
  margin: 8px 0 72px;
}

.demo video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #000;
}

.caption {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

h2 {
  margin: 0 0 24px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.features {
  margin-bottom: 72px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-grid article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.feature-grid h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.feature-grid p {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.examples {
  margin-bottom: 72px;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.example {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.example:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.example-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.example-meta {
  font-size: 14px;
  color: var(--text-muted);
}

.site-footer {
  padding: 28px 0 48px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0 0 8px;
}

.credits {
  font-size: 13px;
}

@media (max-width: 600px) {
  body {
    padding: 0 16px;
  }
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .site-header nav {
    gap: 14px;
  }
  .hero {
    padding: 44px 0 28px;
  }
  .lede {
    font-size: 17px;
  }
}

/* Content pages: /examples/ and /help/ */
.site-header nav a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
}

.page {
  padding: 48px 0 64px;
}

.page-intro {
  max-width: 720px;
  margin-bottom: 36px;
}

.page-intro h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-intro .lede {
  margin: 0;
}

.piece-list {
  display: grid;
  gap: 18px;
}

.piece {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.piece h2 {
  margin: 0;
  font-size: 24px;
}

.piece-by {
  margin: 2px 0 12px;
  color: var(--text-muted);
}

.piece-text {
  max-width: 640px;
}

.piece-text p {
  margin: 0 0 12px;
}

.piece-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.piece-facts li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 13px;
}

.piece-credit {
  font-size: 13px;
  color: var(--text-muted);
}

.piece .button {
  flex-shrink: 0;
  white-space: nowrap;
}

.page-note {
  margin: 28px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.toc a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.toc a:hover {
  border-color: var(--accent);
}

.help-section {
  max-width: 760px;
  margin-bottom: 48px;
  scroll-margin-top: 16px;
}

.help-section h2 {
  margin-bottom: 14px;
}

.help-section h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.help-section ul {
  padding-left: 20px;
}

.help-section li {
  margin-bottom: 8px;
}

kbd,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
}

.syntax {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.syntax th,
.syntax td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.syntax th {
  font-size: 13px;
  color: var(--text-muted);
}

.piece h2 a {
  color: inherit;
  text-decoration: none;
}

.piece h2 a:hover {
  color: var(--accent);
}

/* One example's page */
.breadcrumb {
  margin: 0 0 12px;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.example-detail {
  display: grid;
  gap: 28px;
  margin-bottom: 56px;
}

.tab-preview {
  margin: 0;
}

.tab-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.tab-preview figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.example-detail .piece-text {
  max-width: 720px;
}

.more-examples {
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .piece {
    flex-direction: column;
  }
}

/* /feedback/ */
.feedback-form {
  display: grid;
  gap: 8px;
  max-width: 640px;
}

.feedback-form label {
  font-weight: 600;
  margin-top: 8px;
}

.feedback-form .optional {
  font-weight: 400;
  color: var(--text-muted);
}

.feedback-form textarea,
.feedback-form input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.feedback-form .button {
  justify-self: start;
  margin-top: 12px;
  cursor: pointer;
}

.feedback-trap {
  position: absolute;
  left: -10000px;
}

.feedback-status {
  min-height: 1.5em;
  margin: 4px 0 0;
}

.feedback-status.error {
  color: #ab3428;
}
