/* Professional presentation and accessibility layer for the knowledge hub. */
:root {
  color-scheme: light;
  --shadow-sm: 0 10px 30px rgba(16, 32, 25, .08);
  --shadow-lg: 0 28px 70px rgba(16, 32, 25, .14);
}

body {
  min-width: 320px;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  right: 12px;
  padding: 10px 16px;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.top {
  position: sticky;
  z-index: 50;
  top: 0;
  background: rgba(16, 32, 25, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}

.brand-accent { color: var(--cyan); }
.brand .mark { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }

.links a {
  position: relative;
  padding: 29px 0 25px;
}

.links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 20px;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .2s ease;
}

.links a:hover::after,
.links .active::after { transform: scaleX(1); }

.home {
  transition: background-color .2s ease, border-color .2s ease;
}

.home:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }

.hero {
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 20%, rgba(168, 212, 0, .13), transparent 28rem),
    linear-gradient(135deg, #102019 0%, #173326 100%);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .05;
  background-image:
    linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to left, #000, transparent 80%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 40px;
  align-items: center;
}

.hero-inner .searchbox { grid-column: 1 / -1; }

.hero-stat {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 23px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
}

.hero-stat strong {
  color: var(--amber);
  font-size: 3.6rem;
  line-height: 1;
}

.hero-stat span { color: #dbe6df; font-size: .75rem; line-height: 1.7; }

.searchbox {
  padding: 9px;
  border: 1px solid transparent;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.searchbox:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .25), 0 0 0 4px rgba(168, 212, 0, .15);
}

.filters { border-bottom: 1px solid var(--line); }

.filter {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.filter:hover { transform: translateY(-2px); }

.grid { gap: 24px; }

.card {
  border-radius: 20px;
  min-height: 390px;
  box-shadow: 0 3px 0 rgba(16, 32, 25, .025);
}

.card:focus-visible {
  outline-color: var(--cyan);
  transform: translateY(-4px);
}

.card-media { height: auto; aspect-ratio: 16 / 9; }
.card-body { padding: 27px; }
.card h2 { font-size: 1.12rem; }
.card p { line-height: 1.9; }
.read::after { content: " ←"; }

.empty[hidden] { display: none; }
.empty:not([hidden]) { display: block; }

.article-head {
  background:
    radial-gradient(circle at 15% 10%, rgba(168, 212, 0, .12), transparent 34rem),
    linear-gradient(135deg, #102019, #173326);
}

.article-content { min-width: 0; }
.detail-media { aspect-ratio: 16 / 9; }
.detail-media img { height: 100%; max-height: none; }

.prose {
  max-width: 760px;
  font-size: 1.03rem;
  line-height: 2.05;
}

.prose h2 {
  padding-top: 4px;
  line-height: 1.5;
}

.prose a { color: #217322; text-decoration: underline; text-underline-offset: 3px; }

.sidebar {
  top: 110px;
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.source { transition: transform .2s ease, background-color .2s ease; }
.source:hover { transform: translateY(-2px); background: #24583e; }

.visual-fill-88 { width: 88%; }
.visual-fill-72 { width: 72%; }
.visual-fill-64 { width: 64%; }
.visual-fill-52 { width: 52%; }

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 30px;
  background: linear-gradient(145deg, #102019, #173326);
  color: #fff;
  text-align: center;
}

.error-card { max-width: 620px; }
.error-code { color: var(--amber); font-size: clamp(5rem, 18vw, 10rem); font-weight: 800; line-height: 1; }
.error-card h1 { margin: 18px 0 8px; font-size: clamp(1.8rem, 5vw, 3rem); }
.error-card p { color: #b9c9c0; }
.error-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.error-actions a { padding: 11px 18px; border-radius: 9px; background: var(--cyan); color: var(--ink); font-weight: 700; }
.error-actions a + a { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stat { display: none; }
  .hero-inner .searchbox { grid-column: auto; }
  .sidebar { top: auto; }
}

@media (max-width: 580px) {
  .brand > span:last-child { font-size: .84rem; }
  .hero h1 { font-size: 2.15rem; }
  .card-body { padding: 22px; }
  .article-head { padding: 45px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
