/* Senate Layout — topbar, sidebar, content, marketing sections, responsive */

/* --- Flex/Grid utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-1 { flex: 1; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Spacing utilities --- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.ms-1 { margin-left: 8px; }
.ms-2 { margin-left: 16px; }
.py-2 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 32px; padding-bottom: 32px; }
.px-2 { padding-left: 16px; padding-right: 16px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.w-full { width: 100%; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-none { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */

.dashboard {
  display: flex;
  min-height: 100vh;
}

/* --- Topbar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.topbar-logo .logo-rule {
  width: 3px;
  height: 38px;
  background: var(--accent);
  border-radius: var(--r-rule);
}

.topbar-logo .logo-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.topbar-logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.topbar-logo .logo-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-muted);
  margin-top: 2px;
}

.env-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 6px 20px;
  border-radius: var(--r-btn);
  line-height: 1.4;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user {
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-btn);
  border: none;
  background: none;
  color: var(--text);
  transition: background var(--t-fast);
}
.topbar-user:hover {
  background: var(--surface);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 6px;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-3);
}
/* Show sun in dark mode, moon in light mode */
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: block; }
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform var(--t-normal);
}

.sidebar-section {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  padding: 20px 24px 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--t-fast);
}

.sidebar-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-item.active {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.sidebar-item svg,
.sidebar-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Content area --- */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-top: var(--nav-h);
  padding: 40px 48px;
  min-height: calc(100vh - var(--nav-h));
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.content-header h1 {
  font-size: clamp(22px, 2.8vw, 28px);
}

/* --- Hamburger (hidden on desktop) --- */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

/* --- Sidebar overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 35;
}

/* ========================================
   MARKETING LAYOUT
   ======================================== */

/* --- Marketing nav --- */
.marketing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(252, 251, 249, 0.85);
  border-bottom: 1px solid var(--border);
}

.marketing-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo .logo-rule {
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: var(--r-rule);
}

.nav-logo .logo-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.nav-logo .logo-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-muted);
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--t-fast);
}
.nav-link:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Marketing sections --- */
.section {
  padding: 110px var(--page-pad);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-dark {
  background: var(--surface-dark);
  color: var(--text-inv);
}

.section-surface {
  background: var(--surface);
}

.section-header {
  margin-bottom: 56px;
}

.section-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-tag .rule {
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: var(--r-rule);
}

.section-tag span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.section-dark .section-tag span {
  color: var(--accent-light);
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-2);
  font-size: 16px;
  max-width: 560px;
}

.section-dark .section-header p {
  color: var(--text-inv-2);
}

/* --- Hero --- */
.hero {
  padding: 130px var(--page-pad) 120px;
  background: var(--bg);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(38px, 5.5vw, 62px);
  line-height: 1.08;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-mock);
  padding: 24px;
  min-height: 320px;
}

/* --- Footer --- */
.footer {
  background: var(--surface-dark);
  color: var(--text-inv);
  padding: 60px var(--page-pad) 44px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-inv);
}

.footer-brand .logo-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-muted);
  margin-top: 4px;
}

.footer-brand p {
  color: var(--text-inv-2);
  font-size: 14px;
  margin-top: 16px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-inv);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-inv-2);
  padding: 4px 0;
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--text-inv); }

.footer-bottom {
  border-top: 1px solid var(--border-dark);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-inv-2);
}

/* ========================================
   DASHBOARD FOOTER
   ======================================== */

.dashboard-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: auto;
  padding-top: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-footer-copy {
  font-size: 12px;
  color: var(--text-3);
}
.dashboard-footer-links {
  display: flex;
  gap: 20px;
}
.dashboard-footer-links a {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 120ms;
}
.dashboard-footer-links a:hover {
  color: var(--text-2);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Dashboard: tablets */
@media (max-width: 1024px) {
  .hamburger { display: block; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .content {
    margin-left: 0;
    padding: 32px 24px;
  }
}

/* Grids collapse */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-mock { display: none; }
}

@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .content { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-footer { flex-direction: column; align-items: flex-start; }
  .dashboard-footer-links { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
}
