:root {
  color-scheme: light;
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elevated: #252320;
  --surface-dark-soft: #1f1e1b;
  --primary: #cc785c;
  --primary-active: #a9583e;
  --accent-amber: #e8a55a;
  --accent-teal: #5db8a6;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --ink: #141413;
  --body-strong: #252523;
  --body: #3d3d3a;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --error: #c64545;
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-dark);
  color: var(--on-dark);
}

.skip-link:focus {
  top: 16px;
}

.wrap {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

.narrow {
  width: min(860px, calc(100% - 40px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.brand-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: visible;
}

.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a[aria-current="page"] {
  background: var(--surface-card);
  color: var(--ink);
}

.main-nav a:active,
.button:active,
.copy-button:active,
.card-link:active {
  transform: translateY(1px);
}

.hero,
.page-hero,
.tool-hero {
  padding: 96px 0 56px;
}

.hero-grid,
.tool-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 64px;
  align-items: center;
}

.hero h1,
.page-hero h1,
.tool-hero h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
}

.page-hero h1,
.tool-hero h1 {
  font-size: clamp(38px, 5vw, 56px);
}

.eyebrow,
.card-kicker {
  margin: 0 0 12px;
  color: var(--primary-active);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.on-dark {
  color: var(--accent-amber);
}

.lede {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--body);
  font-size: 20px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button,
.card-link,
.copy-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button.primary,
.copy-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.button.primary:hover,
.copy-button:hover {
  border-color: var(--primary-active);
  background: var(--primary-active);
}

.button.secondary {
  background: transparent;
}

.button.secondary:hover,
.card-link:hover {
  border-color: var(--primary);
  color: var(--primary-active);
}

.tool-snapshot {
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-dark);
  color: var(--on-dark);
}

.hero-artifact {
  border: 1px solid color-mix(in srgb, var(--surface-dark) 84%, #ffffff);
}

.snapshot-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(250, 249, 245, 0.1);
}

.snapshot-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.snapshot-bar span:nth-child(2) {
  background: var(--accent-amber);
}

.snapshot-bar span:nth-child(3) {
  background: var(--accent-teal);
}

.snapshot-bar strong {
  margin-left: 8px;
  color: var(--on-dark-soft);
  font: 13px/1 var(--mono);
}

.tool-snapshot pre {
  min-height: 270px;
  margin: 0;
  padding: 28px;
  overflow-x: auto;
  color: #f0e7d8;
  font: 14px/1.8 var(--mono);
  white-space: pre;
}

.line-no {
  color: var(--muted-soft);
}

.snapshot-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface-dark-elevated);
  color: var(--on-dark-soft);
  font-size: 14px;
}

.snapshot-status span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-teal);
}

.section {
  padding: 88px 0;
}

.intro-band {
  border-top: 1px solid var(--hairline-soft);
}

.soft-band {
  background: var(--surface-soft);
}

.dark-band {
  background: var(--surface-dark);
  color: var(--on-dark);
}

.article-band {
  padding-top: 72px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.72fr);
  gap: 56px;
  align-items: end;
  margin-bottom: 34px;
}

.split-section p {
  margin: 0;
  color: var(--body);
  font-size: 18px;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2,
.group-heading h2,
.tool-article h2,
.prose h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
}

.section-heading p,
.group-heading p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 16px;
}

.category-pill {
  min-height: 156px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--ink);
  text-decoration: none;
}

.category-pill:nth-child(1),
.category-pill:nth-child(5) {
  background: var(--surface-dark);
  color: var(--on-dark);
}

.category-pill span {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.12;
}

.category-pill small {
  color: inherit;
  opacity: 0.74;
  font-size: 15px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--canvas);
}

.tool-card:nth-child(4n + 1) {
  background: var(--surface-card);
}

.tool-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.13;
}

.tool-card h2 a {
  text-decoration: none;
}

.tool-card p:not(.card-kicker) {
  margin: 14px 0 0;
  color: var(--muted);
}

.tool-card .card-link {
  align-self: flex-start;
  background: transparent;
}

.tool-group + .tool-group {
  margin-top: 58px;
}

.dark-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: 64px;
  align-items: center;
}

.dark-grid h2 {
  max-width: 720px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.08;
}

.dark-grid p {
  max-width: 640px;
  color: var(--on-dark-soft);
  font-size: 18px;
}

.dark-list {
  display: grid;
  border: 1px solid rgba(250, 249, 245, 0.12);
  border-radius: 12px;
  background: var(--surface-dark-elevated);
}

.dark-list span {
  padding: 18px 22px;
  color: var(--on-dark);
  border-bottom: 1px solid rgba(250, 249, 245, 0.1);
}

