/* Hermes Knowledge Engine (HKE) — site styles
   Light theme: Projeto Hermes design system (USP blue, Inter, rounded cards).
   Dark theme: Lunaris Orbita / Licita's approved dark palette (navy ink +
   copper + sand) — reused as-is, since Hermes has no dark theme defined yet.
   Toggle persists via localStorage, defaults to the visitor's OS preference. */

:root{
  --background: #FFFFFF;
  --foreground: #1A1A1A;
  --card: #FFFFFF;
  --muted: #F8F9FA;
  --muted-foreground: #6B7280;
  --border: #E5E7EB;

  /* brand-primary = fill for primary actions/emphasis.
     brand-accent  = hover/focus/small indicators.
     In the light (Hermes) theme both are the same USP blue. */
  --brand-primary: #025395;
  --brand-primary-hover: #01457D;
  --brand-primary-foreground: #FFFFFF;
  --brand-accent: #025395;
  --brand-accent-soft: #E6F0F8;

  --destructive: #EF4444;
  --success: #16A34A;
  --warning: #D97706;
  --info: #0284C7;
  --semantic-tint-alpha: .1;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;

  --font-sans: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  --transition: 200ms ease-out;
}

html[data-theme="dark"]{
  --background: #081219;
  --foreground: #F7F3EF;
  --card: #101E28;
  --muted: #172630;
  --muted-foreground: #B9AFA7;
  --border: #2D3D48;

  --brand-primary: #D6B397;
  --brand-primary-hover: #C7A183;
  --brand-primary-foreground: #0B1822;
  --brand-accent: #C27235;
  --brand-accent-soft: rgba(194,114,53,.15);

  --destructive: #F87171;
  --success: #4ADE80;
  --warning: #FBBF24;
  --info: #7BA3BD;
  --semantic-tint-alpha: .16;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
img{ max-width:100%; display:block; }
a{ color: var(--brand-accent); text-decoration:none; }
h1,h2,h3{ font-family: var(--font-sans); color: var(--foreground); font-weight:600; letter-spacing:-0.01em; margin:0; }

.container{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / nav ---------- */
.site-header{
  background: var(--background);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 16px 0;
  flex-wrap: wrap;
  gap:12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
}
.brand-mark{ line-height:0; display:flex; }
.brand-mark img{ width:34px; height:34px; display:block; }
.brand-text{ font-size:1.125rem; font-weight:600; letter-spacing:-0.01em; color: var(--foreground); }
.brand-text small{
  display:block;
  font-size:.75rem;
  font-weight:500;
  color: var(--muted-foreground);
  letter-spacing:0;
}

.header-controls{ display:flex; align-items:center; gap:8px; }

.theme-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px; height:36px;
  background: var(--background);
  border:1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--foreground);
  cursor:pointer;
  transition: background var(--transition), border-color var(--transition);
}
.theme-toggle:hover{ background: var(--muted); }
.theme-toggle svg{ width:18px; height:18px; }
.theme-toggle .icon-moon{ display:none; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display:block; }

.nav-toggle{
  display:none;
  background: var(--background);
  border:1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size:.875rem;
  padding:7px 14px;
  cursor:pointer;
  transition: background var(--transition);
}
.nav-toggle:hover{ background: var(--muted); }

