:root {
  --bg-left: #0b0f1a;
  --text: #e9eefc;
  --muted: rgba(233, 238, 252, 0.78);
  --line: rgba(233, 238, 252, 0.18);
  --accent: #89C541;
  --accent-hover: #6ea431;
  --row-hover: rgba(233, 238, 252, 0.06);
  --row-border: rgba(233, 238, 252, 0.08);
  --content-text: rgba(233, 238, 252, 0.66);
  --content-strong: rgba(233, 238, 252, 0.74);
  --content-heading: rgba(233, 238, 252, 0.58);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: #000;
  overflow: hidden;
}

/* ===== Desktop layout: 1/4 left, 3/4 right ===== */
.wrap {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 3fr;
}

.left {
  background: linear-gradient(180deg, rgba(11, 15, 26, 0.98), rgba(11, 15, 26, 0.92));
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* header / scroll / footer */
  min-width: 280px;
  height: 100vh;
  overflow: hidden;
}

/* Desktop header (sticky) */
.left-header {
  padding: 22px 22px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(11, 15, 26, 0.98), rgba(11, 15, 26, 0.92));
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand .title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
}

.brand .title .name {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 18px;
}

.desktop-title {
  margin-top: 10px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  font-weight: 500;
}

/* Mobile-only copyright in topbar (hidden on desktop) */
.mobile-copyright {
  display: none;
}

/* Scroll area */
.left-scroll {
  padding: 14px 22px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.10);
  position: relative;
  /* needed for scroll-top button */
}

.left-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.left-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

.left-scroll::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.left-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

ul li {
  position: relative;
  padding: 3px 8px 5px 28px;
  border: 1px solid transparent;
  border-left: 2px solid rgba(137, 197, 65, 0.18);
  border-radius: 10px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

/* Arrow bullet */
ul li::before {
  content: "→";
  position: absolute;
  left: 5px;
  top: 0px;
  color: var(--accent);
  font-weight: 600;
  margin-right: 5px;
}

.term {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  color: var(--text);
  opacity: 0.96;
}

/* Desktop footer (sticky) */
.left-footer {
  padding: 12px 22px;
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(11, 15, 26, 0.92), rgba(11, 15, 26, 0.98));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Desktop-only titlebar hidden by default */
.mobile-titlebar {
  display: none;
}

.right {
  position: relative;
  overflow: hidden;
}

.hero {
  position: absolute;
  inset: 0;
  background: url("/img/ai-architect.webp") center center / cover no-repeat;
  z-index: 0;
}

.right::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 50%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.00) 55%);
  pointer-events: none;
  z-index: 1;
}

.social-box {
  position: absolute;
  right: 40%;
  top: 0px;
  z-index: 3;

  background: rgba(11, 15, 26, 1.0);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0 0 10px 10px;

  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.social-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.social-link:hover img {
  transform: scale(1.05);
  transition: transform 120ms ease;
}

/* ===== Collapse blocks inside .left-scroll ===== */
.collapse-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  background: rgba(11, 15, 26, 0.35);
  overflow: hidden;
}

