:root {
  --wie-bg: #050914;
  --wie-bg-2: #0a1222;
  --wie-surface: rgba(15, 21, 35, 0.75);
  --wie-surface-2: rgba(20, 27, 45, 0.82);
  --wie-line: rgba(130, 157, 255, 0.12);
  --wie-line-strong: rgba(130, 157, 255, 0.25);
  --wie-text: #e7ecff;
  --wie-muted: #a4afcf;
  --wie-accent: #7b8dff;
  --wie-accent-2: #27d5ff;
  --wie-danger: #ff5d89;
  --wie-radius: 16px;
  --wie-shadow: 0 18px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  --wie-header-h: 84px;
  --content-max: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--wie-text);
  background:
    radial-gradient(circle at 12% 10%, rgba(38, 95, 255, 0.22), transparent 40%),
    radial-gradient(circle at 86% 16%, rgba(163, 86, 255, 0.18), transparent 38%),
    linear-gradient(180deg, #040811 0%, #060a14 46%, #070b16 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(129, 145, 209, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 145, 209, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.35;
  z-index: -1;
}

a { color: #b7c5ff; text-decoration: none; }
a:hover { color: #d5ddff; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  width: auto;
  height: auto;
  left: 12px;
  top: 12px;
  z-index: 9999;
  background: #111a2d;
  border: 1px solid var(--wie-line-strong);
  padding: 8px 12px;
  border-radius: 10px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(5, 9, 20, 0.85), rgba(5, 9, 20, 0.65));
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}
.header-shell {
  max-width: min(1600px, calc(100vw - 24px));
  margin: 0 auto;
  min-height: var(--wie-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
}
.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.site-branding {
  display: grid;
  gap: 0;
  min-width: 0;
}
.site-logo img,
.custom-logo-link img {
  max-height: 42px;
  width: auto;
  display: block;
}
.site-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
}
.site-title a { color: #ecf1ff; }
.site-description {
  margin: 2px 0 0;
  color: var(--wie-muted);
  font-size: .78rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.mobile-nav-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--wie-line-strong);
  background: linear-gradient(180deg, rgba(30, 38, 62, .95), rgba(18, 24, 41, .95));
  box-shadow: 0 0 0 1px rgba(123, 141, 255, .10) inset, 0 8px 18px rgba(0,0,0,.22);
  display: grid;
  place-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 9px;
}
.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: #cdd8ff;
  transition: transform .2s ease, opacity .2s ease;
}
body.nav-open .mobile-nav-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.nav-open .mobile-nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .mobile-nav-toggle span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.main-navigation { min-width: 0; }
.menu-panel {
  border-radius: 16px;
  background: rgba(18, 24, 40, .72);
  border: 1px solid rgba(255,255,255,.04);
  box-shadow: var(--wie-shadow), 0 0 0 1px rgba(123,141,255,.08);
}
.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#primary-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  flex-wrap: wrap;
}
#primary-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}
#primary-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  color: #dbe5ff;
  border-radius: 11px;
  font-weight: 600;
  font-size: .93rem;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
#primary-menu > li > a:hover,
#primary-menu > li.current-menu-item > a,
#primary-menu > li.current-menu-ancestor > a {
  background: linear-gradient(180deg, rgba(123,141,255,.24), rgba(39,213,255,.16));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(123,141,255,.25) inset;
}

.submenu-toggle {
  margin-left: -4px;
  margin-right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #cdd8ff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.submenu-toggle:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(123,141,255,.12);
}
.menu-item-has-children .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  display: none;
  padding: 8px;
  border-radius: 14px;
  background: rgba(10, 16, 28, .97);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(123,141,255,.08);
}
.menu-item-has-children.submenu-open > .sub-menu { display: block; }
.menu-item-has-children .sub-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #deebff;
  font-size: .9rem;
}
.menu-item-has-children .sub-menu a:hover {
  background: rgba(123,141,255,.14);
}
.menu-item-has-children .sub-menu .menu-item-has-children {
  position: relative;
}
.menu-item-has-children .sub-menu .sub-menu {
  left: calc(100% + 8px);
  top: -8px;
}

/* Layout */
.content-shell {
  width: min(var(--content-max), calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}
.site-main { min-height: calc(100vh - var(--wie-header-h) - 120px); }
.post-list {
  display: grid;
  gap: 16px;
}
.post-card,
.archive-header,
.comments-area,
.hero-card {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 23, 38, .88), rgba(10, 15, 26, .88));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: var(--wie-shadow);
  padding: 18px;
}
.entry-header { margin-bottom: 10px; }
.entry-title {
  margin: 0;
  font-size: clamp(1.15rem, 1.5vw, 1.7rem);
  line-height: 1.2;
  color: #eef3ff;
}
.entry-title a { color: inherit; }
.entry-title a:hover { color: #fff; }
.entry-meta {
  color: var(--wie-muted);
  font-size: .85rem;
  margin-top: 6px;
}
.entry-content { color: #d9e4ff; }
.entry-content p:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: #eef4ff; }
.entry-content code {
  background: rgba(123,141,255,.12);
  border: 1px solid rgba(123,141,255,.18);
  padding: 2px 6px;
  border-radius: 6px;
}
.entry-content pre {
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: #090f1c;
  border: 1px solid rgba(255,255,255,.06);
}
blockquote {
  margin: 1rem 0;
  padding: 12px 14px;
  border-left: 3px solid var(--wie-accent);
  background: rgba(123,141,255,.08);
  border-radius: 0 12px 12px 0;
}

.pagination-wrap {
  margin-top: 16px;
}
.pagination-wrap .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-numbers {
  border: 1px solid var(--wie-line-strong);
  color: #dbe5ff;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(17, 24, 40, .7);
}
.page-numbers.current { background: rgba(123,141,255,.22); }

/* Buttons + forms */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: rgba(12, 18, 31, .9);
  border: 1px solid rgba(255,255,255,.07);
  color: #eef3ff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 0 0 1px rgba(123,141,255,.05) inset;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(123,141,255,.4);
  box-shadow: 0 0 0 3px rgba(123,141,255,.12);
}
button,
input[type="submit"],
.wp-block-button__link,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(123,141,255,.22);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(29,38,62,.95), rgba(17,24,40,.95));
  color: #e9efff;
  box-shadow: 0 8px 20px rgba(0,0,0,.18), 0 0 0 1px rgba(123,141,255,.08) inset;
  text-decoration: none;
}
button:hover,
input[type="submit"]:hover,
.btn:hover {
  border-color: rgba(123,141,255,.4);
  transform: translateY(-1px);
}
.btn-primary,
input[type="submit"] {
  background: linear-gradient(135deg, rgba(123,141,255,.95), rgba(39,213,255,.85));
  color: #081122;
  font-weight: 700;
}

