:root {
  --bg: #070b10;
  --panel: #101922;
  --panel-strong: #162532;
  --text: #f3f4ed;
  --muted: #b7c7c1;
  --line: rgba(218, 174, 76, 0.24);
  --accent: #26aee9;
  --accent-strong: #76da35;
  --stone: #82939b;
  --realm-blue: #26aee9;
  --realm-green: #76da35;
  --realm-gold: #d9ad4d;
  color-scheme: dark;
}

html { background: var(--bg); }

body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(28, 137, 197, 0.20), transparent 30rem),
    radial-gradient(circle at 82% 4%, rgba(91, 173, 51, 0.13), transparent 28rem),
    linear-gradient(180deg, #0c1721 0, #080d13 42rem, #070b10 100%);
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 60%);
}

.page-shell { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(217, 173, 77, .22);
  padding: 18px 0;
}

.brand, .site-nav, .auth-nav, .cart-nav { display: inline-flex; align-items: center; }
.brand { gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; }
.site-nav { gap: 6px; flex-wrap: wrap; }
.site-nav a { min-height: 38px; padding: 9px 12px; color: var(--muted); font-size: .94rem; text-decoration: none; }
.account-menu { position: relative; display: inline-flex; }
.account-icon-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50% !important; color: var(--text); background: rgba(255,255,255,.045); cursor: pointer; }
.account-icon-button > img, .account-icon-button > span, .account-menu-avatar > img, .account-menu-avatar > span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #566a32; color: #efffcf; font-weight: 900; font-size: 1.15rem; }
.account-chevron { position: absolute; right: -5px; bottom: -3px; width: 17px; height: 17px; padding: 2px; border-radius: 50%; background: #101a22; fill: none; stroke: var(--text); stroke-width: 2; }
.account-menu-panel { position: absolute; top: calc(100% + 7px); right: 0; z-index: 30; display: none; width: min(350px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.account-menu.is-open .account-menu-panel { display: grid; gap: 8px; }
.account-menu-profile { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; padding: 8px 8px 14px; border-bottom: 1px solid var(--line); }
.account-menu-avatar { width: 58px; height: 58px; }
.account-menu-profile strong, .account-menu-profile small { display: block; }
.account-menu-profile small { margin-top: 3px; color: var(--muted); }
.account-menu-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.account-menu-panel a { width: 100%; min-height: 36px; }
.account-menu-panel > [data-plugin-logout] { border-top: 1px solid var(--line); border-radius: 0; margin-top: 2px; }
.cart-nav { position: relative; justify-content: center; width: 42px; height: 42px; min-height: 42px !important; padding: 0 !important; border: 1px solid var(--line) !important; border-radius: 50% !important; }
.cart-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-nav [data-cart-count] { position: absolute; right: -5px; top: -6px; display: grid; place-items: center; min-width: 19px; height: 19px; border-radius: 10px; padding: 0 5px; background: var(--realm-green); color: #071006; font-size: .68rem; font-weight: 950; }

.site-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--realm-blue), var(--realm-gold), var(--realm-green), transparent);
  opacity: .45;
}

.brand { font-family: Georgia, "Times New Roman", serif; font-size: 1.13rem; letter-spacing: .01em; }
.brand-icon { width: 34px; height: 34px; border: 1px solid rgba(217,173,77,.45); box-shadow: 0 0 20px rgba(38,174,233,.2); }

.site-nav a,
.site-nav .account-icon-button,
.cart-nav {
  border-color: transparent;
  border-radius: 7px;
}

.site-nav a:hover,
.site-nav a.is-active,
.site-nav .account-icon-button:hover,
.cart-nav:hover {
  border-color: rgba(38,174,233,.35);
  color: #fff;
  background: linear-gradient(145deg, rgba(38,174,233,.13), rgba(118,218,53,.06));
}

h1, h2, h3, .hero h1, .section-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
}

.eyebrow,
.card-kicker,
.section-kicker,
.account-kicker {
  color: var(--realm-gold) !important;
  letter-spacing: .14em;
}

.hero,
.section,
.plugin-card,
.feature-row,
.release-card,
.download-card,
.account-panel,
.review-card,
.wiki-card,
.cart-panel,
.panel {
  border-color: rgba(217,173,77,.22) !important;
  border-radius: 11px !important;
  background:
    linear-gradient(145deg, rgba(27, 46, 59, .84), rgba(10, 16, 22, .96)) !important;
  box-shadow: 0 20px 55px rgba(0,0,0,.26);
}

