:root {
  --bg-deep: #111d33;
  --bg-mid: #1d3156;
  --bg-side: #17243a;
  --bg-side-soft: #222c43;
  --shell-border: rgba(228, 236, 255, 0.22);
  --panel-bg: rgba(251, 253, 255, 0.97);
  --panel-bg-soft: rgba(244, 248, 255, 0.95);
  --text: #1a2438;
  --muted: #55617a;
  --ink-light: #dce5fb;
  --accent: #4f6ea8;
  --accent-strong: #38548a;
  --line: #d9e1f0;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-shell: 0 28px 65px rgba(6, 13, 24, 0.42);
  --shadow-panel: 0 20px 36px rgba(19, 33, 63, 0.16);
  --glass-nav-bg: rgba(14, 24, 40, 0.28);
  --glass-nav-bg-scrolled: rgba(14, 24, 40, 0.62);
  --glass-nav-border: rgba(202, 216, 248, 0.26);
  --motion-standard: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --motion-exit: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(165deg, var(--bg-mid), var(--bg-deep) 68%);
  color: var(--text);
  font-family: "Manrope", "Noto Sans SC", "Segoe UI", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -24px;
  background: url("background.jpg") center / cover no-repeat;
  filter: blur(12px) brightness(0.68) saturate(1.06) contrast(1.05);
  transform: scale(1.06);
  pointer-events: none;
  z-index: -5;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 8%, rgba(173, 197, 249, 0.34), transparent 48%),
    radial-gradient(circle at 78% 0%, rgba(133, 159, 219, 0.28), transparent 42%),
    linear-gradient(180deg, rgba(8, 14, 27, 0.2), rgba(8, 14, 27, 0.48));
  pointer-events: none;
  z-index: -4;
}

.starfield {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.28;
  pointer-events: none;
  z-index: -2;
}

.starfield-a {
  top: 5%;
  left: -90px;
  background: #84a3de;
}

.starfield-b {
  right: -110px;
  top: 56%;
  background: #4f6ea8;
}

.site-shell {
  width: min(1140px, 92vw);
  margin: clamp(20px, 4vw, 40px) auto;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--shell-border);
  box-shadow: var(--shadow-shell);
  background: rgba(14, 22, 36, 0.68);
  backdrop-filter: blur(12px) saturate(120%);
  transition: transform 0.35s var(--motion-standard), box-shadow 0.35s var(--motion-standard);
  animation: shell-enter 0.65s ease both;
}

.site-aside {
  padding: 28px 24px;
  background:
    linear-gradient(180deg, rgba(31, 45, 70, 0.78), rgba(18, 28, 44, 0.9)),
    var(--bg-side);
  color: var(--ink-light);
  border-right: 1px solid rgba(229, 236, 252, 0.14);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.avatar-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(228, 236, 255, 0.78);
  padding: 3px;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  object-position: 50% 35%;
}

.avatar-ring:hover,
.avatar-ring:focus-visible {
  transform: translateY(-2px);
  border-color: #f6f8ff;
}

.aside-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.72;
}

.aside-title {
  margin: 0;
  font-size: 1.65rem;
  font-family: "Noto Serif SC", serif;
  line-height: 1.2;
}

.aside-title a {
  color: inherit;
  text-decoration: none;
}

.aside-desc {
  margin: 0;
  color: rgba(220, 229, 251, 0.82);
  font-size: 0.95rem;
}

