:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --ink: #172033;
  --muted: #627084;
  --line: #d9e1ec;
  --accent: #ff6d3a;
  --accent-dark: #cf4b1f;
  --focus: #0f7b8f;
  --success: #1f8a5b;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 109, 58, 0.10), rgba(255, 255, 255, 0) 360px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: #27364d;
}

pre {
  overflow-x: auto;
  margin: 0;
}

pre code {
  display: block;
  min-width: 100%;
  padding: 12px;
  white-space: pre;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(217, 225, 236, 0.8);
  background: rgba(245, 247, 251, 0.88);
  backdrop-filter: blur(16px);
}

.topbar,
.hero,
.section,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

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

.brand,
.nav-links,
.hero-actions,
.filters,
.card-footer,
.tag-list {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  letter-spacing: 0;
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: var(--surface);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  gap: 32px;
  padding: 72px 0 48px;
}

.hero-content {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 7vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
}

.button.primary {
  color: #ffffff;
  background: var(--accent);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-dark);
}

.button.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  border-color: #b7c2d0;
}

.hero-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.hero-panel > div {
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
}

.metric {
  display: block;
  margin-bottom: 4px;
  font-size: 1.7rem;
  font-weight: 850;
}

.metric-label {
  color: var(--muted);
  font-weight: 700;
}

.section {
  padding: 56px 0;
}

.band {
  width: 100%;
  padding-right: max(16px, calc((100% - 1120px) / 2));
  padding-left: max(16px, calc((100% - 1120px) / 2));
  background: var(--surface);
}

.section-heading,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: end;
}

.search {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #ffffff;
}

.search input:focus {
  outline: 3px solid rgba(15, 123, 143, 0.18);
  border-color: var(--focus);
}

.filters {
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

.filter-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  border-color: var(--ink);
  color: #ffffff;
  background: var(--ink);
}

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

.script-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

.script-card h3 {
  font-size: 1.18rem;
}

.script-card p {
  color: var(--muted);
  line-height: 1.58;
}

.script-meta {
  margin: 0 0 18px;
}

.script-meta div {
  display: grid;
  gap: 4px;
}

.script-meta dt {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.script-meta dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.category {
  width: fit-content;
  margin-bottom: 16px;
  border-radius: 6px;
  padding: 6px 9px;
  color: #ffffff;
  background: var(--focus);
  font-size: 0.78rem;
  font-weight: 850;
}

.tag-list {
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 18px;
  padding: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.script-details {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.script-details summary {
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.script-details summary:focus-visible {
  outline: 3px solid rgba(15, 123, 143, 0.18);
  outline-offset: 2px;
}

.detail-content {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px;
  background: #ffffff;
}

.detail-content h4 {
  margin-bottom: 6px;
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-content p,
.detail-content ul {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.detail-content ul {
  padding-left: 18px;
}

.card-footer {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.risk {
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 850;
}

.download-link {
  border-radius: 7px;
  padding: 9px 12px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 850;
}

.download-link:hover,
.download-link:focus-visible {
  background: var(--accent-dark);
}

.download-link.is-disabled {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-muted);
  cursor: not-allowed;
}

.download-link.is-disabled:hover,
.download-link.is-disabled:focus-visible {
  background: var(--surface-muted);
}

.catalog-status,
.empty-state {
  margin: 24px 0 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li,
.quality-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.steps strong,
.steps span {
  display: block;
}

.steps span,
.quality-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.quality {
  padding-top: 20px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .hero,
  .section-heading,
  .split,
  .script-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 46px;
  }

  .hero-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .script-card {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .topbar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links a {
    padding: 9px 6px;
    font-size: 0.92rem;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .download-link {
    text-align: center;
  }
}
