:root {
  --bg: #f4f7fb;
  --bg-elev: rgba(255, 255, 255, 0.88);
  --bg-strong: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.18);
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.14);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --container: min(1180px, calc(100vw - 32px));
  --code-bg: #0f172a;
}

body[data-theme="dark"] {
  --bg: #07111f;
  --bg-elev: rgba(10, 18, 32, 0.86);
  --bg-strong: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.26);
  --accent: #60a5fa;
  --accent-2: #a78bfa;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --success-soft: rgba(52, 211, 153, 0.15);
  --warning-soft: rgba(251, 191, 36, 0.16);
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
  --code-bg: #020817;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

img { max-width: 100%; }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

p { margin: 0 0 1rem; color: var(--muted); }

h1, h2, h3, h4 {
  margin: 0 0 0.8rem;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.4rem); }
h3 { font-size: 1.12rem; }

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  background: var(--accent-soft);
  padding: 0.14rem 0.38rem;
  border-radius: 8px;
  color: var(--text);
}

pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  background: var(--code-bg);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-strong);
  box-shadow: inset 0 -2px 0 rgba(15, 23, 42, 0.06);
  font-size: 0.95rem;
  color: var(--text);
}

ul, ol {
  padding-left: 1.25rem;
  margin: 0 0 1.1rem;
}

li { margin-bottom: 0.6rem; color: var(--muted); }

.container { width: var(--container); margin: 0 auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 0.8rem 1rem;
  background: var(--bg-strong);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.section { padding: 4.5rem 0; }
.section.muted { background: rgba(255, 255, 255, 0.34); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
body[data-theme="dark"] .section.muted { background: rgba(15, 23, 42, 0.42); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(244, 247, 251, 0.74);
  border-bottom: 1px solid var(--line);
}

body[data-theme="dark"] .site-header {
  background: rgba(7, 17, 31, 0.78);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 1.05rem;
  color: var(--text);
}

.brand-text small {
  font-size: 0.86rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.site-nav a:not(.button),
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 0.7rem;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
}

.site-nav a:not(.button):hover,
.theme-toggle:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
}

.menu-toggle span:not(.visually-hidden) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  border-radius: 999px;
}

.theme-toggle,
.button {
  border: none;
  cursor: pointer;
  font: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.button:hover { text-decoration: none; filter: brightness(1.03); }

.button.subtle {
  background: var(--bg-strong);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.subtle:hover {
  background: var(--accent-soft);
}

.hero {
  padding: 5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.hero-text {
  font-size: 1.08rem;
  max-width: 64ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.7rem 0 1.9rem;
}

.hero-panel {
  position: relative;
  min-height: 420px;
}

.panel-glow {
  position: absolute;
  inset: 12% 8%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 55%);
  filter: blur(28px);
}

.hero-window {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: var(--shadow);
  border-radius: 24px;
  overflow: hidden;
}

body[data-theme="dark"] .hero-window {
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(8,47,73,0.78));
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.hero-window-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.hero-window-bar span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
}

.hero-window-body {
  padding: 1.35rem;
}

.hero-window-body p:last-child { margin-bottom: 0; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.tile-grid span {
  display: grid;
  place-items: center;
  min-height: 82px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(124, 58, 237, 0.14)),
    var(--bg-strong);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.stats-grid,
.mini-feature-grid,
.start-grid,
.deploy-grid,
.posts-grid,
.related-grid,
.footer-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.7rem;
}

.stat-card,
.mini-feature,
.start-card,
.deploy-card,
.post-card,
.related-card,
.meta-card,
.toc-card,
.code-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-card strong {
  font-size: 1.8rem;
  color: var(--text);
}

.stat-card span {
  color: var(--muted);
}

.mini-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-feature {
  padding: 1.2rem;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  align-items: start;
}

.mini-feature-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  font-size: 1.5rem;
}

.mini-feature h3 {
  margin-bottom: 0.35rem;
}

.mini-feature p {
  margin-bottom: 0.4rem;
}

.mini-feature span {
  color: var(--accent);
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}

.visible-counter {
  min-width: fit-content;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--muted);
  font-weight: 600;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.filter-button {
  min-height: 46px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.filter-button.is-active,
.filter-button:hover {
  background: var(--accent-soft);
  border-color: transparent;
}

.search-box {
  display: block;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--text);
  font: inherit;
}

