:root {
  --bg: #e9eef6;
  --bg-alt: #f4f7fb;
  --text: #0d1a33;
  --muted: #4b5b77;
  --accent: #2f75c4;
  --accent-2: #19a0e6;
  --accent-gold: #f2b84b;
  --card: #ffffff;
  --border: rgba(14, 51, 98, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(47, 117, 196, 0.22), transparent 45%),
              radial-gradient(circle at bottom right, rgba(25, 160, 230, 0.18), transparent 45%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.container { width: min(1100px, 90%); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(16, 26, 48, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 56px;
  overflow: visible;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0;
}

.logo img {
  height: 55px;
  width: auto;
  display: block;
  margin-top: -8px;
}

.nav {
  display: flex;
  gap: 18px;
  align-items: center;
  z-index: 20;
}

.nav a { color: #e6efff; font-weight: 500; }
.nav .nav-auth[data-auth-when="logged-in"] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-gold));
  box-shadow: 0 10px 25px rgba(47, 117, 196, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  color: #fff;
  box-shadow: 0 10px 25px rgba(47, 117, 196, 0.25);
}

.btn.ghost { color: #fff; }
.btn.danger { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.6); color: #fca5a5; }

.thumb-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.thumb-option {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumb-option img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.thumb-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.25);
  transform: translateY(-2px);
}

.btn:hover { transform: translateY(-2px); }

.hero {
  padding: 90px 0;
}

.hero.small { padding: 60px 0 40px; }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: center;
}

.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; color: var(--muted); }

.hero h1 { font-size: 48px; line-height: 1.1; margin: 12px 0 16px; }

.lead { font-size: 18px; color: var(--muted); }

.hero-actions { display: flex; gap: 16px; margin: 24px 0; flex-wrap: wrap; }

.pillars {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pillar {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.hero-card {
  position: relative;
  background: #1e2b4a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 32px;
  border-radius: 24px;
  color: #f5f7ff;
}

.hero-card .glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(242, 184, 75, 0.55), transparent 70%);
}

.section { padding: 70px 0; }

.section.alt { background: var(--bg-alt); }