.collapse-title {
  list-style: none;
  /* removes default marker in some browsers */
  cursor: pointer;
  padding: 12px 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* remove default triangle marker (we make our own) */
.collapse-title::-webkit-details-marker {
  display: none;
}

.collapse-title::after {
  content: "▾";
  color: var(--muted);
  font-weight: 500;
  transform: translateY(-1px);
}

details[open]>.collapse-title::after {
  content: "▴";
}

.collapse-content {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

/* subtitle inside collapse */
.collapse-subtitle {
  margin: 0 0 10px 0;
  color: #888;
  font-weight: 500;
}

/* optional plain list for Studies */
.plain-list {
  margin-top: 0;
  font-weight: 500;
}

/* ===== Posts toggle + panel ===== */
.posts-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* button links naast social-box */
.posts-toggle-btn {
  position: absolute;
  right: calc(23% + 0px);
  top: 0px;
  z-index: 4;

  background: rgba(11, 15, 26, 1.0);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0 0 10px 10px;

  padding: 3px 6px;
  height: 55px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 12px;

  cursor: pointer;
  user-select: none;
}

.posts-toggle-btn img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.posts-toggle-btn:hover img {
  transform: scale(1.06);
  transition: transform 120ms ease;
}

/* panel (default gesloten) */
.posts-panel {
  position: absolute;
  right: calc(23% - 20px);
  top: 54px;
  bottom: 18px;
  width: 360px;
  z-index: 4;

  background: linear-gradient(180deg, rgba(11, 15, 26, 0.98), rgba(11, 15, 26, 0.92));
  border: 1px solid var(--line);
  border-radius: 12px;

  display: none;
  /* dicht */
  overflow: hidden;
}

/* open state */
.posts-toggle-input:checked~.posts-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

/* header inside panel */
.posts-panel-header {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.posts-panel-title {
  color: #888;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}

.posts-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.posts-list {
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  /* needed for scroll-top button */

  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.10);
}

.posts-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.posts-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

.posts-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.posts-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* post card layout */
.post-card {
  border: 1px solid rgba(233, 238, 252, 0.10);
  border-left: 2px solid rgba(137, 197, 65, 0.18);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: rgba(11, 15, 26, 0.35);
}

.post-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.post-text {
  padding: 10px 12px 5px;
}

.post-title {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-size: 13px;
  margin-bottom: 6px;
  margin-top: 5px;
}

.post-desc {
  color: #888;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.25;
}

/* ===== Scroll-to-top buttons ===== */
.scroll-top-btn {
  position: sticky;
  left: 0%;
  bottom: 30px;
  transform: translateX(0%);

  width: 36px;
  height: 36px;
  border-radius: 50%;

  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 15, 26, 0.98), rgba(11, 15, 26, 0.92));

  color: var(--accent);
  font-size: 18px;
  font-weight: 800;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  opacity: 0;
  pointer-events: none;

  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 5;
}

.scroll-top-btn:hover {
  transform: translateX(0%) translateY(-2px);
}

/* visible state */
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* === Fix: posts scroll-to-top button rechts buiten het posts-paneel === */
.posts-panel {
  position: absolute;
  /* blijft zoals je had op desktop */
}

/* ===== Posts collapses ===== */
.posts-collapse {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  background: rgba(11, 15, 26, 0.35);
  overflow: hidden;
}

.posts-collapse-title {
  list-style: none;
  cursor: pointer;
  padding: 12px 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.posts-collapse-title-h2 {
  list-style: none;
  cursor: pointer;
  padding: 12px 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* remove default marker */
.posts-collapse-title::-webkit-details-marker {
  display: none;
}

.posts-collapse-title::after {
  content: "▾";
  color: var(--muted);
  font-weight: 500;
  transform: translateY(-1px);
}

/* remove default marker */
.posts-collapse-title-h2::-webkit-details-marker {
  display: none;
}

.posts-collapse-title-h2::after {
  content: "▾";
  color: var(--muted);
  font-weight: 500;
  transform: translateY(-1px);
}

.posts-collapse[open]>.posts-collapse-title::after {
  content: "▴";
}

.posts-collapse-content {
  padding: 10px 10px 12px;
  border-top: 1px solid var(--line);
}

/* ===== Unify typography: all collapses + posts ===== */

/* 1) Base text inside collapses and posts */
.collapse-content,
.posts-collapse-content,
.post-desc {
  color: var(--content-text);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.35;
}

/* 2) Make paragraphs behave like your <span class="term"> style */
.collapse-content p,
.posts-collapse-content p,
.post-desc p {
  margin: 0 0 10px 0;
  color: var(--content-text);
  font-weight: 400;
}

/* 3) Ensure lists inside content inherit the same text tone */
.collapse-content ul,
.posts-collapse-content ul {
  color: var(--content-text);
}

/* 4) Make <span class="term"> match the new softer tone */
.term {
  color: var(--content-text);
  font-weight: 500;
  opacity: 1;
  /* we control tone via rgba now */
}

/* 5) Fix bold text in the report: keep emphasis, but not harsh/white */
.collapse-content b,
.posts-collapse-content b,
.post-desc b,
.collapse-content strong,
.posts-collapse-content strong,
.post-desc strong {
  color: var(--content-strong);
  font-weight: 600;
}

/* 6) Subtitles and small headings */
.collapse-subtitle,
.posts-panel-title {
  color: var(--content-heading);
  font-weight: 600;
}

/* Base list item text: same tone & weight as paragraphs */
.collapse-content li,
.posts-collapse-content li,
.posts-list li {
  font-weight: 500;
  color: var(--content-text);
}

/* Arrow bullet: softer and lighter */
.collapse-content li::before,
.posts-collapse-content li::before,
.posts-list li::before {
  font-weight: 500;
  /* was 800 */
  opacity: 0.55;
}

/* Ensure span.term does not re-introduce extra contrast */
.collapse-content .term,
.posts-collapse-content .term {
  font-weight: 500;
  color: var(--content-text);
}

/* Intro post: iets prominenter */
.posts-intro {
  border-color: rgba(137, 197, 65, 0.35);
  background: rgba(11, 15, 26, 0.45);
}

/* Wrapper "Alle posts": visueel iets zwaarder zodat die altijd als hoofding voelt */
.posts-all {
  border-color: rgba(233, 238, 252, 0.22);
  background: rgba(11, 15, 26, 0.40);
}

/* Binnenkant van wrapper: geef nesting wat ruimte */
.posts-all-content {
  padding: 10px 8px 4px;
}

/* Geneste posts krijgen iets minder margin zodat het compact blijft */
.posts-all-content>.posts-collapse {
  margin-bottom: 10px;
}

/* Optioneel: maak de wrapper-titel iets “knop-achtig” */
.posts-all>.posts-collapse-title {
  font-weight: 600;
}

/* Desktop: posts panel wider */
.posts-panel {
  width: 376px;
  max-width: calc(100vw - 24px);
}

/* Square images that scale with the panel */
.post-img {
  width: 300px;
  height: 300px;
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

/* ===== Mobile layout ===== --------------------------------------------------------------------------------------------*/
@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .desktop-title {
    display: none;
  }

  .wrap {
    height: 100svh;
    height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: 12% 33% 5% 45%;
  }

  /* Topbar = left-header */
  .left {
    background: transparent;
    display: contents;
  }

  .left-header {
    grid-row: 1;
    padding: 12px 14px;
    position: relative;
    border-bottom: 1px solid var(--line);
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand .title .name {
    font-size: 16px;
  }

  /* Copyright right-bottom inside the same topbar */
  .mobile-copyright {
    display: block;
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
  }

  /* Image block */
  .right {
    grid-row: 2;
    position: relative;
    overflow: hidden;
  }

  /* Title bar (non-scrollable) */
  .mobile-titlebar {
    grid-row: 3;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(11, 15, 26, 0.92), rgba(11, 15, 26, 0.98));
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  /* Scroll list */
  .left-scroll {
    grid-row: 4;
    padding: 10px 14px 18px;
  }

  /* Hide desktop footer on mobile */
  .left-footer {
    display: none;
  }

  /* Slightly tighter list text */
  .term {
    font-size: 14px;
  }

  .social-box {
    top: 0px;
    right: 30%;
    bottom: auto;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
    padding: 8px;
    gap: 8px;
  }

  .social-link {
    width: 30px;
    height: 30px;
  }

  /* Mobile scroll hint for the collapses area */
  .left-scroll::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18px;
    pointer-events: none;
  }

  /* Mobile: posts icoon rechtsboven in header */
  .posts-toggle-btn {
    position: fixed;
    top: 15px;
    right: 10px;
    z-index: 10000;

    height: 38px;
    width: 38px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(11, 15, 26, 0.6);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  /* Icoon exact gecentreerd */
  .posts-toggle-btn img {
    width: 32px;
    height: 32px;
  }

  .posts-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 10svh;
    bottom: 10px;
    width: auto;
    z-index: 9999;
  }
}