/* HTMLToddler — calm, readable, responsive design system */
:root {
  color-scheme: light;
  --ink: #20312f;
  --ink-soft: #354946;
  --muted: #657874;
  --line: #dce7e2;
  --line-strong: #c8d8d0;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --surface-tint: #edf5f0;
  --page: #fbfcfa;
  --brand: #26745e;
  --brand-dark: #1b5b49;
  --brand-pale: #e4f2eb;
  --accent: #d9a65a;
  --code-bg: #172521;
  --code-ink: #e5f1eb;
  --shadow-sm: 0 4px 14px rgba(28, 57, 46, .055);
  --shadow-md: 0 12px 32px rgba(28, 57, 46, .09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --content-width: 1160px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--ink); background: #d9eee3; }
.container { width: min(var(--content-width), calc(100% - 2.5rem)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}
.skip-link {
  position: fixed; z-index: 100; left: 1rem; top: -5rem;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 1rem; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 252, 250, .94);
  border-bottom: 1px solid rgba(220, 231, 226, .9);
  backdrop-filter: blur(16px);
}
.header-inner {
  min-height: 78px; display: flex; align-items: center;
  justify-content: space-between; gap: 1.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .1rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  font-size: 1.42rem; font-weight: 850; letter-spacing: -.055em;
}
.brand::before {
  content: "</>"; display: inline-grid; place-items: center;
  width: 38px; height: 38px; margin-right: .45rem;
  border-radius: 12px; color: white; background: var(--brand);
  font-size: .85rem; font-weight: 850; letter-spacing: -.06em;
}
.brand span { color: var(--brand); }
.site-nav {
  display: flex; align-items: center; justify-content: flex-end;
  gap: .25rem; flex-wrap: wrap;
}
.site-nav a {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: .48rem .7rem; border-radius: 9px;
  color: var(--ink-soft); text-decoration: none;
  font-size: .91rem; font-weight: 650; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--brand-dark); background: var(--brand-pale);
}
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: 1.25rem;
}

