/* ===== Variables ===== */
:root {
  --bg: #0c1420;
  --bg-2: #101b2b;
  --panel: #142235;
  --panel-2: #18283d;
  --text: #dbe5f2;
  --text-soft: #a8b4c7;
  --blue: #67a8ff;
  --blue-2: #9cc4ff;
  --blue-3: #3d6da1;
  --yellow: #f4b728;
  --yellow-soft: rgba(244, 183, 40, 0.16);
  --border: #27415f;
  --border-soft: #1d3149;
  --shadow: rgba(0, 0, 0, 0.38);
  --font-heading: "Roboto Slab", Georgia, serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; }

body {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  background:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px),
    radial-gradient(circle at top, rgba(103,168,255,0.07), transparent 34%),
    linear-gradient(to bottom, #0d1624, #0a1220 70%);
  background-size: 100% 4px, 28px 100%, 100% 100%, 100% 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Yellow accent line at very top */
body::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(244, 183, 40, 0.22);
}

/* ===== Links ===== */
a { color: inherit; }

/* ===== Shell ===== */
.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 20px 42px;
}

/* ===== Shared panel style ===== */
.topbar,
.masthead,
.content,
.control,
.footer {
  background: linear-gradient(to bottom, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(103,168,255,0.07) inset,
    6px 6px 0 var(--shadow);
}

/* ===== Topbar ===== */
.topbar {
  margin-bottom: 22px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.brand a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand::before {
  content: "[";
  color: var(--yellow);
  margin-right: 0.18rem;
}
.brand::after {
  content: "]";
  color: var(--yellow);
  margin-left: 0.18rem;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nav a {
  text-decoration: none;
  color: var(--blue);
  padding: 5px 8px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}
.nav a:hover,
.nav a.active {
  background: var(--yellow-soft);
  border-color: var(--blue);
  color: var(--yellow);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(244,183,40,0.08) inset;
}

/* ===== Masthead ===== */
.masthead {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 22px;
  margin-bottom: 22px;
}
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255,255,255,0.03) 35%,
    transparent 58%
  );
  pointer-events: none;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.eyebrow::before {
  content: "// ";
  color: var(--yellow);
}
.site-title {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(3rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--blue-2);
  text-wrap: balance;
}
.site-title .other {
  color: var(--yellow);
  position: relative;
}
.site-title .other::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0.08em;
  height: 0.18em;
  background: rgba(244, 183, 40, 0.18);
  z-index: -1;
}
.tagline {
  margin: 0;
  max-width: 48rem;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--text-soft);
  line-height: 1.65;
}

/* ===== Content panel ===== */
.content {
  padding: 20px 20px 10px;
  margin-bottom: 22px;
}

/* ===== Page header (non-index) ===== */
.page-header {
  margin-bottom: 20px;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--blue-2);
}

/* ===== Section title ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-2);
}
.section-title::before {
  content: ">";
  color: var(--yellow);
  font-weight: 700;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--blue-3), transparent);
}

/* ===== Featured article ===== */
.featured {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 18px 16px;
  background:
    linear-gradient(90deg, rgba(244,183,40,0.08), transparent 44%),
    linear-gradient(to bottom, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border: 1px solid #35567d;
  box-shadow: 0 0 0 1px rgba(103,168,255,0.05) inset;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}
.featured:hover {
  transform: translateX(4px);
  border-color: var(--blue);
  box-shadow:
    0 0 0 1px rgba(103,168,255,0.08) inset,
    0 0 20px rgba(103,168,255,0.05);
}
.featured-meta {
  font-family: var(--font-mono);
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.featured-meta .type {
  color: var(--blue);
  font-weight: 700;
}
.featured h2 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--blue-2);
}
.featured h2 a,
.post h3 a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--yellow-soft), var(--yellow-soft));
  background-repeat: no-repeat;
  background-size: 0% 0.38em;
  background-position: 0 88%;
  transition:
    background-size 180ms ease,
    color 180ms ease,
    text-shadow 180ms ease;
}
.featured h2 a:hover,
.post h3 a:hover {
  background-size: 100% 0.38em;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(103,168,255,0.18);
}
.featured p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
  opacity: 0.95;
  line-height: 1.6;
}

/* ===== Post list ===== */
.post {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-top: 1px dashed var(--border-soft);
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}
.post:hover {
  background: rgba(103,168,255,0.035);
  transform: translateX(4px);
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.6;
  padding-top: 4px;
}
.meta .type {
  display: inline-block;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 0.28rem;
}

.post h3 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--blue-2);
}
.post p {
  margin: 0;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.6;
}

/* ===== Control panel ===== */
.control {
  padding: 16px 18px;
  margin-bottom: 22px;
}
.control-title {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--blue-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.control-title::before {
  content: "> ";
  color: var(--yellow);
}
.control p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 0.95rem;
}
.control strong {
  color: var(--text);
}

/* ===== Article reading page ===== */
.article-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-soft);
}
.article-header .meta {
  margin-bottom: 8px;
}
.article-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--blue-2);
}

.article-content {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.78;
}
.article-content p {
  margin: 0 0 1.4rem;
  color: var(--text);
}
.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
  color: var(--blue-2);
}
.article-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2rem 0 0.5rem;
  color: var(--blue-2);
}

/* Code */
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.4em;
  border: 1px solid var(--border);
}
.article-content pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-3);
  padding: 1rem 1.25rem;
  overflow-x: auto;
}
.article-content pre code {
  background: none;
  border: none;
  padding: 0;
}
.article-content blockquote {
  border-left: 3px solid var(--yellow);
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  color: var(--text-soft);
  font-style: italic;
}
.article-content img {
  max-width: 100%;
  border: 1px solid var(--border);
}
.article-content ul, .article-content ol {
  padding-left: 1.25rem;
}
.article-content li {
  margin-bottom: 0.35rem;
}
.article-content a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,183,40,0.3);
  transition: color 140ms ease, border-color 140ms ease;
}
.article-content a:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 20px 0 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-soft);
}
.pagination a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,183,40,0.3);
  transition: color 140ms ease, border-color 140ms ease;
}
.pagination a:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* ===== Footer ===== */
.footer {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.footer a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,183,40,0.3);
  transition: color 140ms ease, border-color 140ms ease;
}
.footer a:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* ===== Mobile ===== */
@media (max-width: 720px) {
  .shell { padding: 12px 14px 32px; }
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .masthead { padding: 20px 18px; }
  .site-title { font-size: 2.8rem; }
  .content { padding: 16px; }
  .featured h2 { font-size: 1.6rem; }
  .post {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .meta {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding-top: 0;
  }
  .meta .type {
    display: inline;
    margin-bottom: 0;
  }
  .post h3 { font-size: 1.4rem; }
}