nav.main-nav ul{
  display:flex;
  gap:2px;
  list-style:none;
  margin:0;
  padding:0;
}
nav.main-nav a{
  display:block;
  padding: 8px 14px;
  color: var(--muted-foreground);
  text-decoration:none;
  font-size:.9rem;
  font-weight:500;
  border-radius: var(--radius-lg);
  transition: background var(--transition), color var(--transition);
}
nav.main-nav a:hover{
  color: var(--brand-accent);
  background: var(--brand-accent-soft);
}
nav.main-nav a.active{
  color: var(--brand-accent);
  background: var(--brand-accent-soft);
  font-weight:600;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 22px;
  font-family: var(--font-sans);
  font-weight:600;
  font-size:.9375rem;
  text-decoration:none;
  border:1px solid transparent;
  border-radius: var(--radius-xl);
  cursor:pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
}
.btn-primary{ background: var(--brand-primary); color: var(--brand-primary-foreground); }
.btn-primary:hover{
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194,114,53,.25);
}
html:not([data-theme="dark"]) .btn-primary:hover{ box-shadow: 0 4px 12px rgba(2,83,149,.25); }
.btn-secondary{ background: var(--background); color: var(--foreground); border-color: var(--border); }
.btn-secondary:hover{ background: var(--muted); }
.btn[aria-disabled="true"]{ opacity:.5; cursor:not-allowed; pointer-events:none; }

/* ---------- Hero ---------- */
.hero{
  background: var(--background);
  padding: 72px 0 64px;
  transition: background var(--transition);
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items:center;
}
.hero h1{ font-size:2.75rem; margin:0 0 16px; line-height:1.15; }
.hero .tagline{ font-size:1.15rem; color: var(--foreground); margin:0 0 14px; max-width:44ch; font-weight:500; }
.hero .desc{ color: var(--muted-foreground); margin:0 0 32px; max-width:56ch; font-size:1.02rem; }
.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; }

/* Pipeline diagram (hero visual) — styled as a Card */
.pipeline-steps{ display:flex; flex-direction:column; gap:0; }
.pipeline-step{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:14px 0;
  border-top:1px solid var(--border);
}
.pipeline-step:first-child{ border-top:none; padding-top:4px; }
.pipeline-step-num{
  flex:none;
  width:26px; height:26px;
  border-radius:999px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  font-size:.75rem;
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  margin-top:1px;
}
.pipeline-step-body strong{
  display:block;
  color: var(--foreground);
  font-size:.92rem;
  font-weight:600;
  margin-bottom:2px;
}
.pipeline-step-body span{ color: var(--muted-foreground); font-size:.85rem; }

/* ---------- Content sections ---------- */
.content{ padding: 24px 0 72px; }
.content-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:24px;
  align-items:start;
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: background var(--transition), border-color var(--transition);
}
.card-header{ padding: 22px 24px 0; }
.card-title{ font-size:1.05rem; font-weight:600; color: var(--foreground); margin:0; }
.card-description{ font-size:.85rem; color: var(--muted-foreground); margin:4px 0 0; }
.card-body{ padding: 18px 24px 24px; }
.card + .card{ margin-top:20px; }

.feature-list{ list-style:none; margin:0; padding:0; }
.feature-list li{
  position:relative;
  padding-left:26px;
  margin-bottom:13px;
  color: var(--foreground);
  line-height:1.6;
  font-size:.96rem;
}
.feature-list li:last-child{ margin-bottom:0; }
.feature-list li::before{
  content:"";
  position:absolute;
  left:0;
  top:.45em;
  width:14px;
  height:14px;
  border-radius:999px;
  background: var(--brand-accent-soft);
  border: 2px solid var(--brand-accent);
}

/* ---------- Badges ---------- */
.badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  border-radius:999px;
  font-family: var(--font-sans);
  font-weight:600;
  font-size:.75rem;
  padding:4px 12px;
  line-height:1.3;
}
.badge-success{ background: rgba(22,163,74,var(--semantic-tint-alpha)); color: var(--success); }
.badge-warning{ background: rgba(217,119,6,var(--semantic-tint-alpha)); color: var(--warning); }
.badge-info{ background: rgba(2,132,199,var(--semantic-tint-alpha)); color: var(--info); }
.badge-error{ background: rgba(239,68,68,var(--semantic-tint-alpha)); color: var(--destructive); }
.badge-usp{ background: var(--brand-primary); color: var(--brand-primary-foreground); }
.badge-outline{ background:transparent; color: var(--foreground); border:1px solid var(--border); }
.badge-neutral{ background: var(--muted); color: var(--muted-foreground); }