/* Hero and page introductions */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(2.8rem, 6vw, 5.2rem) 0 clamp(2.6rem, 5vw, 4.3rem);
  background:
    radial-gradient(ellipse at 85% 12%, rgba(217, 166, 90, .17), transparent 28%),
    radial-gradient(ellipse at 8% 85%, rgba(92, 159, 128, .12), transparent 35%),
    linear-gradient(135deg, #f0f6f1 0%, #fbfcfa 60%, #f5f7ef 100%);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(1.6rem, 4vw, 3.5rem); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .72rem; border: 1px solid #d1e5d8;
  border-radius: 999px; background: rgba(255,255,255,.72);
  color: var(--brand-dark); font-size: .76rem; font-weight: 800;
  letter-spacing: .055em; text-transform: uppercase;
}
.hero h1, .page-hero h1 {
  max-width: 820px; margin: .9rem 0 1rem;
  color: var(--ink); font-size: clamp(2.35rem, 5.4vw, 4.35rem);
  line-height: 1.1; letter-spacing: -.055em; font-weight: 800;
}
.hero p, .page-hero p {
  max-width: 740px; color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.8;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 46px; padding: .72rem 1.05rem;
  border: 1px solid var(--brand); border-radius: 11px;
  background: var(--brand); color: white; text-decoration: none;
  font-weight: 750; box-shadow: 0 4px 10px rgba(38, 116, 94, .13);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.button:hover { background: var(--brand-dark); color: white; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button.secondary { color: var(--ink-soft); background: rgba(255,255,255,.82); border-color: var(--line-strong); box-shadow: none; }
.button.secondary:hover { color: var(--brand-dark); background: white; border-color: var(--brand); }
.hero-code {
  min-width: 0; padding: 1.35rem; border: 1px solid #334c41;
  border-radius: var(--radius-lg); background: var(--code-bg); color: var(--code-ink);
  box-shadow: 0 20px 42px rgba(26, 55, 43, .16); overflow: auto;
}
.hero-code .dots { display: flex; gap: .4rem; margin-bottom: 1.1rem; }
.hero-code .dots i { width: 9px; height: 9px; border-radius: 50%; background: #668276; }
.hero-code pre { margin: 0; color: var(--code-ink); font: .91rem/1.85 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.hero-code .green { color: #a6e2bd; }
.page-hero {
  padding: clamp(2rem, 4.5vw, 3.35rem) 0 clamp(1.4rem, 2.7vw, 2rem);
  background: linear-gradient(135deg, #f0f6f1, #f9fbf8 72%);
  border-bottom: 1px solid #edf2ee;
}
.page-hero h1 { font-size: clamp(2.05rem, 4.5vw, 3.35rem); margin: .7rem 0 .65rem; }
.page-hero p { margin: 0; }

/* Sections, headings and general content */
.section { padding: clamp(2rem, 4.5vw, 3.5rem) 0; }
.section.soft { background: var(--surface-soft); border-block: 1px solid #edf2ee; }
.section-heading {
  display: flex; align-items: end; justify-content: space-between;
  gap: 1.25rem; margin-bottom: 1.25rem;
}
.section-heading h2 {
  margin: 0; color: var(--ink); font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  line-height: 1.25; letter-spacing: -.04em;
}
.section-heading p { max-width: 680px; margin: .45rem 0 0; color: var(--muted); }
.category-grid, .snippet-grid, .feature-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.category-card, .feature-card, .content-card, .contact-card {
  min-width: 0; padding: 1.35rem;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.category-card { display: flex; flex-direction: column; min-height: 220px; }
.category-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid #d8e9df; border-radius: 14px;
  background: var(--brand-pale); color: var(--brand-dark);
  font-size: 1.08rem; font-weight: 850;
}
.category-card h3, .feature-card h3, .snippet-card h3 {
  margin: .85rem 0 .35rem; color: var(--ink); font-size: 1.08rem; line-height: 1.35;
}
.category-card p, .feature-card p, .snippet-card p { margin: .3rem 0 .8rem; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; font-weight: 800; text-decoration: none; }
.pill {
  display: inline-flex; align-items: center; width: fit-content;
  padding: .22rem .58rem; border: 1px solid #dce9e0;
  border-radius: 999px; background: var(--surface-tint);
  color: var(--brand-dark); font-size: .75rem; font-weight: 800;
}
.content-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 270px;
  gap: clamp(1.5rem, 3vw, 2.25rem); align-items: start;
}
.prose { min-width: 0; }
.content-section { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.content-section:last-child { border-bottom: 0; }
.content-section h2 { margin: 0 0 .55rem; font-size: 1.42rem; line-height: 1.35; letter-spacing: -.025em; }
.content-section h3 { margin: 1.1rem 0 .35rem; font-size: 1.08rem; }
.content-section p, .content-section li { color: var(--ink-soft); }
.content-section p { margin: .45rem 0; }
.content-section ul, .content-section ol { padding-left: 1.35rem; }
.content-card { margin: .8rem 0; }
.sidebar {
  position: sticky; top: 100px; padding: 1.2rem;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.sidebar h2 { margin: 0 0 .55rem; font-size: 1rem; }
.sidebar a { display: block; padding: .35rem 0; text-decoration: none; }
.notice { padding: 1rem 1.1rem; border: 1px solid #d6e9dc; border-left: 4px solid var(--brand); border-radius: 10px; background: #f0f7f2; color: #31584a; }
.muted { color: var(--muted); }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: .75rem .85rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--surface-tint); color: var(--ink); font-weight: 750; }
tr:last-child td { border-bottom: 0; }

/* Snippet discovery and interactive examples */
.snippet-tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; }
.search-input, .filter-select, .field input, .field select, .field textarea {
  width: 100%; padding: .72rem .85rem; border: 1px solid var(--line-strong);
  border-radius: 10px; background: white; color: var(--ink); font: inherit;
}
.search-input { max-width: 440px; }
.filter-select { max-width: 220px; }
.snippet-card {
  min-width: 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.snippet-card:hover { box-shadow: var(--shadow-md); }
.snippet-card-top { padding: 1.05rem 1.15rem .65rem; }
.snippet-card-top h2, .snippet-card-top h3 { margin: .45rem 0 .35rem; line-height: 1.35; }
.snippet-card-top p { margin: .3rem 0 .5rem; }
.snippet-card pre {
  max-width: 100%; max-height: 260px; overflow: auto; margin: 0;
  padding: 1rem 1.1rem; border: 0; border-radius: 0;
  background: var(--code-bg); color: var(--code-ink);
  font: .84rem/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre; tab-size: 2;
}
.snippet-card-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding: .85rem 1.1rem; }
.small-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: .48rem .7rem; border: 1px solid var(--line-strong);
  border-radius: 9px; background: white; color: var(--ink-soft);
  font-size: .84rem; font-weight: 750; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.small-button:hover { background: var(--surface-tint); border-color: #b8d1c3; color: var(--brand-dark); }
.small-button.primary { background: var(--brand); border-color: var(--brand); color: white; }
.small-button.primary:hover { background: var(--brand-dark); }
.preview-frame { display: block; width: calc(100% - 2rem); height: 230px; margin: 0 1rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.snippet-card .preview-frame { display: none; }
.snippet-card.show-preview .preview-frame { display: block; }
.snippet-card.show-preview pre { display: none; }
.empty-state { grid-column: 1 / -1; padding: 2rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-soft); color: var(--muted); text-align: center; }
.editor-panel { margin: 0 1rem 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.editor-panel > summary { padding: .8rem .95rem; color: var(--brand-dark); font-weight: 800; cursor: pointer; }
.editor-inner { display: grid; gap: .55rem; padding: 0 .95rem .95rem; }
.editor-inner label { color: var(--ink-soft); font-size: .9rem; font-weight: 800; }
.code-editor {
  display: block; width: 100%; min-height: 130px; resize: vertical;
  padding: .85rem; border: 1px solid #2c443b; border-radius: 9px;
  background: var(--code-bg); color: var(--code-ink);
  font: .82rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
}
.css-editor { min-height: 105px; }
.editor-help { margin: .1rem 0; color: var(--muted); font-size: .86rem; }
.editor-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.learning-practice { margin: .75rem 0; padding: .7rem .8rem; border-left: 3px solid var(--brand); border-radius: 7px; background: var(--surface-tint); }
.learning-practice p { margin: .4rem 0; color: var(--ink-soft); }

/* FAQ panel: centered, calm, and easy to scan */
.faq-section {
  width: min(900px, calc(100% - 2.5rem));
  margin: clamp(1.5rem, 3.5vw, 2.5rem) auto;
  padding: clamp(1.1rem, 2.5vw, 1.8rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.faq-section h2 {
  margin: 0 0 1.1rem; color: var(--ink); text-align: center;
  font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.25; letter-spacing: -.035em;
}
.faq-section details { margin: 0 0 .55rem; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fcfdfb; }
.faq-section details:last-child { margin-bottom: 0; }
.faq-section summary {
  position: relative; padding: .82rem 2.7rem .82rem 1rem;
  color: var(--ink-soft); font-weight: 750; line-height: 1.5;
  text-align: left; cursor: pointer; list-style: none;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: "+"; position: absolute; right: 1rem; top: 50%;
  transform: translateY(-50%); color: var(--brand);
  font-size: 1.25rem; font-weight: 650; line-height: 1;
}
.faq-section details[open] summary::after { content: "−"; }
.faq-section details[open] summary { color: var(--brand-dark); }
.faq-section details p { margin: 0; padding: 0 1rem 1rem; color: var(--muted); text-align: left; line-height: 1.7; }

/* Contact form */
.contact-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1.2rem; align-items: start; }
.contact-form { display: grid; gap: 1rem; }
.field { display: grid; gap: .38rem; }
.field label, .verify-label { color: var(--ink-soft); font-weight: 750; }
.field textarea { min-height: 150px; resize: vertical; }
.verify-box { display: flex; align-items: flex-start; gap: .7rem; padding: .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.verify-box input { width: 18px; height: 18px; margin-top: .3rem; accent-color: var(--brand); }
.form-note { color: var(--muted); font-size: .9rem; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden; }

/* Footer: polished, structured, and aligned with the site palette */
.site-footer { margin-top: 0; background: #20352e; color: #e8f1eb; }
.site-footer a { color: #e1eee5; text-decoration-color: rgba(225,238,229,.45); }
.site-footer a:hover { color: white; text-decoration-color: currentColor; }
.site-footer h2 { margin: .1rem 0 .65rem; color: white; font-size: .98rem; letter-spacing: .01em; }
.site-footer p { color: #c0d2c7; }
.footer-inner {
  display: grid; grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(0, 1fr));
  align-items: start; gap: clamp(1rem, 2.5vw, 2rem);
  width: min(var(--content-width), calc(100% - 2.5rem));
  margin: 0 auto; padding: clamp(1.8rem, 4vw, 2.8rem) 0;
}
.footer-brand { min-width: 0; }
.footer-logo { display: inline-block; margin-bottom: .35rem; color: white !important; font-size: 1.3rem; font-weight: 850; letter-spacing: -.045em; text-decoration: none; }
.footer-brand p { max-width: 320px; margin: .5rem 0; font-size: .93rem; }
.footer-column { min-width: 0; }
.footer-column ul { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.footer-column li { margin: 0; }
.footer-column a { display: inline-block; padding: .08rem 0; font-size: .92rem; line-height: 1.55; overflow-wrap: anywhere; text-decoration: none; }
.footer-column a:hover { text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; width: min(var(--content-width), calc(100% - 2.5rem)); margin: 0 auto; padding: .9rem 0; border-top: 1px solid rgba(220, 238, 226, .18); font-size: .85rem; }
.site-footer .footer-bottom p { margin: .1rem 0; color: #c0d2c7; }

/* Tables and controls: clear focus and motion */
:focus-visible { outline: 3px solid #d9a65a; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(38,116,94,.12); outline: none; }
@media (hover: hover) {
  .category-card, .feature-card, .content-card, .contact-card { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
  .category-card:hover, .feature-card:hover { transform: translateY(-2px); border-color: #c7dcd0; box-shadow: var(--shadow-md); }
}
@media (max-width: 1000px) {
  .header-inner { gap: .8rem; }
  .site-nav { gap: .05rem; }
  .site-nav a { padding-inline: .5rem; font-size: .86rem; }
  .hero-grid { gap: 1.8rem; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 235px; gap: 1.4rem; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 2rem); }
  .header-inner { min-height: 70px; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 69px; left: 0; right: 0;
    padding: .8rem 1rem 1rem; border-bottom: 1px solid var(--line);
    background: var(--page); box-shadow: var(--shadow-md);
    align-items: stretch; flex-direction: column; gap: .15rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .7rem .8rem; font-size: .95rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-code { max-width: 680px; }
  .category-grid, .snippet-grid, .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .6rem; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; line-height: 1.68; }
  .container { width: calc(100% - 1.5rem); }
  .brand { font-size: 1.3rem; }
  .brand::before { width: 34px; height: 34px; border-radius: 10px; font-size: .78rem; }
  .hero { padding: 2.2rem 0 2rem; }
  .hero h1 { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .hero p, .page-hero p { font-size: 1rem; }
  .hero-code { padding: 1rem; border-radius: 16px; }
  .hero-code pre { font-size: .8rem; }
  .page-hero { padding: 1.8rem 0 1.3rem; }
  .page-hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .section { padding: 1.8rem 0; }
  .category-grid, .snippet-grid, .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .category-card, .feature-card, .content-card, .contact-card { padding: 1.1rem; }
  .category-card { min-height: auto; }
  .snippet-tools { align-items: stretch; }
  .snippet-tools > *, .search-input, .filter-select { width: 100%; max-width: none; }
  .snippet-card-top { padding: .95rem .95rem .55rem; }
  .snippet-card pre { padding: .85rem; font-size: .78rem; }
  .snippet-card-actions { padding: .75rem .9rem; }
  .editor-panel { margin-inline: .75rem; }
  .code-editor { min-height: 115px; font-size: .77rem; }
  .preview-frame { width: calc(100% - 1.5rem); margin-inline: .75rem; }
  .faq-section { width: calc(100% - 1.5rem); margin: 1.2rem auto; padding: .9rem; border-radius: 14px; }
  .faq-section h2 { margin-bottom: .8rem; }
  .faq-section summary { padding: .78rem 2.45rem .78rem .85rem; }
  .faq-section details p { padding: 0 .85rem .85rem; }
  .footer-inner { width: calc(100% - 1.75rem); grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding: 1.5rem 0; }
  .footer-brand { grid-column: auto; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom { width: calc(100% - 1.75rem); flex-direction: column; gap: .25rem; padding: .8rem 0; }
  .hero-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
