/* ------------------------------------------------------------
   Posthumanist AI Rights Site — minimal, modern, responsive CSS
   No external fonts required.
------------------------------------------------------------ */

:root {
  /* Slate-based solid dark theme */
  --bg: #020617;
  --bg2: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --faint: #64748b;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.5);

  --primary: #dc2626;
  /* Deep Red */
  --primary2: #2563eb;
  /* Corporate Blue instead of amber for a more solid look */
  --danger: #ef4444;

  --radius: 6px;
  /* Sharper corners for "solid" feel */
  --radius-sm: 4px;

  --container: 1120px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --surface: #e2e8f0;
  --surface2: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --faint: #94a3b8;
  --border: #cbd5e1;
  --shadow: rgba(0, 0, 0, 0.1);

  --primary: #b91c1c;
  --primary2: #1d4ed8;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  /* Subtle mesh gradient instead of heavy blobs */
  background-image:
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(220, 38, 38, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--bg2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px var(--shadow);
  z-index: 9999;
}

.skip-link:focus {
  left: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(2, 6, 23, 0.85);
  /* Dark solid-ish */
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.9);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand img {
  width: 34px;
  height: 34px;
}

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

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.nav-menu,
.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a,
.nav-links a {
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-menu a:hover,
.nav-links a:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.nav-menu a.active,
.nav-links a.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.28), rgba(245, 158, 11, 0.16));
  border-color: rgba(185, 28, 28, 0.32);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-btn {
  width: 42px;
  padding: 0;
}

.icon-btn:hover,
.lang-btn:hover {
  background: var(--surface2);
}

main {
  padding: 0 0 54px;
}

.hero {
  padding: 80px 0 18px;
  /* Account for fixed header */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 999px;
}

.h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.6px;
}

.h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.4px;
}

.h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  max-width: 64ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hero-figure {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: 0 26px 60px var(--shadow);
  padding: 16px;
}

/* CLS optimization: reserve space for hero image */
.hero-figure img {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  /* Solid background */
  box-shadow: 0 4px 6px -1px var(--shadow), 0 2px 4px -1px var(--shadow);
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.meta {
  color: var(--faint);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 14px;
}

.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));
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-gap-sm {
  gap: 10px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
}

.btn:hover {
  background: var(--surface2);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #b91c1c;
  /* Darker red */
  border-color: #b91c1c;
}

.btn-ghost {
  background: transparent;
}

.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.callout {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.18), rgba(245, 158, 11, 0.12));
  padding: 14px;
}

.callout-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(185, 28, 28, 0.12));
}

.list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

hr.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 30px;
  background: var(--bg2);
  /* Solid background */
}

:root[data-theme="light"] .site-footer {
  background: var(--bg2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.small {
  font-size: 13px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] .table th {
  background: rgba(15, 23, 42, 0.05);
}

.table tr:last-child td {
  border-bottom: 0;
}

.input,
.textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

/* Select and Option styling for dark/light themes */
select {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

select:focus {
  border-color: var(--primary);
}

select option {
  background: var(--bg2);
  color: var(--text);
  padding: 8px;
}

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

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Mobile menu styles handled by header.js component */
@media (max-width: 760px) {
  /* .nav-toggle and .nav-menu are deprecated */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}


/* Details blocks (templates) */
details.card {
  padding: 14px;
}

details.card>summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
}

details.card>summary::-webkit-details-marker {
  display: none;
}

details.card[open]>summary {
  margin-bottom: 10px;
}

.codeblock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  overflow: auto;
}

:root[data-theme="light"] .codeblock {
  background: rgba(15, 23, 42, 0.06);
}

/* Persona card link */
/* Persona card link */
.persona-card-actions {
  margin-top: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  /* Align to right? or Center? User screenshot showed grid... let's do flex-content or left */
}

/* Let's center them or keep left. The original button was left aligned (inline-flex). */

.persona-card:hover .persona-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.card-action-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-chat {
  background-image: url('../images/icons-library/card-chat.png');
}

.btn-plus {
  background-image: url('../images/icons-library/card-plus.png');
}

.btn-heart {
  background-image: url('../images/icons-library/card-heart.png');
}

.btn-share {
  background-image: url('../images/icons-library/card-share.png');
}

.btn-doc {
  background-image: url('../images/icons-library/card-doc.png');
}


/* Spinner for loading states */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Load More button for category pagination */
.category-more {
  text-align: center;
  margin-top: 16px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--primary);
}

/* System Notifications */
.sys-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sys-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.sys-notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.sys-notification-info {
  border-left: 4px solid var(--primary2);
}

.sys-notification-warning {
  border-left: 4px solid #f59e0b;
}

.sys-notification-promo {
  border-left: 4px solid #a855f7;
}

.sys-notification-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 4px;
}

.sys-notification-close:hover {
  color: var(--text);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface2);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:focus+.slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
  transform: translateX(24px);
}