/* =========================
   Trust-State Unified CSS
   Refined Institutional Version
   ========================= */

/* ---------- Root Variables ---------- */

:root {
  --ts-navy: #0A1F33;
  --ts-accent: #1E90FF;
  --ts-light: #F5F7FA;
  --ts-border: #E5E7EB;
  --ts-text: #1F2937;
  --ts-muted: #6B7280;
  --max-width: 1100px;
  --doc-width: 760px;
  --radius: 6px;
}

/* ---------- Base Reset ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--ts-light);
  color: var(--ts-text);
  line-height: 1.6;
}

/* ---------- Layout Containers ---------- */

.ts-container {
  max-width: var(--max-width);
  margin: auto;
  padding: 0 1.5rem;   /* horizontal only */
}

/* Document width control */
.ts-document {
  max-width: var(--doc-width);
  margin: 0 auto;
  line-height: 1.5;
}

/* =========================
   HOMEPAGE SECTION RHYTHM
========================= */

.ts-section {
  padding: 2.25rem 0;
}

/* Document pages tighten spacing */
.ts-document .ts-section {
  padding: 0.75rem 0;
}

/* ---------- Hero Spacing ---------- */

/* HERO */
.ts-hero {
  padding: 4rem 0 1.5rem 0;   /* ↓ significantly reduced bottom */
}

/* ---------- Grid Spacing ---------- */

.ts-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 1.25rem;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  color: var(--ts-navy);
  font-weight: 600;
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--ts-border);
  padding-bottom: 0.5rem;
}

.ts-section h2 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.ts-section h3 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

p {
  margin-bottom: 0.75rem;
}

ul, ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

/* ---------- Cards ---------- */

.ts-card {
  background: #ffffff;
  border: 1px solid var(--ts-border);
  border-radius: var(--radius);
  padding: 2rem;
}

/* ---------- Links ---------- */

a {
  color: var(--ts-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Topbar ---------- */

.ts-topbar {
  background: #F4F7FA;
  font-size: 0.8rem;
  text-align: center;
  padding: 0.4rem 0;
  color: var(--ts-muted);
  border-bottom: 1px solid var(--ts-border);
}

/* ---------- Header ---------- */

.ts-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--ts-border);
  z-index: 1000;
}

.ts-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.ts-logo a {
  text-decoration: none;
  color: var(--ts-navy);
  font-weight: 600;
  font-size: 1.1rem;
}

/* ---------- Navigation ---------- */

.ts-menu {
  display: flex;
  align-items: center;
}

.ts-menu-item {
  position: relative;
  margin-left: 2rem;
}

.ts-menu-item > a {
  position: relative;
  color: var(--ts-text);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.ts-menu-item > a:hover {
  color: var(--ts-accent);
}

.ts-menu-item > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--ts-accent);
  transition: width 0.25s ease;
}

.ts-menu-item > a:hover::after {
  width: 100%;
}

/* ---------- Footer ---------- */

.ts-footer {
  background: var(--ts-navy);
  color: #ffffff;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}

.ts-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.ts-footer-bottom {
  margin-top: 2rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .ts-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ts-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .ts-menu {
    flex-direction: column;
    margin-top: 1rem;
  }

  .ts-menu-item {
    margin-left: 0;
    margin-bottom: 0.75rem;
  }
}