:root {
  color-scheme: light;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #0f172a;
  --muted: #475569;
  --line: #dbe4f0;
  --surface: #ffffff;
  --soft: #eff6ff;
  --warning: #fff7ed;
}
* { box-sizing: border-box; }

body.static-page {
  margin: 0;
  background: #f8fafc;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: var(--blue-dark); }

.site-header,
.site-footer {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  margin-top: 4rem;
}

.nav,
.footer-inner,
.page-shell,
.seo-content {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.nav,
.footer-inner {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-block: 1rem;
}

.brand {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
}

.nav-links a,
.footer-links a {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.footer-links a:hover { color: var(--blue); }

.page-shell { padding-block: 4rem 1rem; }

.home-hero { max-width: 900px; }
.home-generator { max-width: 720px; }
.home-generator .result p { color: #cbd5e1; margin-bottom: 0; }
.home-generator .button.secondary { border-color: #93c5fd; }

.eyebrow {
  color: var(--blue-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2.1rem, 6vw, 4rem); letter-spacing: -.04em; margin: .6rem 0 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.025em; }
h3 { font-size: 1.1rem; }

.lede {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 760px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

.button {
  align-items: center;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: .75rem;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  min-height: 2.8rem;
  padding: .65rem 1rem;
  text-decoration: none;
}

.button:hover { background: var(--blue-dark); }
.button.secondary { background: white; color: var(--blue-dark); }
.button.secondary:hover { background: var(--soft); }

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

.card,
.tool-panel,
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
}

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

.section { margin-top: 3.5rem; }

.article-shell { max-width: 900px; }

.article-body { margin-top: 3rem; }

.article-body section {
  border-top: 1px solid var(--line);
  margin-top: 2.75rem;
  padding-top: 1.25rem;
}

.article-body p,
.article-body li { color: var(--muted); }

.article-body li + li { margin-top: .55rem; }

.article-body pre { white-space: pre-wrap; }

.section-tight { margin-top: 1.25rem; }

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

.tool-card {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.tool-card p { flex: 1; }

.tool-badge {
  background: var(--soft);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: .25rem .6rem;
  text-transform: uppercase;
}

.notice {
  background: var(--warning);
  border-color: #fed7aa;
  color: #9a3412;
  margin-top: 1.5rem;
}

.tool-panel {
  box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
  margin-top: 2rem;
}

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .4rem; }

input,
select,
textarea {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: .7rem;
  color: var(--ink);
  font: inherit;
  padding: .75rem .85rem;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
  outline: none;
}

textarea[readonly] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 12rem;
}

#regex-result-matches { white-space: pre-wrap; }

.widget-preview {
  border: 0;
  min-height: 330px;
  width: 100%;
}

.embed-code { white-space: pre-wrap; }

.result {
  background: #0f172a;
  border-radius: .8rem;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-top: 1rem;
  overflow-wrap: anywhere;
  padding: 1rem;
}

.result-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result small { color: #94a3b8; display: block; }
.result strong { display: block; margin-top: .2rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: .8rem; text-align: left; }
th { background: #f8fafc; }

.country-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.country-links a {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334155;
  font-size: .9rem;
  padding: .4rem .75rem;
  text-decoration: none;
}

.seo-content {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  padding-block: 3rem;
}

.seo-content .seo-intro {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border: 1px solid #bfdbfe;
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.seo-content p { color: var(--muted); }
.seo-content code { background: #e2e8f0; border-radius: .3rem; padding: .12rem .35rem; }

.status {
  border-radius: .6rem;
  display: none;
  margin-top: 1rem;
  padding: .7rem .9rem;
}

.status.error { background: #fef2f2; color: #b91c1c; display: block; }
.status.success { background: #ecfdf5; color: #047857; display: block; }

.third-party-ad {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
}

.ad-label {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
  margin: 0 0 .75rem;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .grid,
  .result-grid,
  .tool-grid { grid-template-columns: 1fr; }
  .nav { align-items: flex-start; flex-direction: column; }
  .page-shell { padding-top: 2.5rem; }
}
