:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #d9e1ea;
  --border-strong: #b8c4d1;
  --text: #18212b;
  --muted: #5c6b7a;
  --link: #1f5fbf;
  --link-dark: #164a94;
  --accent: #b55318;
  --code-bg: #0f1720;
  --code-text: #e8f2fb;
  --shadow: rgba(20, 31, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, #f5f7fa 260px, #eef2f6 100%);
}

.shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border);
}

.brand {
  min-width: 0;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.site-banner {
  display: block;
  width: clamp(110px, 14vw, 180px);
  flex: 0 0 auto;
  height: auto;
}

.brand p {
  margin: 8px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
}

.header-meta span {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  margin-top: 24px;
}

.side-panel {
  align-self: start;
  position: sticky;
  top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px var(--shadow);
  padding: 14px;
}

.panel-title {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.search-label,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.search {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-size: 0.95rem;
  outline: none;
}

.search:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.12);
}

.category-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.category-group {
  display: grid;
  gap: 4px;
}

.category-group-title {
  margin: 6px 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.menu-button {
  min-height: 34px;
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 7px 9px;
  font-size: 0.92rem;
  font-weight: 700;
}

.menu-icon {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-right: 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 900;
}

.discord-menu-icon {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.24);
}

.menu-button:hover {
  background: #eef5ff;
  color: var(--link-dark);
}

.menu-button.active {
  background: #e7f0ff;
  color: var(--link-dark);
  box-shadow: inset 3px 0 0 var(--link);
}

.support-panel {
  margin-top: 16px;
  border: 1px solid #df9a9d;
  border-left: 4px solid #b51f24;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #fff3f3 0%, #ffe5e6 100%);
  box-shadow: 0 8px 18px rgba(181, 31, 36, 0.14);
}

.support-panel h2 {
  margin: 0;
  font-size: 0.94rem;
  color: #86191d;
}

.support-panel p {
  margin: 8px 0 0;
  color: #633234;
  line-height: 1.45;
  font-size: 0.88rem;
}

.support-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #b51f24;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(181, 31, 36, 0.24);
}

.support-panel a:hover {
  background: #91171b;
}

.discord-bubble {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 14px;
  border: 1px solid #aeb9ff;
  border-radius: 999px 18px 18px 999px;
  padding: 9px 10px;
  background: linear-gradient(135deg, #eef1ff 0%, #f8f9ff 54%, #e9edff 100%);
  box-shadow: 0 10px 24px rgba(88, 101, 242, 0.18);
}

.discord-bubble-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(88, 101, 242, 0.28);
}

.discord-bubble h2 {
  margin: 0;
  color: #2430a8;
  font-size: 0.82rem;
  line-height: 1.2;
}

.discord-bubble p {
  margin: 4px 0 0;
  color: #374064;
  font-size: 0.74rem;
  line-height: 1.3;
}

.discord-bubble a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  text-decoration: none;
}

.discord-bubble a:hover {
  background: #4752c4;
}

.content-panel {
  min-height: calc(100vh - 150px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px var(--shadow);
  padding: 22px;
}

.site-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid #9bcf9b;
  border-left: 4px solid #23863a;
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f1fbf2 0%, #e4f6e8 100%);
  box-shadow: 0 8px 18px rgba(35, 134, 58, 0.12);
}

.site-notice h2 {
  margin: 0;
  color: #17692b;
  font-size: 1rem;
  font-weight: 900;
}

.site-notice p {
  margin: 6px 0 0;
  color: #285436;
  line-height: 1.5;
  font-size: 0.95rem;
}

.notice-link {
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 9px 13px;
  background: #23863a;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(35, 134, 58, 0.22);
}

.notice-link:hover {
  background: #17692b;
}

.content-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.content-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.4rem);
  line-height: 1.1;
}

.article-counter {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.article-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.article-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.article-title {
  width: 100%;
  border: 0;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 14px;
  text-align: left;
  font-size: 1rem;
  font-weight: 800;
}

.article-title:hover {
  background: #edf4ff;
  color: var(--link-dark);
}

.article-body {
  display: none;
  padding: 18px;
  color: var(--text);
  line-height: 1.65;
}

.article-card.open .article-body {
  display: block;
}

.article-body p {
  margin: 0;
}

.article-body p + p,
.article-body ul + p,
.article-body p + ul,
.article-body pre + p,
.article-body table + p {
  margin-top: 14px;
}

.article-body ul {
  margin: 0;
  padding-left: 22px;
}

.article-body li + li {
  margin-top: 5px;
}

.article-body h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
  color: var(--text);
}

