@import "utopia.css";

/* ==========================================
   Reset & Base
   ========================================== */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #fafafa;
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: #1a1a1a;
  text-decoration-color: #888;
  text-underline-offset: 0.15em;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: #1a1a1a;
}

/* ==========================================
   Layout
   ========================================== */

.wrapper {
  max-width: 65ch;
  margin-inline: auto;
  padding-inline: var(--space-m);
}

/* ==========================================
   Header
   ========================================== */

.site-header {
  padding-block: var(--space-l);
  border-bottom: 1px solid #e0e0e0;
}

.site-header h1 {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.site-header h1 a {
  text-decoration: none;
}

.site-header p {
  font-size: var(--step--1);
  color: #666;
  margin-top: var(--space-3xs);
}

nav {
  margin-top: var(--space-s);
  display: flex;
  gap: var(--space-s);
}

nav a {
  font-size: var(--step--1);
  text-decoration: none;
  color: #555;
}

nav a:hover {
  color: #1a1a1a;
}

/* ==========================================
   Main content
   ========================================== */

main {
  padding-block: var(--space-l-xl);
}

/* ==========================================
   Post list (index page)
   ========================================== */

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.post-list li {
  padding-bottom: var(--space-l);
  border-bottom: 1px solid #e0e0e0;
}

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

.post-list time {
  display: block;
  font-size: var(--step--1);
  color: #888;
  margin-bottom: var(--space-3xs);
}

.post-list h2 {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post-list h2 a {
  text-decoration: none;
}

.post-list h2 a:hover {
  text-decoration: underline;
  text-decoration-color: #888;
}

.post-list .excerpt {
  margin-top: var(--space-2xs);
  color: #444;
  font-size: var(--step--1);
}

/* ==========================================
   Single post
   ========================================== */

.post-header {
  margin-bottom: var(--space-m-l);
}

.post-header time {
  display: block;
  font-size: var(--step--1);
  color: #888;
  margin-bottom: var(--space-3xs);
}

.post-header h1 {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.post-content > * + * {
  margin-top: var(--space-s);
}

.post-content h2 {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: var(--space-l);
  line-height: 1.2;
}

.post-content h3 {
  font-size: var(--step-1);
  font-weight: 600;
  margin-top: var(--space-m);
  line-height: 1.3;
}

.post-content blockquote {
  border-left: 3px solid #ccc;
  padding-left: var(--space-s);
  color: #555;
  font-style: italic;
}

.post-content ul,
.post-content ol {
  padding-left: var(--space-m);
}

.post-content li + li {
  margin-top: var(--space-3xs);
}

.post-content code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
  font-size: 0.9em;
  background: #eee;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.post-content pre {
  background: #1a1a1a;
  color: #e0e0e0;
  padding: var(--space-s);
  border-radius: 6px;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: var(--step--1);
}

.back-link {
  display: inline-block;
  margin-top: var(--space-l);
  font-size: var(--step--1);
  color: #888;
}

.back-link:hover {
  color: #1a1a1a;
}

/* ==========================================
   Page (about, etc.)
   ========================================== */

.page-content > * + * {
  margin-top: var(--space-s);
}

.page-content h1 {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-s);
}

/* ==========================================
   Footer
   ========================================== */

.site-footer {
  padding-block: var(--space-l);
  border-top: 1px solid #e0e0e0;
  color: #888;
  font-size: var(--step--2);
}