.link-list{ list-style:none; margin:0; padding:0; }
.link-list li{ border-top:1px solid var(--border); }
.link-list li:first-child{ border-top:none; }
.link-list a{
  display:block;
  padding:10px 2px;
  color: var(--foreground);
  text-decoration:none;
  font-size:.92rem;
  font-weight:500;
  transition: color var(--transition);
}
.link-list a:hover{ color: var(--brand-accent); }

/* ---------- Footer ---------- */
.site-footer{
  background: var(--background);
  border-top:1px solid var(--border);
  color: var(--muted-foreground);
  padding: 28px 0;
  font-size:.85rem;
  transition: background var(--transition), border-color var(--transition);
}
.site-footer a{ color: var(--muted-foreground); text-decoration:underline; }
.site-footer a:hover{ color: var(--brand-accent); }
.footer-inner{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; }

/* ---------- Docs page ---------- */
.docs-grid{ display:grid; grid-template-columns: 220px 1fr; gap:40px; }
.docs-nav{ position:sticky; top:16px; align-self:start; }
.docs-nav ul{ list-style:none; margin:0; padding:0; }
.docs-nav a{
  display:block;
  padding:7px 12px;
  color: var(--muted-foreground);
  text-decoration:none;
  font-size:.87rem;
  border-radius: var(--radius-lg);
  transition: background var(--transition), color var(--transition);
}
.docs-nav a:hover{ color: var(--brand-accent); background: var(--brand-accent-soft); }
.docs-content h2{
  border-bottom:1px solid var(--border);
  padding-bottom:10px;
  margin-top:40px;
  font-size:1.3rem;
}
.docs-content h2:first-child{ margin-top:0; }
.docs-content p{ color: var(--foreground); max-width:70ch; line-height:1.7; font-size:.98rem; }

/* ---------- Tables (downloads / changelog) ---------- */
table{ width:100%; border-collapse:collapse; font-size:.9rem; }
th, td{ text-align:left; padding:11px 14px; border-bottom:1px solid var(--border); }
thead th{ color: var(--muted-foreground); font-weight:600; font-size:.8rem; text-transform:uppercase; letter-spacing:.03em; }
tbody tr:last-child td{ border-bottom:none; }
td.mono, th.mono{ font-family: "SFMono-Regular", Consolas, monospace; font-size:.85rem; }

.empty-state{
  border:1px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: var(--muted-foreground);
  background: var(--muted);
}
.empty-state strong{
  display:block;
  color: var(--foreground);
  font-size:1rem;
  font-weight:600;
  margin-bottom:6px;
}

.example-row td{ color: var(--muted-foreground); font-style:italic; }

/* ---------- Glossary ---------- */
.term-list{ margin:0; }
.term-list dt{
  color: var(--foreground);
  font-size:.98rem;
  font-weight:600;
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--border);
}
.term-list dt:first-child{ margin-top:0; padding-top:0; border-top:none; }
.term-list dd{ margin:5px 0 0; color: var(--muted-foreground); line-height:1.65; font-size:.92rem; }

/* ---------- Responsive ---------- */
@media (max-width: 880px){
  .hero-grid, .content-grid, .docs-grid{ grid-template-columns: 1fr; }
  .docs-nav{ position:static; padding-bottom:12px; border-bottom:1px solid var(--border); margin-bottom:20px; }
  .docs-nav ul{ display:flex; flex-wrap:wrap; gap:4px; }
}

@media (max-width: 700px){
  .nav-toggle{ display:inline-block; }
  nav.main-nav{ display:none; width:100%; order:3; }
  nav.main-nav.open{ display:block; }
  nav.main-nav ul{ flex-direction:column; }
  .hero{ padding: 48px 0; }
  .hero h1{ font-size:2rem; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ transition:none !important; }
}

a:focus-visible, button:focus-visible{
  outline:2px solid var(--brand-accent);
  outline-offset:2px;
}
