:root {
  --dsa-bg: #11110f;
  --dsa-surface: #1b1815;
  --dsa-surface-alt: #26211c;
  --dsa-text: #e7dcc8;
  --dsa-muted: #b8ab95;
  --dsa-accent: #b8924a;
  --dsa-accent-strong: #6c2f2a;
  --dsa-overlay: rgba(8, 7, 6, 0.72);
}

* { box-sizing: border-box; }
body {
  position: relative;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--dsa-text);
  background: var(--dsa-bg);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: url('../images/hero-banner.webp') center/cover no-repeat;
  transform: scale(1.03);
  filter: saturate(0.9) brightness(0.42);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 6, 5, 0.32) 0%, rgba(10, 9, 8, 0.82) 18%, rgba(12, 11, 10, 0.92) 100%),
    radial-gradient(circle at top, rgba(108, 47, 42, 0.25), transparent 30%),
    linear-gradient(140deg, rgba(184, 146, 74, 0.08), rgba(8, 7, 6, 0.86));
}

body > * {
  position: relative;
  z-index: 1;
}

a { color: var(--dsa-accent); }
a:hover { color: #d8b26d; }
.shell { width: min(1100px, calc(100vw - 2rem)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(17, 17, 15, 0.78);
  border-bottom: 1px solid rgba(184, 146, 74, 0.2);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}

.site-title {
  color: var(--dsa-text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.site-nav a {
  color: var(--dsa-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--dsa-text);
  border-bottom-color: rgba(184, 146, 74, 0.4);
}

.content-shell { padding: 2rem 0 4rem; }
.with-sidebar {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid rgba(184, 146, 74, 0.18);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(38, 33, 28, 0.96), rgba(27, 24, 21, 0.96));
}

.sidebar-group + .sidebar-group {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(184, 146, 74, 0.14);
}

.sidebar-group h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--dsa-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.sidebar-group a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 0.55rem;
  text-decoration: none;
  color: var(--dsa-text);
}

.sidebar-group a:hover,
.sidebar-group a.active {
  background: rgba(184, 146, 74, 0.12);
  color: var(--dsa-accent);
}

.sidebar-search-wrap {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.sidebar-search-label {
  color: var(--dsa-muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-search-input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(184, 146, 74, 0.18);
  border-radius: 0.75rem;
  background: rgba(12, 11, 10, 0.7);
  color: var(--dsa-text);
  font: inherit;
}

.sidebar-search-input::placeholder {
  color: rgba(184, 171, 149, 0.75);
}

.sidebar-search-input:focus,
.automation-search-input:focus {
  outline: none;
  border-color: rgba(184, 146, 74, 0.46);
  box-shadow: 0 0 0 3px rgba(184, 146, 74, 0.12);
}

.page-content {
  min-width: 0;
}

.prose {
  padding: 1.5rem clamp(1rem, 2vw, 2rem);
  border: 1px solid rgba(184, 146, 74, 0.14);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(28, 24, 20, 0.86), rgba(18, 16, 14, 0.92));
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.prose > :first-child { margin-top: 0; }

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.15;
  color: #f1e8d7;
}

.prose h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}

.prose h2 {
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(184, 146, 74, 0.14);
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
}

.prose h3 {
  margin-top: 1.7rem;
  font-size: 1.15rem;
}

.prose p,
.prose li,
.prose blockquote {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--dsa-text);
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose strong {
  color: #f3ead6;
}

.prose code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(184, 146, 74, 0.12);
  color: #f0dbb7;
  font-size: 0.95em;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(10, 9, 8, 0.72);
  border: 1px solid rgba(184, 146, 74, 0.14);
}

.prose pre code {
  padding: 0;
  background: transparent;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 1rem;
  border-left: 3px solid rgba(184, 146, 74, 0.45);
  color: var(--dsa-muted);
  background: rgba(184, 146, 74, 0.04);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.8rem;
  border: 1px solid rgba(184, 146, 74, 0.16);
}

.prose hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid rgba(184, 146, 74, 0.14);
}