.search-box input::placeholder {
  color: var(--muted);
}

.posts-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card,
.start-card,
.related-card {
  padding: 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover,
.start-card:hover,
.related-card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  text-decoration: none;
}

.post-card-top,
.post-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.post-card h3 {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  min-height: 3.1rem;
}

.post-card h3 a,
.start-card h3,
.related-card h3 {
  color: var(--text);
  text-decoration: none;
}

.post-card p,
.start-card p,
.related-card p {
  margin-bottom: 1rem;
}

.post-card-bottom {
  margin-top: 1rem;
}

.meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.tag {
  background: var(--accent-soft);
  color: var(--text);
}

.badge {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--bg-strong);
}

.category-windows { background: rgba(59, 130, 246, 0.12); }
.category-lifehack { background: rgba(16, 185, 129, 0.14); }
.category-software { background: rgba(168, 85, 247, 0.14); }

.empty-state {
  margin-top: 1rem;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  text-align: center;
  background: var(--bg-strong);
}

.start-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.start-card,
.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.deploy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.deploy-card {
  padding: 1.25rem;
}

.code-panel {
  padding: 1rem;
}

.faq-list {
  display: grid;
  gap: 0.8rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-strong);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-answer {
  padding: 0 1.1rem 1rem;
}

.site-footer {
  padding: 2.2rem 0 3rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  align-items: start;
}

.footer-title {
  color: var(--text);
  font-weight: 700;
}

.site-footer a {
  display: block;
  margin-bottom: 0.55rem;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.3rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.crumb a { color: var(--muted); }

.crumb-sep { color: var(--muted); }

.article-page {
  padding: 0 0 4.5rem;
}

.article-hero {
  padding: 1rem 0 1.4rem;
}

.article-hero-main {
  max-width: 78ch;
}

.article-deck {
  font-size: 1.08rem;
}

.article-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.article-meta-inline span {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.3rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.3rem;
  align-items: start;
}

.article-main {
  display: grid;
  gap: 1rem;
}

.article-summary,
.article-section {
  padding: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.article-section h2,
.article-summary h2,
.related-block h2,
.faq-block h2 {
  margin-bottom: 1rem;
}

.article-aside {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 96px;
}

.meta-card,
.toc-card {
  padding: 1.1rem;
}

.aside-title,
.callout-title {
  margin: 0 0 0.8rem;
  color: var(--text);
  font-weight: 800;
}

.meta-list {
  display: grid;
  gap: 0.8rem;
  margin: 0 0 1rem;
}

.meta-list div {
  display: grid;
  gap: 0.2rem;
}

.meta-list dt {
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li + li {
  margin-top: 0.6rem;
}

.toc-list a {
  color: var(--muted);
  font-weight: 600;
}

.summary-list li {
  color: var(--text);
}

.callout {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  margin: 1rem 0 1.1rem;
  border: 1px solid var(--line);
  background: var(--accent-soft);
}

.callout.tip { background: var(--accent-soft); }
.callout.warn { background: var(--warning-soft); }
.callout.note { background: var(--success-soft); }

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.15rem;
}

.shortcut-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
}

.shortcut-item span {
  color: var(--muted);
}

.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-faq {
  grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
  .hero-grid,
  .article-layout,
  .footer-grid,
  .filter-bar,
  .stats-grid,
  .start-grid,
  .deploy-grid,
  .mini-feature-grid,
  .posts-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
    order: -1;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    left: 16px;
    display: none;
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-strong);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open { display: flex; }

  .menu-toggle { display: inline-flex; justify-content: center; align-items: center; }

  .site-nav a:not(.button), .theme-toggle {
    justify-content: flex-start;
    padding-inline: 0.85rem;
  }

  .hero-panel { min-height: auto; }
}

@media (max-width: 720px) {
  .section { padding: 3.5rem 0; }
  .hero { padding-top: 3.8rem; }
  .header-inner { min-height: 72px; }
  .brand-text small { display: none; }
  .post-card,
  .start-card,
  .related-card,
  .article-summary,
  .article-section,
  .stat-card,
  .mini-feature,
  .deploy-card {
    padding: 1.05rem;
  }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .article-meta-inline { gap: 0.5rem; }
}

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