/* ---------- Base / Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
}

/* ---------- Theme ---------- */
:root {
  --bg: #0f1115;
  --card: #151923;
  --fg: #e6e8ef;
  --muted: #a7adbe;
  --accent: #4ea7ff;
  --accent-2: #00d7c2;
  --border: #273043;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
}
.light {
  --bg: #f7f8fb;
  --card: #ffffff;
  --fg: #1d2433;
  --muted: #5b667a;
  --accent: #0069ff;
  --accent-2: #00a68f;
  --border: #e6eaf2;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* ---------- Progress Bar ---------- */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 1000;
}

/* ---------- Layout ---------- */
.container {
  width: min(980px, 92%);
  margin: 0 auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(150%) blur(6px);
}
.page-title {
  font-size: clamp(1.6rem, 2.5vw + 1rem, 2.4rem);
  line-height: 1.2;
  font-weight: 800;
  margin: 0;
  padding: 1.25rem 0 1rem 0;
  text-wrap: balance;
}
.theme-toggle {
  float: right;
  margin-top: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 10px;
  padding: .45rem .65rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hero {
  margin: 1rem 0 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero img {
  width: 100%;
  display: block;
}
.hero figcaption {
  font-size: .9rem;
  color: var(--muted);
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
}
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1rem, 1.8vw + 0.75rem, 2rem);
  box-shadow: var(--shadow);
}
.post .lead {
  font-size: 1.05rem;
  color: var(--fg);
}
.post h2 {
  margin-top: 1.75rem;
  margin-bottom: .5rem;
  font-size: clamp(1.1rem, 1vw + 1rem, 1.45rem);
  line-height: 1.35;
  border-left: 4px solid var(--accent);
  padding-left: .6rem;
}
.post p {
  color: var(--fg);
}
.post ul {
  margin: .25rem 0 1rem 1.25rem;
}
.visit a {
  display: inline-block;
  margin: .25rem 0 1rem;
  padding: .55rem .8rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
}
.visit a:hover { opacity: .92; }

.site-footer {
  color: var(--muted);
  font-size: .95rem;
  padding: 2.5rem 0 3rem;
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.site-footer a:hover { border-bottom-style: solid; }

/* Responsive tweaks */
@media (max-width: 600px) {
  .theme-toggle { margin-top: 10px; }
}
