:root {
  --bg: #0a0e0f;
  --surface: #0f1517;
  --panel: #141c1e;
  --border: #1e2d30;
  --accent: #00d4aa;
  --accent2: #ff6b35;
  --accent3: #7c6aff;
  --text: #c8d8da;
  --text-dim: #4a6468;
  --text-bright: #e8f4f6;
  --green: #39d353;
  --yellow: #f0c040;
  --red: #ff5555;
  --cyan: #56d4c8;
  --shadow: 0 4px 40px rgba(0, 0, 0, 0.8);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(0, 212, 170, 0.16), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(255, 107, 53, 0.13), transparent 24%),
    radial-gradient(circle at 78% 78%, rgba(124, 106, 255, 0.12), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 20;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.08) 2px, rgba(0, 0, 0, 0.08) 4px);
}

body::after {
  z-index: 19;
  background: radial-gradient(ellipse at center, transparent 56%, rgba(0, 0, 0, 0.62) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 16px 0 64px;
  position: relative;
  z-index: 1;
}

.terminal-frame,
.terminal-panel,
.post-card,
.topic-dock {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.terminal-frame {
  border-radius: 8px;
  overflow: hidden;
  min-height: calc(100vh - 32px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red {
  background:
    radial-gradient(circle at 35% 30%, #ffd0cb 0 12%, transparent 13%),
    #ff5f56;
  box-shadow: 0 0 0 3px rgba(255, 95, 86, 0.14), 0 0 18px rgba(255, 95, 86, 0.36);
  cursor: pointer;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dot-red::after {
  content: "home";
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  color: var(--red);
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 10px rgba(255, 85, 85, 0.6);
  text-transform: uppercase;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dot-red:hover,
.dot-red:focus-visible {
  box-shadow: 0 0 0 5px rgba(255, 95, 86, 0.18), 0 0 26px rgba(255, 95, 86, 0.62);
  outline: none;
  transform: scale(1.25);
}

.dot-red:hover::after,
.dot-red:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}

.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.tab-title {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.tab-title span {
  color: var(--accent);
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  outline: none;
}

.terminal-content {
  padding: clamp(20px, 4vw, 44px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.hero-grid--solo {
  width: 100%;
}

.hero-copy {
  min-height: clamp(430px, 58vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid var(--border);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(255, 107, 53, 0.07), transparent 34%),
    rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.18), transparent 65%);
  pointer-events: none;
}

.section-kicker,
.terminal-prompt {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.section-kicker {
  margin: 0 0 14px;
  text-transform: uppercase;
}

.terminal-prompt {
  margin: 0 0 16px;
}

.terminal-prompt span,
.command-list span {
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-title {
  margin: 0;
  color: var(--text-bright);
  font-size: clamp(64px, 14vw, 176px);
  line-height: 0.9;
  letter-spacing: -0.08em;
  position: relative;
  z-index: 1;
}

.hero-title span {
  color: var(--accent);
  text-shadow: 0 0 34px rgba(0, 212, 170, 0.5);
}

.hero-copy > p,
.muted {
  color: var(--text-dim);
  line-height: 1.8;
}

.hero-copy > p {
  max-width: 900px;
  margin: 22px 0 0;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.hero-copy > .terminal-prompt,
.hero-copy > .stat-row {
  position: relative;
  z-index: 1;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.stat-card strong {
  display: block;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 0 20px rgba(0, 212, 170, 0.45);
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 12px;
  border-radius: 40px;
  background: var(--panel);
}

.topic-dock__label {
  padding-left: 8px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.topic-pill small {
  color: var(--accent);
}

.topic-pill:hover,
.topic-pill:focus-visible,
.topic-pill.is-active {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 34px 0 16px;
}

.section-head h2 {
  margin: 0;
  color: var(--text-bright);
  font-size: clamp(26px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.section-head .command-link {
  flex: 0 0 auto;
}

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

.post-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  min-height: 282px;
  padding: 18px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  animation: rise 0.5s ease both;
  animation-delay: var(--delay, 0ms);
  transition: border-color 0.2s, transform 0.2s;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.post-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -90px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.13), transparent 66%);
  pointer-events: none;
}

.post-card:hover,
.post-card:focus-visible {
  border-color: rgba(0, 212, 170, 0.34);
  transform: translateY(-4px);
  outline: none;
}

.accent-orange::before { background: var(--accent2); }
.accent-purple::before { background: var(--accent3); }
.accent-green::before { background: var(--green); }
.accent-cyan::before { background: var(--cyan); }

.post-card__top,
.post-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topic-badge,
.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topic-badge {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.18);
}

.status-badge {
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.post-card__body {
  padding: 26px 0 20px;
}

.post-card h2 {
  margin: 0 0 12px;
  color: var(--text-bright);
  font-size: clamp(23px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.post-card p {
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
}

.post-card__bottom {
  margin-top: auto;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-card__bottom strong {
  color: var(--accent);
}

.command-link,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-link,
.secondary-action {
  color: var(--accent);
  border: 1px solid rgba(0, 212, 170, 0.25);
  background: rgba(0, 212, 170, 0.05);
}

.primary-action {
  color: #061313;
  background: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
}

.primary-action.is-disabled {
  color: var(--text-dim);
  background: transparent;
  border-color: var(--border);
}

.terminal-panel {
  border-radius: 6px;
  padding: clamp(22px, 4vw, 38px);
}

.archive-hero {
  min-height: 260px;
}

.detail-panel h1,
.archive-hero h1 {
  margin: 0;
  color: var(--text-bright);
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.detail-lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--text-dim);
  line-height: 1.8;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.detail-meta span,
.detail-meta a {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-meta a {
  color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 28px;
}

.detail-grid section {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.detail-grid h2 {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-grid p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
}

.command-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 240px;
  padding: 28px;
  border: 1px dashed rgba(74, 100, 104, 0.6);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--text-bright);
  font-size: clamp(28px, 5vw, 54px);
  letter-spacing: -0.06em;
}

.empty-state p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.language-switcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(20, 28, 30, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.language-switcher span {
  padding: 0 6px;
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.language-switcher button {
  min-width: 38px;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.language-switcher button:hover,
.language-switcher button:focus-visible,
.language-switcher button.is-active {
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.08);
  color: var(--accent);
  outline: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-column: span 12;
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--max));
    padding-top: 10px;
  }

  .terminal-content {
    padding: 18px;
  }

  .terminal-frame {
    min-height: calc(100vh - 20px);
  }

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

  .stat-row {
    grid-template-columns: 1fr;
  }

  .topic-dock,
  .section-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head .command-link {
    flex: initial;
  }
}