.dark-list span:last-child {
  border-bottom: 0;
}

.tool-hero-grid {
  align-items: start;
}

.tool-side-note {
  display: grid;
  gap: 10px;
  padding: 26px;
  border-radius: 12px;
  background: var(--surface-card);
}

.tool-side-note strong {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
}

.tool-side-note span {
  color: var(--body);
}

.tool-side-note a {
  width: max-content;
  margin-top: 8px;
  color: var(--primary-active);
  font-weight: 600;
  text-decoration: none;
}

.tool-workspace-section {
  padding-top: 20px;
}

.tool-workspace {
  padding: 30px;
  border-radius: 16px;
  background: var(--surface-card);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 22px;
}

.tool-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.check-row span {
  color: var(--body-strong);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.16);
}

.field textarea {
  min-height: 138px;
  resize: vertical;
}

.field small {
  color: var(--muted);
  font-size: 13px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--canvas);
}

.result-box {
  display: grid;
  gap: 12px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.result-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
}

.output {
  min-height: 310px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(250, 249, 245, 0.1);
  border-radius: 12px;
  background: var(--surface-dark);
  color: #f0e7d8;
  font: 13px/1.6 var(--mono);
  white-space: pre-wrap;
}

.preview-card {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--canvas);
}

.preview-card strong {
  display: block;
  line-height: 1.25;
}

.preview-card span,
.preview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 0.88fr);
  gap: 56px;
  align-items: start;
}

.content-rail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.content-rail span {
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}

.tool-article {
  max-width: 760px;
}

.tool-article h2 + p,
.tool-article h2 + ol,
.tool-article h2 + ul {
  margin-top: 18px;
}

.tool-article h2:not(:first-child) {
  margin-top: 54px;
}

.tool-article p,
.tool-article li {
  color: var(--body);
  font-size: 18px;
}

.tool-article ol,
.tool-article ul {
  padding-left: 24px;
}

.tool-article li + li {
  margin-top: 10px;
}

.example-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
}

.example-item {
  min-height: 230px;
  padding: 30px;
  border-radius: 12px;
  background: var(--surface-card);
}

.example-item:nth-child(2) {
  background: var(--surface-dark);
  color: var(--on-dark);
}

.example-item h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.12;
}

.example-item p:not(.eyebrow) {
  color: inherit;
  opacity: 0.78;
}

.faq-band {
  background: var(--surface-soft);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border-top: 1px solid var(--hairline);
  padding: 18px 0;
}

.faq-item summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.faq-item p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--body);
}

.prose {
  max-width: 760px;
  padding: 30px;
  border-radius: 12px;
  background: var(--surface-card);
}

.prose p {
  margin: 0;
  color: var(--body);
  font-size: 18px;
}

.site-footer {
  padding: 64px 0;
  background: var(--surface-dark);
  color: var(--on-dark-soft);
}

.site-footer .brand {
  color: var(--on-dark);
}

.site-footer .brand-mark::before,
.site-footer .brand-mark::after {
  background: var(--on-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(160px, 0.45fr));
  gap: 34px;
}

.footer-grid h2 {
  margin: 0 0 14px;
  color: var(--on-dark);
  font-size: 15px;
  font-weight: 600;
}

.footer-grid p {
  max-width: 560px;
  color: var(--on-dark-soft);
}

.footer-grid a:not(.brand) {
  display: block;
  margin-top: 9px;
  color: var(--on-dark-soft);
  text-decoration: none;
}

.footer-grid a:not(.brand):hover {
  color: var(--on-dark);
}

.footer-brand {
  margin-bottom: 12px;
}

@media (max-width: 920px) {
  .header-inner {
    display: grid;
    gap: 12px;
    padding: 14px 0;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .hero-grid,
  .tool-hero-grid,
  .split-section,
  .dark-grid,
  .tool-layout,
  .content-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .tool-grid,
  .tool-grid.compact,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .content-rail {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }

  .content-rail span {
    padding: 8px 12px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
  }
}

@media (max-width: 640px) {
  .wrap,
  .narrow {
    width: min(100% - 24px, 1200px);
  }

  .hero,
  .page-hero,
  .tool-hero,
  .section {
    padding: 56px 0;
  }

  .hero h1,
  .page-hero h1,
  .tool-hero h1 {
    font-size: 38px;
  }

  .lede,
  .split-section p,
  .tool-article p,
  .tool-article li {
    font-size: 16px;
  }

  .field-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .tool-workspace,
  .tool-card,
  .category-pill,
  .example-item {
    padding: 20px;
  }

  .tool-snapshot pre,
  .output {
    font-size: 12px;
  }
}