/* Hero */
.hero-card {
  padding: 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(39,213,255,.12), transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(163,86,255,.14), transparent 35%),
    linear-gradient(180deg, rgba(16, 23, 38, .92), rgba(9, 13, 23, .92));
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}
.hero-copy p { color: #c4d0ef; }
.eyebrow {
  margin: 0 0 6px;
  color: #b6c1e6;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-actions { margin-top: 14px; }

/* Footer */
.site-footer {
  margin-top: 18px;
  padding: 0 12px 18px;
}
.footer-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 20, 34, .9), rgba(9, 13, 24, .92));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: var(--wie-shadow);
  overflow: hidden;
}
.footer-top {
  padding: 20px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.footer-brand-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.footer-brand-desc {
  margin: 6px 0 0;
  color: var(--wie-muted);
  font-size: .9rem;
}
.footer-navigation ul,
.footer-navigation .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.footer-navigation a {
  display: inline-flex;
  padding: 6px 0;
  color: #d7e1ff;
}
.footer-widgets .widget {
  margin: 0;
}
.footer-widgets .widget-title {
  margin: 0 0 8px;
  font-size: 1rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.04);
  padding: 12px 20px;
  color: var(--wie-muted);
  font-size: .85rem;
}
.footer-bottom p { margin: 0; }

/* WP content defaults */
.alignwide,
.alignfull {
  max-width: none;
}
.wp-caption,
.gallery-caption { color: var(--wie-muted); }
.sticky { outline: 1px solid rgba(123,141,255,.18); }
.bypostauthor { }

/* Editor plugin integration */
body.has-wie-editor .content-shell {
  width: min(1600px, calc(100vw - 12px));
  max-width: none;
  padding-top: 10px;
}
body.has-wie-editor .page-card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.has-wie-editor .page-card > .entry-header {
  display: none;
}
body.has-wie-editor .page-card > .entry-content {
  margin: 0;
}
body.has-wie-editor .page-card > .entry-content > *:not(.wie-wrap):not(.wie-image-editor-wrap):not([class*="wie"]) {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 12px;
  padding-right: 12px;
}
/* Keep plugin containers unrestricted */
body.has-wie-editor .entry-content [class*="wie"] {
  max-width: none;
}

.editor-page-focus {
  width: min(1600px, calc(100vw - 12px));
  max-width: none;
  margin: 0 auto;
  padding: 8px 0 16px;
  min-height: calc(100vh - var(--wie-header-h) - 36px);
}
.editor-page-article,
.editor-page-content {
  margin: 0;
  padding: 0;
}

/* Comments */
.comments-area ol,
.comments-area ul { padding-left: 1.2rem; }
.comment-list .comment {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.comment-metadata,
.comment-meta { color: var(--wie-muted); font-size: .85rem; }

/* Mobile */
@media (max-width: 960px) {
  :root { --wie-header-h: 74px; }

  .site-description { display: none; }
  .header-shell {
    gap: 10px;
    padding: 10px 10px;
  }
  .menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 10px;
    left: 10px;
    display: none;
    background: rgba(8, 12, 22, .96);
    box-shadow: 0 20px 40px rgba(0,0,0,.42), 0 0 0 1px rgba(123,141,255,.12);
  }
  body.nav-open .menu-panel { display: block; }
  #primary-menu {
    display: grid;
    gap: 4px;
    padding: 8px;
  }
  #primary-menu > li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-radius: 12px;
  }
  #primary-menu > li > a {
    min-height: 42px;
    padding: 0 12px;
  }
  .submenu-toggle {
    width: 34px;
    height: 34px;
    margin: 0 4px 0 0;
    border: 1px solid rgba(255,255,255,.05);
    background: rgba(255,255,255,.02);
  }
  .menu-item-has-children .sub-menu {
    position: static;
    min-width: 0;
    margin: 2px 6px 6px;
    background: rgba(13, 20, 35, .85);
    border-radius: 12px;
    box-shadow: none;
  }
  .menu-item-has-children .sub-menu .sub-menu {
    left: 0;
    top: 0;
    margin-left: 10px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .content-shell {
    width: calc(100vw - 14px);
    padding-top: 12px;
  }
}

@media (min-width: 961px) {
  .mobile-nav-toggle { display: none; }
}

@media (max-width: 640px) {
  .post-card, .archive-header, .comments-area, .hero-card { padding: 14px; border-radius: 14px; }
  .site-footer { padding: 0 8px 12px; }
  .footer-top { padding: 14px; }
  .footer-bottom { padding: 10px 14px; }
}
