:root {
  color-scheme: light;
  --paper: #f4f6f1;
  --ink: #14231f;
  --muted: #5d6864;
  --line: #d4ddd7;
  --panel: #ffffff;
  --panel-soft: #edf4ef;
  --green: #1f6b4f;
  --green-dark: #124532;
  --blue: #285f8f;
  --gold: #b68222;
  --rose: #ad4058;
  --charcoal: #10231d;
  --shadow: 0 18px 44px rgba(23, 33, 29, 0.09);
  --container: min(1180px, calc(100% - 32px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  background:
    linear-gradient(90deg, rgba(31, 107, 79, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(31, 107, 79, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #fbfcf8 0%, var(--paper) 46%, #eaf0ec 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--green-dark);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 6px;
  color: white;
  background: var(--green-dark);
  transition: top 0.15s ease;
}

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

button,
input {
  font: inherit;
}

.site-header,
.site-footer,
main,
.breadcrumbs {
  width: var(--container);
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  background: rgba(246, 247, 243, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216, 222, 215, 0.8);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand::before {
  content: "=";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 6px;
  color: white;
  background: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.site-header nav a {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 6px;
}

.site-header nav a:hover {
  background: var(--panel-soft);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 0 60px;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1fr);
  min-height: 560px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 244, 239, 0.9)),
    repeating-linear-gradient(0deg, transparent, transparent 34px, rgba(31, 107, 79, 0.08) 35px),
    repeating-linear-gradient(90deg, transparent, transparent 94px, rgba(40, 95, 143, 0.08) 95px);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  max-width: 740px;
  font-size: clamp(2.4rem, 4.7vw, 4.7rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
}

h3 {
  margin-bottom: 12px;
  font-size: 1.22rem;
}

.hero-copy p:not(.eyebrow),
.page-head p,
.prose p {
  max-width: 74ch;
  color: var(--muted);
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-metrics span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.hero-metrics strong {
  margin-right: 5px;
  color: var(--green-dark);
}

.formula-workbench {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    var(--charcoal);
  color: white;
}

.workbench-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.workbench-tabs button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.workbench-tabs button.active {
  color: var(--charcoal);
  background: #dbeee4;
}

.builder-form {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.builder-form.active {
  display: grid;
}

.builder-form label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

input[type="search"],
.builder-form input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

.builder-output {
  min-height: 108px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: #e8fff4;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.workbench-actions a {
  color: #dbeee4;
  font-weight: 800;
}

.finder-results,
.search-results {
  display: grid;
  gap: 10px;
}

.result-card,
.card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.formula-finder .result-card {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  color: white;
}

.result-card span,
.card span {
  display: block;
  margin-bottom: 5px;
  font-weight: 800;
}

.result-card p,
.card p {
  margin: 0;
  color: var(--muted);
}

.formula-finder .result-card p {
  color: rgba(255, 255, 255, 0.78);
}

.tool-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  background: var(--panel);
}

.tool-strip a {
  min-height: 132px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.tool-strip a:last-child {
  border-right: 0;
}

.tool-strip span,
.tool-strip small {
  display: block;
}

.tool-strip span {
  margin-bottom: 8px;
  font-weight: 800;
}

.tool-strip small {
  color: var(--muted);
}

.page-head,
.content-section,
.formula-lab,
.search-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(23, 33, 29, 0.05);
}

.proof-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: center;
}

.proof-section p {
  margin: 0;
  color: var(--muted);
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.proof-grid span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  font-weight: 800;
}

.trust-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(26, 95, 69, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.92);
}

.trust-section p {
  color: var(--muted);
}

.trust-grid {
  display: grid;
  gap: 12px;
}

.trust-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.trust-grid strong,
.trust-grid span {
  display: block;
}

.trust-grid strong {
  margin-bottom: 8px;
  font-size: 1rem;
}

.trust-grid span {
  color: var(--muted);
}

.cluster-section {
  display: grid;
  gap: 24px;
}

.cluster-section > div:first-child p:not(.eyebrow) {
  max-width: 76ch;
  color: var(--muted);
}

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

.cluster-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.cluster-grid .card-grid {
  grid-template-columns: 1fr;
}

.page-head,
.content-section,
.search-panel {
  padding: 30px;
}

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

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

.formula-lab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.formula-lab > div {
  padding: 28px;
  background: var(--panel);
}

.article-nav {
  position: sticky;
  top: 72px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(23, 33, 29, 0.06);
  backdrop-filter: blur(12px);
}

.article-nav a {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.formula-box,
.syntax-box,
.prompt {
  overflow-x: auto;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid #ccd7d0;
  border-left: 5px solid var(--green);
  border-radius: 6px;
  background: #f7fbf8;
  color: #10261f;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.syntax-box {
  border-left-color: var(--blue);
}

.copy-button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--green);
  cursor: pointer;
}

.copy-button:hover {
  background: var(--green-dark);
}

.compatibility {
  display: inline-block;
  margin: 0;
  padding: 6px 9px;
  border-radius: 6px;
  background: #e7f0ed;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  background: white;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #eef3ef;
}

.prose ul {
  margin-top: 0;
  padding-left: 22px;
}

.prose li {
  margin: 7px 0;
}

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed #aeb9b3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

.ad-slot span {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.freshness-note {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid #cbd8d1;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fffaf0;
  color: #5f4b1c;
}

.search-panel {
  display: grid;
  gap: 18px;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
}

.site-footer {
  padding: 24px 0 44px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    justify-content: flex-start;
  }

  .workspace-hero,
  .formula-lab,
  .proof-section,
  .trust-section {
    grid-template-columns: 1fr;
  }

  .article-nav {
    position: static;
  }

  .hero-copy,
  .formula-finder,
  .page-head,
  .content-section,
  .search-panel,
  .formula-lab > div {
    padding: 22px;
  }

  .tool-strip,
  .card-grid,
  .compact-grid,
  .builder-form,
  .proof-grid,
  .trust-grid,
  .cluster-grid {
    grid-template-columns: 1fr;
  }

  .tool-strip a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  h1 {
    font-size: 2.35rem;
  }
}
