@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Literata:opsz,wght@7..72,400;7..72,600;7..72,700&family=Lora:wght@400;500;600;700&display=swap");
@font-face {
  font-family: "Olivetti";
  src: url("/assets/Olivetti-58b6fd2a.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #f7f4ee;
  --paper: #fbfaf7;
  --ink: #323232;
  --muted: #746f66;
  --faint: #d8d0c3;
  --button-bg: #ece6dc;
  --button-bg-hover: #e1d8ca;
  --button-border: #d3c8b8;
  --font-body:
    "Lora", Georgia, "Times New Roman", serif;
  --font-display:
    "Courier Prime", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  --font-title:
    "Literata", Georgia, "Times New Roman", serif;
  --font-site-title:
    "Courier Prime", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #1f1f1f;
  --paper: #262626;
  --ink: #e8e3d8;
  --muted: #aaa39a;
  --faint: #3a3834;
  --button-bg: #303030;
  --button-bg-hover: #3a3a3a;
  --button-border: #46433e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Header */
header {
  padding: 20px 24px 0;
  margin-bottom: 0;
}

.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  color: var(--ink);
  font-family: var(--font-site-title);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-decoration: none;
}

nav a {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}

nav a:hover,
.site-title:hover {
  color: var(--muted);
}

/* Main content */
main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 76px 24px 44px;
  flex: 1;
}

/* Future homepage / category landing */
.hero {
  min-height: 44vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-title {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(2.7rem, 8vw, 3.8rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 400;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.category-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--button-border);
  border-radius: 999px;
  padding: 8px 15px;
  background: var(--button-bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.category-button:hover {
  background: var(--button-bg-hover);
}

.category-title {
  margin-bottom: 28px;
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(2.1rem, 7vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 10px 0;
}

.post-item a {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.post-item a:hover {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.post-date {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  white-space: nowrap;
  margin-left: 16px;
}

.post-date-short {
  display: none;
}

/* Single post */
.post-title {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(1.9rem, 5vw, 2.65rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 34px;
}

.post-body {
  color: var(--ink);
  line-height: 1.82;
}

.post-body p + p {
  margin-top: 1.15rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-decoration: none;
}

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

/* Footer */
footer {
  text-align: center;
  padding: 18px 24px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 24px;
}

@media (max-width: 640px) {
  header {
    padding-top: 16px;
  }

  .header-inner {
    align-items: baseline;
  }

  main {
    padding-top: 56px;
  }

  .post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 12px 0;
  }

  .post-item a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .post-date {
    flex: 0 0 auto;
    margin-left: 0;
    font-size: 0.8rem;
  }

  .post-date-full {
    display: none;
  }

  .post-date-short {
    display: inline;
  }
}
