:root {
  --bg: #f4f7fb;
  --bg-2: #eaf0f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --text: #132033;
  --muted: #5d6f86;
  --border: rgba(19, 32, 51, 0.12);
  --shadow: 0 20px 44px rgba(16, 28, 46, 0.12);
  --sidebar-bg: linear-gradient(180deg, #131f36 0%, #1f2d4f 100%);
  --sidebar-text: #f3f7ff;
  --accent-flow: #f59e0b;
  --accent-jors: #6366f1;
  --accent-lens: #06b6d4;
  --accent-audit: #ef4444;
  --accent: #4f78ff;
  --radius-lg: 18px;
  --radius-md: 12px;
}

:root[data-theme='dark'] {
  --bg: #0f172a;
  --bg-2: #111c33;
  --surface: #17243f;
  --surface-soft: #1b2a49;
  --text: #e8efff;
  --muted: #a5b5d0;
  --border: rgba(210, 225, 255, 0.14);
  --shadow: 0 22px 46px rgba(1, 7, 18, 0.5);
  --sidebar-bg: linear-gradient(180deg, #0b1324 0%, #121f39 100%);
  --sidebar-text: #d7e3ff;
  --accent: #89a5ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bg);
  background: radial-gradient(circle at 10% -20%, var(--bg-2), var(--bg));
  color: var(--text);
}

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

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

.sidebar {
  width: 268px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 24px 18px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 26px;
}

.brand h1 {
  margin: 0;
  letter-spacing: 0.02em;
  font-size: 1.7rem;
}

.brand small {
  color: rgba(223, 236, 255, 0.74);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  display: block;
  border-radius: 10px;
  padding: 10px 12px;
  transition: background 120ms ease;
  font-weight: 600;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  display: grid;
  gap: 10px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.btn.primary {
  background: linear-gradient(135deg, #4578ff, #6d62ff);
  color: #fff;
  border-color: transparent;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #eef4ff;
  border-color: rgba(255, 255, 255, 0.15);
}

.main {
  margin-left: 268px;
  width: calc(100% - 268px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 30px;
}

.page {
  padding: 24px 30px 48px;
}

.hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 26px;
}

.hero h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
}

.hero p {
  margin-top: 12px;
  color: var(--muted);
  max-width: 74ch;
  line-height: 1.6;
}

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

.grid.modules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 18px;
}

.module-card h3 {
  margin: 0 0 8px;
}

.module-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface-soft);
}

.accent-flow { border-left: 5px solid var(--accent-flow); }
.accent-jors { border-left: 5px solid var(--accent-jors); }
.accent-lens { border-left: 5px solid var(--accent-lens); }
.accent-audit { border-left: 5px solid var(--accent-audit); }

.section-title {
  margin: 28px 0 12px;
  font-size: 1.2rem;
}

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

.media-card {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.media-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.media-card figcaption {
  padding: 10px 11px 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

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

.video-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  overflow: hidden;
}

.video-thumb {
  height: 180px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.video-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.35));
}

.play {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
}

.play::before {
  content: '';
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #1d2f53;
}

.video-meta {
  padding: 12px;
}

.video-meta h4 {
  margin: 0 0 8px;
}

.video-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.legal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.legal-box h3 {
  margin-top: 0;
}

.legal-box p,
.legal-box li {
  color: var(--muted);
  line-height: 1.55;
}

.notice {
  border-left: 4px solid #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, var(--surface));
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 12px;
  color: var(--text);
}

.demo-banner-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.demo-banner-ribbon {
  position: absolute;
  top: 0;
  width: 25px;
  height: 100vh;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.92) 0,
    rgba(239, 68, 68, 0.92) 10px,
    rgba(153, 27, 27, 0.95) 10px,
    rgba(153, 27, 27, 0.95) 20px
  );
  color: #fff;
  border-left: 2px solid rgba(255, 255, 255, 0.7);
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  animation: none;
}

.demo-banner-ribbon--right {
  right: 0;
  box-shadow: -10px 0 24px rgba(127, 29, 29, 0.4);
}

.demo-banner-ribbon--left {
  left: 0;
  box-shadow: 10px 0 24px rgba(127, 29, 29, 0.4);
}

.demo-banner-ribbon span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  font-size: clamp(1.12rem, 1.2vw, 0.9rem);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-90deg);
  transform-origin: center center;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.42);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;
  animation: none;
}

@keyframes demoRibbonStripeDrift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 -20px;
  }
}

@keyframes demoRibbonTextFloat {
  0% {
    transform: rotate(-90deg) translateY(0);
  }
  50% {
    transform: rotate(-90deg) translateY(-3px);
  }
  100% {
    transform: rotate(-90deg) translateY(0);
  }
}

@media (max-width: 1024px) {
  .grid.modules,
  .gallery,
  .video-gallery,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-footer {
    position: static;
    margin-top: 10px;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }

  .layout {
    flex-direction: column;
  }

  .demo-banner-ribbon {
    width: 25px;
  }

  .demo-banner-ribbon span {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
  }
}
