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

:root {
  --text: #1a1a1a;
  --text-light: #555;
  --bg: #faf9f7;
  --border: #ddd;
  --accent: #333;
  --max-width: 720px;
}

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

body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header & Nav --- */

header {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-light);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

nav a:hover,
nav a.active {
  color: var(--text);
  border-bottom: 1px solid var(--text);
}

/* --- Main --- */

main {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

/* --- Prose --- */

main h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.25;
}

main h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
}

main h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.4rem;
}

main p {
  margin-bottom: 1.2rem;
}

main ul, main ol {
  margin-bottom: 1.2rem;
  padding-left: 1.4rem;
}

main li {
  margin-bottom: 0.4rem;
}

main blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--text-light);
  margin: 1.5rem 0;
  font-style: italic;
}

main strong {
  font-weight: 600;
}

main hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
  border-radius: 2px;
}

main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

main th, main td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

main th {
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

main code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", monospace;
  font-size: 0.85em;
  background: #eee;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

main pre {
  background: #eee;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

main pre code {
  background: none;
  padding: 0;
}

/* --- Meta line (dates, materials) --- */

.meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* --- Entry lists --- */

.entry-list {
  list-style: none;
  padding: 0;
}

.entry-list li {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

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

.entry-list a {
  text-decoration: none;
  color: var(--text);
}

.entry-list a:hover {
  color: var(--text-light);
}

.entry-list .entry-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.2rem;
}

.entry-list .entry-date {
  font-size: 0.85rem;
  color: var(--text-light);
}

.entry-list .entry-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* --- Works grid --- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.work-card {
  text-decoration: none;
  color: var(--text);
}

.work-card:hover .work-title {
  color: var(--text-light);
}

.work-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  margin: 0;
}

.work-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

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

/* --- Home page --- */

.home-intro {
  margin-top: 2rem;
  font-size: 1.15rem;
  line-height: 1.8;
  max-width: 600px;
}

.home-intro p {
  margin-bottom: 1.4rem;
}

.home-latest {
  margin-top: 3rem;
}

.home-latest h2 {
  margin-top: 0;
}

/* --- Footer --- */

footer {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- Responsive --- */

@media (max-width: 600px) {
  html { font-size: 16px; }
  header { flex-direction: column; gap: 0.8rem; }
  .works-grid { grid-template-columns: 1fr; }
}
