:root {
  --bg-color: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #eef1f5;
  --border-color: #dde2ea;
  --text-main: #1a202c;
  --text-muted: #5a6478;
  --accent: #1d6fa4;
  --accent-hover: #155d8a;
  --accent-gradient: linear-gradient(135deg, #e8601a 0%, #d44e10 50%, #f0921e 100%);
  --speedbar-accent: #d95c12;
  --speedbar-bg: #fff5f0;
  --speedbar-border: #f5c6aa;
  --badge-bg: #1d6fa4;
  --badge-text: #ffffff;
  --code-bg: #f0f3f7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --container-max: 960px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #ffffff;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.20)),
    url('../images/site_background.png');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.65;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.site-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* ============ HEADER & NAV ============ */
.site-header {
  background-color: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-badge {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-elevated);
}

.nav-link.active {
  color: var(--text-main);
  background-color: var(--bg-surface-elevated);
}

.nav-link.highlight {
  background-color: var(--speedbar-accent);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(217, 92, 18, 0.28);
}

.nav-link.highlight:hover {
  filter: brightness(1.08);
}

/* ============ HERO SECTION ============ */
.site-hero {
  position: relative;
  width: 100%;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #1a3a5c;
}

.site-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  filter: brightness(0.78);
  transition: filter 0.3s ease;
}

.site-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.0) 0%,
    rgba(0,0,0,0.1) 40%,
    rgba(15,30,50,0.65) 100%
  );
}

.site-hero-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem 1.25rem 3rem;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  color: #ffffff;
}

.site-hero-content h1 {
  color: #ffffff;
  font-size: 2.75rem;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.site-hero-content p {
  color: rgba(255,255,255,0.9);
  font-size: 1.15rem;
  max-width: 600px;
  margin-bottom: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

/* ============ PAGE HERO (smaller for inner pages) ============ */
.page-hero {
  position: relative;
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #1a3a5c;
  margin-bottom: 0;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 45%;
  background-repeat: no-repeat;
  filter: brightness(0.7);
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.0) 0%, rgba(10,25,45,0.7) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  color: #ffffff;
}

.page-hero-content h1 {
  color: #ffffff;
  font-size: 2rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.page-hero-content p {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  max-width: 600px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
  margin: 0;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  padding: 2.5rem 0;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.75px; }

h2 {
  font-size: 1.6rem;
  margin-top: 2rem;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 { font-size: 1.2rem; margin-top: 1.5rem; }

p { margin-bottom: 1.25rem; color: var(--text-main); }

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

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* ============ SPOTLIGHT CARD ============ */
.spotlight-card {
  background: var(--speedbar-bg);
  border: 1px solid var(--speedbar-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spotlight-tag {
  background-color: var(--speedbar-accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.spotlight-title {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-main);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--speedbar-accent);
  color: #ffffff !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(217, 92, 18, 0.3);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main) !important;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: #bdc5d0;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ============ GRID & CARDS ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-2px);
  border-color: #b0bbc8;
  box-shadow: var(--shadow-md);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  background-color: var(--bg-surface-elevated);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============ POST LIST ============ */
.post-list { list-style: none; margin: 1.5rem 0; }

.post-item {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.post-item:first-child { padding-top: 1.25rem; }
.post-item-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.35rem; }
.post-item-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.post-item-excerpt { color: var(--text-muted); font-size: 0.95rem; }

/* ============ CODE ============ */
pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

code {
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: #c0392b;
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code { background: transparent; padding: 0; border: none; color: inherit; }

/* ============ TABLES ============ */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-surface-elevated);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ============ SPEC BOX ============ */
.spec-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

/* ============ FOOTER ============ */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============ POST CONTENT (LINKED ARTICLES) ============ */
.post-content {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 12px;
  padding: 2.25rem 2.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

/* ============ READABILITY BOX (TEXT CONTAINER) ============ */
.readability-box {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.readability-box h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.readability-box > p:first-child {
  margin-top: 0;
}

.readability-box > p:last-child {
  margin-bottom: 0;
}

.readability-box > ul:last-child {
  margin-bottom: 0;
}

.readability-box ul {
  padding-left: 1.25rem;
  margin-top: 0.35rem;
}

.readability-box li:last-child {
  margin-bottom: 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .site-nav { flex-wrap: wrap; justify-content: center; }

  .site-hero { min-height: 360px; }
  .site-hero-content h1 { font-size: 2rem; }

  .footer-inner { flex-direction: column; text-align: center; }
}