.hero {
  overflow: hidden;
  border: 1px solid rgba(184, 146, 74, 0.24);
  border-radius: 1.4rem;
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.2rem, 4vw, 3rem);
  margin-bottom: 2rem;
  background:
    linear-gradient(135deg, rgba(9, 8, 7, 0.7), rgba(8, 7, 6, 0.42)),
    url('../images/hero-banner.webp') center/cover no-repeat;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.24);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(184, 146, 74, 0.3);
  background: rgba(17, 17, 15, 0.45);
  color: var(--dsa-muted);
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 0.95;
  text-wrap: balance;
}

.hero p { max-width: 48rem; }

.hero-copy {
  max-width: 48rem;
  font-size: 1.08rem;
  line-height: 1.75;
  color: #f0e6d5;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  color: var(--dsa-muted);
  font-size: 0.95rem;
}

.hero-meta span {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(17, 17, 15, 0.38);
  border: 1px solid rgba(184, 146, 74, 0.14);
}

.hero-actions, .card-grid, .feature-grid, .reference-grid { display: flex; gap: 1rem; flex-wrap: wrap; }
.card-grid, .feature-grid, .reference-grid { margin-top: 1.5rem; }
.hero-actions a, .link-card, .reference-link {
  display: inline-block;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(184, 146, 74, 0.35);
  background: rgba(27, 24, 21, 0.82);
  color: var(--dsa-text);
  text-decoration: none;
}

.hero-actions a:first-child,
.link-card:hover,
.reference-link:hover {
  background: rgba(108, 47, 42, 0.28);
}

.card {
  flex: 1 1 16rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid rgba(184, 146, 74, 0.18);
  background: linear-gradient(180deg, rgba(38, 33, 28, 0.96), rgba(27, 24, 21, 0.96));
}

.card p,
.feature-card p,
.reference-card p {
  color: var(--dsa-muted);
  line-height: 1.7;
}

.section-intro {
  max-width: 44rem;
  color: var(--dsa-muted);
  line-height: 1.8;
}

