/* Global Reset & Font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color, #ffffff);
  color: var(--text-color, #1c1c1e);
  line-height: 1.75;
  padding: 2rem 1.5rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
header, footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
  text-align: center;
}

header {
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

nav {
  margin-top: 0.5rem;
}

nav a, .logo a {
  margin: 0 10px;
  text-decoration: none;
  color: var(--link-color, #007aff);
  font-weight: 500;
}

.logo {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

main, .post, .about {
  max-width: 700px;
  margin: 2rem auto;
}

h1, h2, h3 {
  margin: 2rem 0 1rem;
  font-weight: 600;
  line-height: 1.25;
}

p, ul, li {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.07);
}

/* Blog posts */
.post-meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 2rem;
}

pre {
  background-color: #f0f0f5;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: Menlo, Consolas, monospace;
  margin: 2rem 0;
}

body.dark-mode pre {
  background-color: #2a2a2c;
  color: #fff;
}

/* Theme toggle */
.toggle-theme {
  background: none;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-color, #1c1c1e);
}

/* Dark mode variables */
body.dark-mode {
  --bg-color: #1c1c1e;
  --text-color: #f9f9f9;
  --link-color: #0a84ff;
  --border-color: #2d2d2f;
}

/* Motto */
.motto {
  font-style: italic;
  text-align: center;
  font-size: 1.2rem;
  margin: 3rem auto;
  color: var(--text-color);
}

/* Grid sections */
.highlights {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.highlights div {
  background: rgba(0, 0, 0, 0.03);
  padding: 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

body.dark-mode .highlights div {
  background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 700px) {
  .highlights {
    grid-template-columns: repeat(3, 1fr);
  }
}

footer {
  font-size: 0.9rem;
  color: var(--text-color);
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 3rem;
}

img.full-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  border-radius: 0;
  max-width: none;
}