.plugin-card,
.feature-row,
.release-card,
.download-card,
.review-card,
.wiki-card {
  position: relative;
  overflow: hidden;
}

.plugin-card::before,
.feature-row::before,
.release-card::before,
.download-card::before,
.review-card::before,
.wiki-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--realm-blue), var(--realm-green));
  box-shadow: 0 0 18px rgba(38,174,233,.5);
}

.button,
button.button,
input[type="submit"] {
  border-radius: 7px !important;
  border-color: rgba(38,174,233,.34) !important;
  background: linear-gradient(135deg, #2fb5ed, #157fbd) !important;
  color: #03121b !important;
  box-shadow: 0 10px 24px rgba(18,128,190,.2);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.button:hover,
button.button:hover,
input[type="submit"]:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(18,128,190,.3); }

.button.secondary,
.button.ghost,
button.button.secondary {
  border-color: rgba(118,218,53,.38) !important;
  background: linear-gradient(145deg, rgba(51,112,48,.7), rgba(13,35,29,.92)) !important;
  color: #effbe8 !important;
}

input,
select,
textarea {
  border-color: rgba(217,173,77,.24) !important;
  border-radius: 7px !important;
  background: rgba(4,9,14,.68) !important;
  color: var(--text) !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(38,174,233,.45);
  outline-offset: 1px;
  border-color: var(--realm-blue) !important;
}

table { border-color: rgba(217,173,77,.24) !important; background: rgba(6,12,17,.55); }
th { color: #f3d58d; background: rgba(217,173,77,.09); }
td, th { border-color: rgba(255,255,255,.09) !important; }

.site-footer { border-color: rgba(217,173,77,.2); }
.account-menu-panel { border-color: rgba(217,173,77,.3); background: rgba(8,14,20,.99); box-shadow: 0 22px 60px rgba(0,0,0,.5); }

.home-hero { display: grid; justify-items: center; text-align: center; }
.plugins-brand-banner {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(217,173,77,.4);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0,0,0,.55), 0 0 40px rgba(38,174,233,.13);
}
.home-hero .lede { max-width: 760px; margin: 1.5rem auto 0; }

.account-workspace {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr) !important;
  gap: 1.25rem;
  align-items: start;
}

.shell.account-workspace,
.shell:has(> .account-workspace),
.account-page-shell {
  width: min(1200px, calc(100% - 32px)) !important;
  max-width: 1200px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.account-page-shell { padding: 3rem 0 4rem; }
.page-header, .account-page-header { margin-bottom: 1.25rem; }
.page-header h1, .account-page-header h1 { margin: .5rem 0 1rem; font-size: clamp(2.3rem, 6vw, 4.5rem); line-height: 1; }
.page-header > p:last-child, .account-page-description { max-width: 780px; margin: 0; color: var(--muted); line-height: 1.6; }

.account-sidebar { width: 245px; min-width: 245px; }

.account-sidebar {
  position: sticky;
  top: 1rem;
  overflow: hidden;
  border: 1px solid rgba(217,173,77,.22);
  border-radius: 11px;
  padding: .75rem;
  background: linear-gradient(155deg, rgba(24,39,52,.96), rgba(9,15,21,.98));
  box-shadow: 0 18px 48px rgba(0,0,0,.3);
}

.account-sidebar-title {
  margin: .35rem .5rem .8rem;
  color: var(--realm-gold);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.account-sidebar nav { display: grid; gap: .2rem; }
.account-sidebar a {
  display: flex;
  align-items: center;
  min-height: 42px;
  border-left: 3px solid transparent;
  border-radius: 5px;
  padding: .65rem .75rem;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}
.account-sidebar a:hover,
.account-sidebar a[aria-current="page"] {
  border-left-color: var(--realm-blue);
  color: #fff;
  background: linear-gradient(90deg, rgba(38,174,233,.16), rgba(118,218,53,.04));
}
.account-sidebar .logout-link { margin-top: .65rem; border-top: 1px solid rgba(217,173,77,.18); }
.account-content { min-width: 0; display: grid; gap: 1rem; }

@media (max-width: 780px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .account-workspace { grid-template-columns: 1fr; }
  .account-sidebar { width: 100%; min-width: 0; }
  .account-sidebar { position: static; }
  .account-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-sidebar .logout-link { margin-top: 0; border-top: 0; }
}

@media (max-width: 520px) {
  .account-sidebar nav { grid-template-columns: 1fr; }
}