.feature-card,
.reference-card {
  flex: 1 1 18rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(184, 146, 74, 0.16);
  background: linear-gradient(180deg, rgba(31, 27, 23, 0.96), rgba(20, 18, 15, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.feature-card h3,
.reference-card h3,
.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #f1e7d2;
}

.reference-link {
  margin-top: 0.7rem;
}

.content-shell table { width: 100%; border-collapse: collapse; }
.content-shell th, .content-shell td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(184, 146, 74, 0.15);
  vertical-align: top;
}

.content-shell th {
  text-align: left;
  color: #f0e4cc;
  background: rgba(184, 146, 74, 0.06);
}

.automation-status {
  display: grid;
  gap: 1.25rem;
}

.automation-status > h1,
.automation-status > h2,
.automation-status > p,
.automation-status > table {
  margin-top: 0;
}

.automation-toc {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.55rem;
}

.automation-search-row {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 1.2rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(184, 146, 74, 0.16);
  border-radius: 0.95rem;
  background:
    linear-gradient(180deg, rgba(47, 36, 28, 0.82), rgba(23, 19, 16, 0.88)),
    radial-gradient(circle at top right, rgba(184, 146, 74, 0.14), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.automation-search-label {
  color: #f1e7d2;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.automation-search-input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(184, 146, 74, 0.2);
  border-radius: 0.8rem;
  background: rgba(14, 12, 10, 0.78);
  color: var(--dsa-text);
  font: inherit;
}

.automation-search-input::placeholder {
  color: rgba(184, 171, 149, 0.7);
}

.automation-empty-state {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(184, 146, 74, 0.18);
  border-radius: 0.85rem;
  background: rgba(108, 47, 42, 0.14);
  color: #f1dcc4;
  font-style: italic;
}

.automation-highlight {
  padding: 0.06rem 0.2rem;
  border-radius: 0.3rem;
  background: rgba(184, 146, 74, 0.3);
  color: #fff0d0;
  box-shadow: 0 0 0 1px rgba(184, 146, 74, 0.2);
}

.automation-toc li {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(184, 146, 74, 0.14);
  border-radius: 0.85rem;
  background: rgba(18, 16, 14, 0.45);
}

.automation-toc li span {
  display: block;
  color: var(--dsa-muted);
  font-size: 0.94rem;
}

.automation-toc li span:last-child a {
  color: var(--dsa-accent);
}

.automation-progress {
  display: grid;
  gap: 0.35rem;
  min-width: min(18rem, 100%);
}

.automation-progress__bar {
  width: 100%;
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(184, 146, 74, 0.14);
}

.automation-progress__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease-out;
}

.automation-progress__fill--red {
  background: linear-gradient(90deg, #8f2d23, #d95b48);
}

.automation-progress__fill--orange {
  background: linear-gradient(90deg, #a85616, #df9a38);
}

.automation-progress__fill--blue {
  background: linear-gradient(90deg, #245b84, #4ba1d9);
}

.automation-progress__fill--green {
  background: linear-gradient(90deg, #2f6d38, #7fca70);
}

.automation-progress__fill--none {
  background: linear-gradient(90deg, rgba(184, 146, 74, 0.12), rgba(184, 146, 74, 0.12));
}

.automation-progress__label {
  color: var(--dsa-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.automation-module {
  border: 1px solid rgba(184, 146, 74, 0.2);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(34, 29, 25, 0.92), rgba(19, 17, 15, 0.94));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.automation-module-anchor {
  display: block;
  height: 0;
  margin: 0;
  scroll-margin-top: 5.75rem;
  visibility: hidden;
}

.automation-module + .automation-module {
  margin-top: 1rem;
}

.automation-module summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, rgba(52, 41, 32, 0.88), rgba(31, 26, 22, 0.88));
}

.automation-module summary::-webkit-details-marker {
  display: none;
}

.automation-module__title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  font-size: 1rem;
  color: #f3ead6;
}

.automation-module__title span {
  color: var(--dsa-muted);
  font-size: 0.95rem;
}

.automation-module__meta {
  width: min(18rem, 100%);
}

.automation-module__body {
  padding: 1rem 1.1rem 1.2rem;
}

.automation-module__links {
  margin: 0 0 1rem;
  color: var(--dsa-muted);
}

.automation-category + .automation-category {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(184, 146, 74, 0.12);
}

.automation-category__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.automation-category__header h4 {
  margin: 0;
  font-size: 1.05rem;
  color: #f1e7d2;
}

.automation-category__header p {
  margin: 0;
  color: var(--dsa-muted);
  font-size: 0.95rem;
}

.automation-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(184, 146, 74, 0.12);
  border-radius: 0.85rem;
  background: rgba(12, 11, 10, 0.42);
}

.automation-entry-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
}

.automation-entry-table th,
.automation-entry-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(184, 146, 74, 0.1);
  text-align: left;
  vertical-align: top;
}

.automation-entry-table th {
  position: sticky;
  top: 0;
  background: rgba(37, 31, 26, 0.96);
  color: #f1e7d2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.automation-entry-table td {
  color: var(--dsa-text);
  font-size: 0.96rem;
  line-height: 1.5;
}

.automation-entry-table tr:hover td {
  background: rgba(184, 146, 74, 0.04);
}

.automation-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.automation-status-pill--automated {
  background: rgba(90, 132, 76, 0.18);
  border-color: rgba(110, 176, 95, 0.28);
  color: #bfe7ac;
}

.automation-status-pill--manual {
  background: rgba(145, 75, 55, 0.18);
  border-color: rgba(192, 107, 76, 0.28);
  color: #f2bfab;
}

.automation-status-pill--untracked {
  background: rgba(184, 146, 74, 0.14);
  border-color: rgba(184, 146, 74, 0.25);
  color: #ead29f;
}

.home-section {
  margin-top: 2.75rem;
}

@media (max-width: 720px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .site-nav { gap: 0.75rem; }
  .content-shell { padding-top: 1.25rem; }
  .hero { padding: 3rem 1rem; }
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
  }
  .prose {
    padding: 1.1rem 0.95rem;
  }
  .hero-actions a, .link-card, .reference-link {
    width: 100%;
    text-align: center;
  }
  .automation-module summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .automation-entry-table {
    min-width: 34rem;
  }
}
