:root {
  color-scheme: light dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --text: #263238;
  --bg: #f7f8f5;
  --surface: #fff;
  --border: #e4e9e4;
  --accent: #356859;
  --muted: #5f6b65;
  --code-bg: #edf1ec;
  --note-bg: #eef5f1;
  --warn-bg: #fdf6e7;
  --warn-border: #e2c27a;
  color: var(--text);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e3e8e4;
    --bg: #141a17;
    --surface: #1c2420;
    --border: #2d3832;
    --accent: #7cc4a9;
    --muted: #a3b0a8;
    --code-bg: #252f2a;
    --note-bg: #1f2e27;
    --warn-bg: #2e2818;
    --warn-border: #7a6430;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  padding: 1.25rem max(1.5rem, calc((100vw - 1080px) / 2));
  background: var(--surface);
  border-color: var(--border);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 750;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.disclosure {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

main {
  width: min(1080px, calc(100% - 3rem));
  margin: 0 auto;
}

.intro {
  max-width: 700px;
  padding: 4.5rem 0 3.5rem;
}

.eyebrow,
.product-category {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 6vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.intro > p:last-child,
.section-heading > p,
.product-description,
.card-grid p {
  color: var(--muted);
  line-height: 1.65;
}

.intro > p:last-child {
  max-width: 600px;
  font-size: 1.1rem;
}

section {
  padding-bottom: 3.5rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin-bottom: 0.4rem;
  font-size: 1.6rem;
}

.product-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.product-card,
.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(38 50 56 / 5%);
}

.card {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
}

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

.card h3 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.card p:last-child {
  margin-bottom: 0;
}

.product-image {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: var(--code-bg);
}

.product-copy {
  padding: 1.25rem;
}

.product-category {
  margin-bottom: 0.6rem;
}

.product-name {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.product-projects {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: 1rem;
  color: var(--muted);
  text-align: center;
}

/* Articles */

.article {
  max-width: 760px;
  padding: 3.5rem 0 1rem;
  line-height: 1.7;
}

.article h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.article .lede {
  color: var(--muted);
  font-size: 1.15rem;
}

.article h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.5rem;
}

.article h3 {
  margin: 1.75rem 0 0.5rem;
}

.article a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.article li {
  margin-bottom: 0.35rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

code,
pre {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  border-radius: 0.35rem;
}

code {
  padding: 0.1em 0.35em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  line-height: 1.45;
}

pre code {
  padding: 0;
  background: none;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--code-bg);
}

.note,
.warn {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--note-bg);
}

.warn {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}

.note p:last-child,
.warn p:last-child {
  margin-bottom: 0;
}

.article .product-grid {
  margin: 1.25rem 0 1.5rem;
}

/* Footer */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  main {
    width: calc(100% - 2rem);
  }

  .site-header,
  .site-footer {
    padding-inline: 1rem;
  }

  .intro {
    padding: 3rem 0 2.5rem;
  }

  .article {
    padding-top: 2.5rem;
  }
}
