/* ---- CSS Variables / Theming ---- */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #6b6b6b;
  --color-border: #e0e0e0;
  --color-link: #1a1a1a;
  --color-link-hover: #555555;
  --color-toggle-bg: #d4d4d4;
  --color-toggle-knob: #ffffff;
  --color-selection: rgba(0, 100, 255, 0.26);
  --color-blockquote-border: #d4d4d4;
  --color-blockquote-bg: transparent;
  --container-width: 640px;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-heading: 'Source Serif 4', 'Georgia', serif;
}

html.dark {
  --color-bg: #1a1a1a;
  --color-text: #e8e8e8;
  --color-text-secondary: #999999;
  --color-border: #333333;
  --color-link: #e8e8e8;
  --color-link-hover: #bbbbbb;
  --color-toggle-bg: #555555;
  --color-toggle-knob: #e8e8e8;
  --color-blockquote-border: #444444;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--color-selection);
  color: inherit;
}

::-moz-selection {
  background-color: var(--color-selection);
  color: inherit;
}

/* ---- Container ---- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Header ---- */
.header {
  padding: 2.5rem 0 0;
}

.header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.header-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.header-name a {
  color: var(--color-text);
  text-decoration: none;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.header-nav a:hover {
  color: var(--color-text);
}

/* ---- Dark/Light Toggle ---- */
.toggle-switch {
  position: relative;
  display: inline-block;
}

.toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-label {
  display: block;
  width: 38px;
  height: 18px;
  background-color: var(--color-toggle-bg);
  border-radius: 9px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
}

.toggle-label::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--color-toggle-knob);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-checkbox:checked + .toggle-label::before {
  transform: translateX(20px);
}

.toggle-checkbox:focus-visible + .toggle-label {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* ---- Main Content ---- */
.page-main {
  padding: 2.5rem 0 4rem;
}

.home-intro img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 2rem;
}
.home-intro {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

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

.home-section {
  margin-bottom: 2rem;
}

.home-section h2 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.bullet-list {
  list-style: none;
  padding-left: 0;
}

.bullet-list li {
  padding-left: 0.85em;
  position: relative;
  margin-bottom: 0.2rem;
}

.bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-text);
}

.bullet-list a {
  color: var(--color-link);
  text-decoration: none;
  font-size: 0.95rem;
}

.bullet-list a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bullet-list .meta {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* ---- Post Page ---- */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.post-content {
  font-size: 1rem;
  line-height: 1.8;
}

.post-content p {
  margin-bottom: 1.25rem;
}

/* ---- Quotes ---- */
.quotes-list {
  list-style: none;
  padding: 0;
}

.quotes-list li {
  margin-bottom: 2rem;
}

.quote-text {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 0.35rem;
}

.quote-attribution {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-style: normal;
}

.quote-attribution::before {
  content: "— ";
}

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

/* ---- Back Link ---- */
.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

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

/* ---- Footer ---- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.footer p {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .header {
    padding: 1.5rem 0 0;
  }

  .header-name {
    font-size: 1.1rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }

  .page-main {
    padding: 2rem 0 3rem;
  }
}