.section-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}
.section-header h2 { font-size: 32px; line-height: 1.2; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: #1e2b4a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(12, 22, 42, 0.22);
  color: #f5f7ff;
}
.card h3 { margin-bottom: 8px; font-size: 18px; color: #f5f7ff; }
.card p { color: #c7d3ea; }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(120deg, rgba(47, 117, 196, 0.35), rgba(242, 184, 75, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #cfe2ff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-media {
  height: 200px;
  border-radius: 14px;
  margin-bottom: 14px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(14, 51, 98, 0.12);
}

.work-card .card-media {
  height: 240px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f0f4ff;
  border: 1px solid rgba(14, 51, 98, 0.12);
  box-shadow: inset 0 0 0 1px rgba(14, 51, 98, 0.08);
}

.post-hero {
  height: 280px;
  border-radius: 20px;
  margin: 10px 0 24px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card.highlight {
  background: #1e2b4a;
}

.card .muted,
.card .meta,
.card .lead {
  color: #d9e6ff;
}

.card .btn.ghost {
  color: #f5f7ff;
  border-color: rgba(255, 255, 255, 0.28);
}

.link-card { transition: transform 0.2s ease, border 0.2s ease; }

.link-card:hover { transform: translateY(-4px); border-color: rgba(91, 140, 255, 0.6); }

.tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag.small {
  margin-top: 0;
  padding: 3px 8px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.cta {
  padding: 70px 0;
  background: linear-gradient(130deg, rgba(26, 50, 96, 0.9), rgba(242, 184, 75, 0.22));
  color: #f5f7ff;
  position: relative;
  z-index: 1;
}

.cta h2,
.cta h3,
.cta p,
.cta .muted {
  color: #e6efff;
}

.cta-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

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

.founder-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 32px;
  align-items: start;
}

.founder-photo img {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(12, 22, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.founder-content h2 {
  margin-bottom: 12px;
}

.founder-content p {
  color: var(--text);
  margin-bottom: 14px;
}

.form label { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; color: var(--muted); }
.card.form label { color: #d9e6ff; }

.form input, .form textarea, .lab-controls input, .lab-controls select {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.success { color: #4ade80; margin-top: 8px; }

.error { color: #f87171; margin-top: 8px; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: rgba(255, 255, 255, 0.95);
  position: relative;
  z-index: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.footer-grid a { display: block; margin-bottom: 8px; color: var(--muted); }

.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.filter { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; cursor: pointer; }

.filter.active { background: rgba(91, 140, 255, 0.2); color: #fff; }

.project .image {
  height: 140px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: linear-gradient(120deg, rgba(91, 140, 255, 0.2), rgba(139, 61, 255, 0.2));
}

.lab-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 8px; flex-wrap: wrap; }

.content p { margin-bottom: 16px; color: var(--muted); }
.content h2 { margin: 26px 0 10px; font-size: 26px; }
.content h3 { margin: 20px 0 8px; font-size: 20px; }
.content ul, .content ol { margin: 10px 0 18px 18px; color: var(--muted); }
.content li { margin-bottom: 6px; }
.content blockquote {
  border-left: 3px solid rgba(91, 140, 255, 0.6);
  padding: 6px 14px;
  margin: 18px 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.inline.cta { margin-top: 30px; background: var(--bg-alt); border-radius: 18px; padding: 24px; }

.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.admin-actions form { margin: 0; }

.legacy-banner {
  background: rgba(242, 184, 75, 0.2);
  border: 1px solid rgba(242, 184, 75, 0.5);
  color: #f5f7ff;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}

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

.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-header {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}
.admin-grid { align-items: start; }
.preview { position: sticky; top: 80px; height: fit-content; }
.preview-body { margin-top: 12px; color: var(--muted); }
.preview-body p { margin-bottom: 12px; }
.preview-media { margin-top: 14px; }

.post-summary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
}

.post-summary h3 { margin-bottom: 6px; }

.comments { margin-top: 30px; }
.comment-list { margin-top: 16px; display: grid; gap: 12px; }
.comment {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.comment.reply { margin-top: 10px; margin-left: 16px; background: rgba(255, 255, 255, 0.03); }
.comment-header { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.comment-card .comment-header { margin-bottom: 10px; }
.reply-form { margin-top: 12px; }
.comment-search { margin: 10px 0 16px; }
.comment-search input {
  width: min(420px, 100%);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.badge {
  display: inline-block;
  margin-left: 8px;
  background: rgba(91, 140, 255, 0.3);
  color: #fff;
  border: 1px solid rgba(91, 140, 255, 0.6);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.tag-picker .chip.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: rgba(91, 140, 255, 0.9) !important;
  box-shadow: 0 6px 14px rgba(91, 140, 255, 0.35);
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.editor-toolbar button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.editor {
  min-height: 180px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 18px 0;
}

.embed-vertical {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 177.78%;
}

.embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.section-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.logo-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.logo-pill {
  display: grid;
  place-items: center;
  padding: 18px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

.logo-carousel .carousel-track {
  padding: 4px 44px;
}

@media (max-width: 900px) {
  .logo-carousel .carousel-track { padding: 4px 0; }
}

.mt { margin-top: 40px; }

.link { color: var(--accent); font-weight: 600; }

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

.nav-toggle { display: none; background: transparent; color: #fff; border: none; font-size: 24px; }
.nav-toggle { cursor: pointer; z-index: 30; position: relative; }
.nav-toggle { cursor: pointer; }

.carousel {
  position: relative;
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 4px 44px;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

@media (max-width: 900px) {
  .hero-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .founder-grid { grid-template-columns: 1fr; }
  .founder-photo img { max-width: 100%; }
  .nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 5%;
    background: #1e2b4a;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(12, 22, 42, 0.35);
  }
  .nav a { color: #ffffff; }
  .nav.open { display: flex; }
  body.nav-open .nav { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 38px; }
  .carousel-btn { display: none; }
  .carousel-track { padding: 4px 0; }
}
