/* System font stack for best cross-platform rendering */
:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji";
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --color-text: #1a1a1a;
  --color-heading: #3b4a2f;
  --color-text-muted: #999;
  --color-link: #0057b8;
  --color-link-hover: #003d82;
  --color-bg: #ffffff;
  --color-border: #e0e0e0;
  --color-code-bg: #f5f5f5;
  --color-blockquote: #f0f0f0;

  --max-width: 720px;
  --spacing: 1.5rem;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

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

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
}

.site-title:hover {
  color: var(--color-link);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--color-link);
}

.nav-logo {
  margin-left: 1rem;
  height: 0.85rem;
  width: auto;
  display: inline-block;
  vertical-align: -0.1rem;
}

@keyframes spin-once {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.nav-logo.spinning {
  animation: spin-once 1.2s cubic-bezier(0.4, 0, 0.2, 1) 1;
}

/* Main content */
.site-main {
  padding: 2.5rem 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

h1 { font-size: 2.8rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover { color: var(--color-link-hover); }

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

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

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

/* Blockquote */
blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--color-blockquote);
  border-left: 4px solid var(--color-border);
  color: var(--color-text-muted);
}

blockquote p:last-child { margin-bottom: 0; }

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}

li { margin-bottom: 0.25rem; }

/* Post list (home and archives) */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-item:last-child { border-bottom: none; }

.post-meta {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  display: block;
  letter-spacing: 0.05em;
}

.post-item h2 {
  margin: 0.5rem 0 0.6rem;
  font-weight: bold;
  font-size: 2rem;
}

.post-item h2 a {
  color: var(--color-heading);
  text-decoration: none;
}

.post-item h2 a:hover {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.archive-link {
  margin-top: 2rem;
  font-size: 0.95rem;
}

/* Single post */
.post-header {
  margin-bottom: 0rem;
  padding-bottom: 0rem;
}

.post-header .post-meta {
  display: block;
  margin-top: 0.5rem;
}

.post-header .post-meta a {
  color: var(--color-text-muted);
}

.post-content {
  margin-bottom: 2rem;
  overflow-wrap: break-word;
}

/* Tags */
.post-tags {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.tag {
  display: inline-block;
  background: var(--color-code-bg);
  color: var(--color-text-muted);
  padding: 0.15em 0.5em;
  border-radius: 3px;
  text-decoration: none;
  margin-right: 0.25rem;
}

.tag:hover { color: var(--color-link); }

/* Comments section */
.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.comments h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.comment {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-code-bg);
  border-radius: 4px;
}

.comment-meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-size: 0.9rem;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.comment-content p {
  margin: 0;
  font-size: 0.95rem;
}

/* Nested replies — slightly indented with a visual connector */
.comment-replies {
  margin-top: 1rem;
  margin-left: 1.5rem;
  border-left: 2px solid var(--color-border);
  padding-left: 1rem;
}

.comment-reply {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

/* Page heading */
.page-heading {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 16px; }
  h1 { font-size: 2rem; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}

/* Speaking page two-column layout */
.speaking-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.speaking-sidebar {
  font-size: 0.64rem;
  color: var(--color-text-muted);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.25rem 0 0.75rem;
}

.speaking-sidebar h2 {
  font-size: 0.95rem;
  margin-top: 0;
}

.speaking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.speaking-list li {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #ddd;
}

.speaking-list li:last-child {
  border-bottom: none;
}

.speaking-title {
  color: #555;
}

.speaking-note {
  font-style: italic;
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .speaking-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
