/* ============================================================
   PEQ Rule Engine — Layout (header / footer / sections / grids)
   ============================================================ */

/* ---------- containers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

main {
  flex: 1;
  padding-top: var(--header-h);
}

/* ---------- sections ---------- */
.section {
  padding-block: var(--section-pad);
}

.section--tight {
  padding-block: 48px;
}

.section--alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 14px;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--cobalt);
}

.section-head--center .kicker::after {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--cobalt);
}

.section-title {
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.section-desc {
  margin-top: 14px;
  font-size: var(--fs-lg);
  color: var(--ink-2);
}

/* ---------- page hero ---------- */
.page-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 320px at 85% -80px, rgba(30, 91, 214, 0.07), transparent 65%),
    var(--bg);
}

.page-hero .kicker {
  margin-bottom: 12px;
}

.page-hero h1 {
  font-size: var(--fs-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--ink);
}

.page-hero .lead {
  margin-top: 18px;
  font-size: var(--fs-xl);
  color: var(--ink-2);
  max-width: 760px;
}

.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* ---------- grids ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-elev);
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  fill: none;
}

.brand-mark rect {
  fill: var(--navy);
  stroke: var(--line-strong);
}

.brand-mark path {
  stroke: #e8eef8;
  stroke-width: 1.8;
  stroke-linecap: round;
}

[data-theme="dark"] .brand-mark rect {
  fill: var(--navy-2);
}

.brand-mark circle {
  fill: var(--cyan);
}

.brand-mark circle:nth-of-type(2) {
  fill: #5b8df0;
}

.brand-mark circle:nth-of-type(3) {
  fill: var(--cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-name em {
  font-style: normal;
  font-weight: 600;
  color: var(--cobalt);
}

.brand-tag {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* main nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
}

.main-nav a {
  padding: 8px 13px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.main-nav a:hover {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}

.main-nav a[aria-current="page"] {
  color: var(--cobalt-deep);
  background: var(--cobalt-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
}

/* mobile nav panel */
.mobile-nav {
  display: none;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 40px;
}

.footer-brand .brand {
  margin-bottom: 14px;
}

.footer-brand p {
  color: var(--ink-2);
  font-size: var(--fs-sm);
}

.footer-note {
  margin-top: 12px;
  color: var(--ink-3) !important;
  font-size: var(--fs-xs) !important;
}

.footer-col h3 {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

.footer-col a:hover {
  color: var(--cobalt);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}

.footer-meta {
  letter-spacing: 0.04em;
}

/* ---------- misc layout ---------- */
.lead {
  font-size: var(--fs-lg);
  color: var(--ink-2);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.sticky-note {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
}

.annotate {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.center {
  text-align: center;
}