.article-body ol {
  margin: 0;
  padding-left: 22px;
}

.article-body p + ol,
.article-body ol + p,
.article-body h3 + ol {
  margin-top: 10px;
}

.article-body code {
  color: #9b3d0e;
  background: #fff3e8;
  border: 1px solid #ffd8bc;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.article-body pre {
  overflow: auto;
  margin: 14px 0 0;
  padding: 14px;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid #263445;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

.article-body pre code {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
}

.source-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.source-details summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 800;
}

.source-details pre {
  max-height: 520px;
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0 0 8px 8px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.92rem;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 9px 10px;
  vertical-align: top;
}

.article-body .rules-table tbody tr:nth-child(odd) {
  background: #f8fbff;
}

.article-body .rules-table tbody tr:nth-child(even) {
  background: #eef5ff;
}

.article-body .rules-table tbody tr:hover {
  background: #e3efff;
}

.article-body th {
  background: var(--surface-soft);
  text-align: left;
  color: var(--text);
}

.learning-path {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.learning-path section,
.resource-link {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.learning-path section {
  padding: 14px;
}

.learning-path section h3 {
  margin-top: 0;
}

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

.resource-link {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(20, 31, 43, 0.05);
}

.resource-link:hover {
  border-color: #96b7e8;
  background: #eef5ff;
}

.resource-link.direct-download {
  border-color: #0f8d4a;
  background: linear-gradient(180deg, #e9fbf0 0%, #d8f4e3 100%);
  box-shadow: 0 10px 22px rgba(15, 141, 74, 0.16);
}

.resource-link.direct-download:hover {
  border-color: #0b6f3a;
  background: linear-gradient(180deg, #dcf7e7 0%, #c8edd8 100%);
}

.resource-link.direct-download strong {
  color: #075f32;
}

.resource-link strong {
  color: var(--link-dark);
  line-height: 1.25;
}

.resource-link span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.blender-video-grid .resource-link {
  border-color: var(--video-border);
  background: linear-gradient(180deg, var(--video-bg-start) 0%, var(--video-bg-end) 100%);
  box-shadow: 0 8px 18px var(--video-shadow);
}

.blender-video-grid .resource-link:hover {
  border-color: var(--video-hover-border);
  background: linear-gradient(180deg, var(--video-hover-start) 0%, var(--video-hover-end) 100%);
}

.blender-video-grid .resource-link strong {
  color: var(--video-title);
}

.blender-video-grid .resource-link span {
  color: var(--video-copy);
}

.blender-video-grid-1 {
  --video-bg-start: #f2fbf1;
  --video-bg-end: #e3f6df;
  --video-border: #b8dfb4;
  --video-hover-start: #e9f8e6;
  --video-hover-end: #d7f0d1;
  --video-hover-border: #89c984;
  --video-shadow: rgba(64, 128, 64, 0.09);
  --video-title: #216a2f;
  --video-copy: #46624a;
}

.blender-video-grid-2 {
  --video-bg-start: #e9f8e6;
  --video-bg-end: #d4efce;
  --video-border: #99d096;
  --video-hover-start: #dff3da;
  --video-hover-end: #c7e8bf;
  --video-hover-border: #70b96d;
  --video-shadow: rgba(47, 120, 54, 0.12);
  --video-title: #185d27;
  --video-copy: #3e5d42;
}

.blender-video-grid-3 {
  --video-bg-start: #def2d8;
  --video-bg-end: #c5e8bb;
  --video-border: #7cbe76;
  --video-hover-start: #d1ecc9;
  --video-hover-end: #b7dfac;
  --video-hover-border: #5ca858;
  --video-shadow: rgba(31, 104, 42, 0.14);
  --video-title: #0f5120;
  --video-copy: #354f38;
}

.blender-video-grid-4 {
  --video-bg-start: #d1ebca;
  --video-bg-end: #afdca4;
  --video-border: #63ac5d;
  --video-hover-start: #c3e4bb;
  --video-hover-end: #9fd391;
  --video-hover-border: #428f40;
  --video-shadow: rgba(20, 91, 35, 0.16);
  --video-title: #0a451b;
  --video-copy: #304b34;
}

.important-callout,
.priority-resource {
  margin-top: 18px;
  border: 1px solid #8fb4e6;
  border-left: 5px solid var(--link);
  border-radius: 8px;
  background: linear-gradient(180deg, #f2f7ff 0%, #e9f2ff 100%);
  padding: 14px;
}

.important-callout h3,
.priority-resource h3 {
  margin-top: 0;
}

.priority-resource span {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--link-dark);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.featured-resources .resource-link {
  border-color: #8fb4e6;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.96)),
    linear-gradient(135deg, #d8ebff, #ffffff);
}

.workflow-hero {
  margin-top: 16px;
  border: 1px solid #b9cde5;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(241,247,255,0.95)),
    linear-gradient(135deg, #e9f2ff, #ffffff);
  box-shadow: 0 10px 22px rgba(20, 31, 43, 0.08);
}

.workflow-hero span {
  display: inline-block;
  color: var(--link-dark);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workflow-hero h3 {
  margin: 5px 0 6px;
  font-size: 1.08rem;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.workflow-steps section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-soft);
}

.workflow-steps h3 {
  margin-top: 0;
}

.modeling-figure {
  margin: 14px 0 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.modeling-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.modeling-figure figcaption {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  border-top: 1px solid var(--border);
  background: #fff;
}

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

.figure-grid .modeling-figure {
  margin-top: 0;
}

.article-figure {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.article-figure img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
}

.article-figure figcaption {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  border-top: 1px solid var(--border);
  background: #fff;
}

.source-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.download-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border: 1px solid #c9d6e5;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.96)),
    linear-gradient(135deg, #d8ebff, #ffffff);
  box-shadow: 0 12px 26px rgba(20, 31, 43, 0.09);
}

.download-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #1688c7, #23a455);
}

.download-card.featured {
  grid-column: 1 / -1;
  min-height: 190px;
  border-color: #b84d72;
  background:
    linear-gradient(180deg, rgba(255, 247, 250, 0.99), rgba(255, 255, 255, 0.99)),
    linear-gradient(135deg, #ffd9e6, #fff5dd);
  box-shadow: 0 16px 34px rgba(117, 38, 71, 0.16);
}

.download-card.featured::before {
  height: 5px;
  background: linear-gradient(90deg, #b81f57, #f2b84b);
}

.download-card.featured .download-kicker {
  color: #9c1848;
}

.download-card.featured a {
  background: #b81f57;
  box-shadow: 0 10px 22px rgba(184, 31, 87, 0.22);
}

.download-card.featured a:hover {
  background: #941541;
}

.download-card.archived {
  background: linear-gradient(180deg, #fbfbfc 0%, #f1f4f7 100%);
}

.download-card.third-party {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 253, 0.97)),
    linear-gradient(135deg, #edf2f7, #ffffff);
}

.download-card.third-party::before {
  background: linear-gradient(90deg, #5d6b7a, #9a7b23);
}

.download-card.compact {
  min-height: 190px;
}

.download-kicker {
  color: #0c5f91;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.download-card h3 {
  margin: 8px 0 0;
  color: #132335;
  font-size: 1.08rem;
  line-height: 1.2;
}

.download-card p {
  margin: 10px 0 0;
  color: #4c5b68;
  line-height: 1.45;
}

.download-card .download-credit {
  color: #334251;
  font-size: 0.84rem;
  line-height: 1.4;
}

.download-meta {
  margin-top: 10px;
  color: #5f6f7c;
  font-size: 0.82rem;
  font-weight: 800;
}

.download-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 34px;
  margin-top: auto;
  padding: 8px 12px;
  border-radius: 6px;
  background: #1688c7;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(22, 136, 199, 0.2);
}

.download-card a:hover {
  background: #0c6ea4;
}

.article-body tr.em4resource-release td {
  background: #eef8ff;
  border-color: #96c7e8;
}

.article-body tr.em4resource-release td:first-child {
  box-shadow: inset 4px 0 0 #1688c7;
  font-weight: 800;
}

.article-body tr.em4resource-release td:nth-child(2) {
  color: #0c5f91;
  font-weight: 900;
}

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

.tag {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .shell {
    padding: 16px;
  }

  .topbar,
  .content-header,
  .site-notice {
    display: block;
  }

  .notice-link {
    width: 100%;
    margin-top: 12px;
  }

  .brand {
    display: block;
  }

  .brand-main {
    display: block;
  }

  .site-banner {
    width: min(170px, 100%);
    margin-bottom: 10px;
  }

  .header-meta {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .layout {
    display: block;
  }

  .side-panel {
    position: static;
    margin-bottom: 16px;
  }
}
