/* ---------------------------------------------------------------- */
/* Catppuccin palette — Latte (light) / Mocha (dark)                 */
/* https://github.com/catppuccin/catppuccin                          */
/* ---------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Latte */
  --ctp-rosewater: #dc8a78;
  --ctp-flamingo:  #dd7878;
  --ctp-pink:      #ea76cb;
  --ctp-mauve:     #8839ef;
  --ctp-red:       #d20f39;
  --ctp-maroon:    #e64553;
  --ctp-peach:     #fe640b;
  --ctp-yellow:    #df8e1d;
  --ctp-green:     #40a02b;
  --ctp-teal:      #179299;
  --ctp-sky:       #04a5e5;
  --ctp-sapphire:  #209fb5;
  --ctp-blue:      #1e66f5;
  --ctp-lavender:  #7287fd;
  --ctp-text:      #4c4f69;
  --ctp-subtext1:  #5c5f77;
  --ctp-subtext0:  #6c6f85;
  --ctp-overlay2:  #7c7f93;
  --ctp-overlay1:  #8c8fa1;
  --ctp-overlay0:  #9ca0b0;
  --ctp-surface2:  #acb0be;
  --ctp-surface1:  #bcc0cc;
  --ctp-surface0:  #ccd0da;
  --ctp-base:      #eff1f5;
  --ctp-mantle:    #e6e9ef;
  --ctp-crust:     #dce0e8;

  /* semantic */
  --bg:        var(--ctp-base);
  --bg-alt:    var(--ctp-mantle);
  --fg:        var(--ctp-text);
  --fg-muted:  var(--ctp-subtext0);
  --border:    var(--ctp-surface0);
  --accent:    var(--ctp-mauve);
  --link:      var(--ctp-blue);
  --link-hover:var(--ctp-sapphire);
  --selection: var(--ctp-lavender);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Mocha */
    --ctp-rosewater: #f5e0dc;
    --ctp-flamingo:  #f2cdcd;
    --ctp-pink:      #f5c2e7;
    --ctp-mauve:     #cba6f7;
    --ctp-red:       #f38ba8;
    --ctp-maroon:    #eba0ac;
    --ctp-peach:     #fab387;
    --ctp-yellow:    #f9e2af;
    --ctp-green:     #a6e3a1;
    --ctp-teal:      #94e2d5;
    --ctp-sky:       #89dceb;
    --ctp-sapphire:  #74c7ec;
    --ctp-blue:      #89b4fa;
    --ctp-lavender:  #b4befe;
    --ctp-text:      #cdd6f4;
    --ctp-subtext1:  #bac2de;
    --ctp-subtext0:  #a6adc8;
    --ctp-overlay2:  #9399b2;
    --ctp-overlay1:  #7f849c;
    --ctp-overlay0:  #6c7086;
    --ctp-surface2:  #585b70;
    --ctp-surface1:  #45475a;
    --ctp-surface0:  #313244;
    --ctp-base:      #1e1e2e;
    --ctp-mantle:    #181825;
    --ctp-crust:     #11111b;
  }
}

/* ---------------------------------------------------------------- */
/* Reset                                                              */
/* ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, figure { margin: 0; padding: 0; }

::selection { background: var(--selection); color: var(--ctp-crust); }

/* ---------------------------------------------------------------- */
/* Base typography — larger, crisp, highly readable                  */
/* ---------------------------------------------------------------- */

html {
  font-size: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
               Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;       /* ~20px */
  line-height: 1.75;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

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

/* ---------------------------------------------------------------- */
/* Layout                                                             */
/* ---------------------------------------------------------------- */

.site-header,
main,
.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}

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

main {
  padding-top: 1rem;
  padding-bottom: 4rem;
  min-height: 60vh;
}

.site-footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--fg-muted);
}

/* ---------------------------------------------------------------- */
/* Post list (homepage)                                               */
/* ---------------------------------------------------------------- */

.post-list {
  list-style: none;
}

.post-list-item {
  --thumb-size: 112px;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.post-list-text {
  flex: 1;
  min-width: 0;
  height: var(--thumb-size);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-thumb {
  flex-shrink: 0;
  width: var(--thumb-size);
  height: var(--thumb-size);
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-alt);
}

.post-list-item h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.post-list-item h2:hover {
  color: var(--accent);
}

.post-date {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--fg-muted);
  white-space: nowrap;
}

.post-description {
  margin-top: 0.5rem;
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 2.5rem;
  font-size: 1rem;
}

.pagination a {
  text-decoration: none;
  color: var(--fg-muted);
}

.pagination a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------- */
/* Post meta — kept deliberately minimal: author + date only          */
/* ---------------------------------------------------------------- */

.post-meta {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------- */
/* Single post                                                        */
/* ---------------------------------------------------------------- */

.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 2rem;
}

.post .post-meta {
  margin-bottom: 3rem;
}

.post-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-top: 1.5rem;
}

.post-content ul,
.post-content ol {
  margin-top: 1.5rem;
  padding-left: 1.75rem;
}

.post-content li + li {
  margin-top: 0.5rem;
}

.post-content strong {
  font-weight: 700;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem auto;
  width: 4rem;
}

/* Centered images */
.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2.5rem auto;
  border-radius: 8px;
}

.post-content figure {
  margin: 2.5rem auto;
  text-align: center;
}

.post-content figure img {
  margin: 0 auto;
}

.post-content figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.post-content blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
  font-style: italic;
}

.post-content blockquote p {
  margin-top: 0.75rem;
}

.post-content blockquote p:first-child {
  margin-top: 0;
}

.post-content code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.post-content pre {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

.post-content a {
  text-decoration-thickness: 1px;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                         */
/* ---------------------------------------------------------------- */

@media (max-width: 640px) {
  body {
    font-size: 1.125rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-list-item h2 {
    font-size: 1.4rem;
  }

  .post-list-item {
    --thumb-size: 72px;
  }

  .site-header, main, .site-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