.aside-nav {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.aside-nav a {
  color: rgba(220, 229, 251, 0.9);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
  transition:
    transform 0.22s var(--motion-standard),
    background-color 0.22s var(--motion-standard),
    border-color 0.22s var(--motion-standard);
  position: relative;
}

.aside-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16%;
  width: 3px;
  height: 68%;
  border-radius: 99px;
  background: linear-gradient(180deg, #c7d8ff, #7f9fe1);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.22s var(--motion-standard);
}

.aside-nav a:hover,
.aside-nav a:focus-visible,
.aside-nav a[aria-current="page"] {
  background: rgba(149, 172, 223, 0.19);
  border-color: rgba(208, 220, 250, 0.38);
  transform: translateX(3px);
}

.aside-nav a:hover::before,
.aside-nav a:focus-visible::before,
.aside-nav a[aria-current="page"]::before {
  transform: scaleY(1);
}

.aside-links {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aside-links a {
  text-decoration: none;
  color: #e8eeff;
  font-size: 0.84rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.aside-links a:hover,
.aside-links a:focus-visible {
  background: rgba(255, 255, 255, 0.17);
}

.content-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(160deg, rgba(224, 232, 249, 0.14), rgba(255, 255, 255, 0.06));
  padding: clamp(16px, 3.2vw, 28px);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-nav-border);
  background: var(--glass-nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(7, 16, 31, 0.18);
  transition:
    background-color 0.3s var(--motion-standard),
    box-shadow 0.3s var(--motion-standard),
    border-color 0.3s var(--motion-standard),
    backdrop-filter 0.3s var(--motion-standard);
  position: sticky;
  top: 10px;
  z-index: 8;
}

body.is-scrolled .top-bar {
  background: var(--glass-nav-bg-scrolled);
  border-color: rgba(226, 236, 255, 0.32);
  box-shadow: 0 12px 24px rgba(6, 14, 30, 0.28);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.crumb {
  margin: 0;
  color: rgba(230, 238, 255, 0.92);
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

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

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(251, 253, 255, 0.9);
  box-shadow: var(--shadow-panel);
  padding: clamp(18px, 3.5vw, 32px);
  transition:
    transform 0.32s var(--motion-standard),
    box-shadow 0.32s var(--motion-standard),
    border-color 0.32s var(--motion-standard),
    background-color 0.32s var(--motion-standard);
}

.panel:hover {
  border-color: #c7d5ef;
  box-shadow: 0 26px 42px rgba(23, 43, 80, 0.2);
  transform: translateY(-3px);
}

.hero {
  background:
    linear-gradient(130deg, rgba(220, 232, 255, 0.84), rgba(251, 253, 255, 0.95) 55%),
    var(--panel-bg);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  top: -145px;
  right: -125px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(130, 163, 236, 0.3) 0%, rgba(130, 163, 236, 0) 72%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 0.01em;
  color: #1a2335;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  margin-bottom: 10px;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0;
}

.hero-text {
  margin-top: 14px;
  max-width: 680px;
  color: var(--muted);
}

.tag-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  color: #42587f;
  background: #e5edff;
  border: 1px solid #ccdaf9;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(56, 84, 138, 0.22);
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #f6f8ff;
}

.btn-ghost {
  color: #e7edff;
  border-color: rgba(207, 220, 250, 0.58);
  background: rgba(207, 220, 250, 0.08);
}

.top-bar .btn-ghost {
  color: #e7edff;
  border-color: rgba(207, 220, 250, 0.58);
  background: rgba(207, 220, 250, 0.08);
}

.hero .btn-ghost {
  color: var(--accent-strong);
  border-color: #bfd0ef;
  background: #ebf1ff;
}

.hero .btn-ghost:hover,
.hero .btn-ghost:focus-visible {
  box-shadow: 0 10px 18px rgba(56, 84, 138, 0.16);
}

.btn-small {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.inline-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration: underline;
}

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

.card {
  border: 1px solid #d6e0f2;
  border-radius: var(--radius-md);
  padding: 18px;
  background: rgba(246, 250, 255, 0.86);
  transition:
    transform 0.25s var(--motion-standard),
    box-shadow 0.25s var(--motion-standard),
    border-color 0.25s var(--motion-standard),
    background-color 0.25s var(--motion-standard);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -35%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 181, 244, 0.22) 0%, rgba(150, 181, 244, 0) 72%);
  opacity: 0;
  transition: opacity 0.25s var(--motion-standard);
  pointer-events: none;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: #bdd1f3;
  box-shadow: 0 20px 30px rgba(35, 52, 88, 0.2);
  background: rgba(249, 252, 255, 0.95);
}

.card:hover::before,
.card:focus-within::before {
  opacity: 1;
}

.card-meta {
  color: #73819d;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover,
.card h3 a:focus-visible {
  color: var(--accent-strong);
}

.panel p + p,
.panel p + .tag-row,
.panel p + .contact-list,
.card h3 + p,
.card p + p,
.article-body h2,
.article-body ul,
.article-body p + ul,
.article-body ul + p {
  margin-top: 10px;
}

.contact-list,
.bullet-list {
  margin: 0;
  padding-left: 18px;
}

.contact-list li,
.bullet-list li {
  color: var(--text);
}

.contact-list li + li,
.bullet-list li + li {
  margin-top: 6px;
}

.contact-list a {
  color: var(--accent-strong);
  text-decoration: none;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  text-decoration: underline;
}

.article-body {
  color: var(--text);
}

.article-body h2 {
  margin-bottom: 0;
}

.article-body p {
  color: #263148;
}

.site-footer {
  margin-top: 14px;
  padding: 8px 4px 4px;
  color: rgba(228, 236, 255, 0.8);
  font-size: 0.88rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px) translateX(8px);
  transition:
    opacity 360ms var(--motion-standard) var(--reveal-delay, 0ms),
    transform 360ms var(--motion-standard) var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes shell-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .site-aside {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
  }

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

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(96vw, 1140px);
    border-radius: 20px;
  }

  .site-aside {
    padding: 20px 16px;
  }

  .aside-nav {
    grid-template-columns: 1fr;
  }

  .content-pane {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

  .top-bar {
    padding: 8px 10px;
    top: 6px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
