@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Source+Sans+3:wght@400;500&display=swap');

:root {
  --paper: #faf8f3;
  --paper-lines: rgba(180, 160, 140, 0.18);
  --ink: #2c2825;
  --ink-soft: #5c534d;
  --accent: #8b5a3c;
  --line-height: 32px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Caveat', cursive;
  background: #e8e4dc;
  color: var(--ink);
  font-size: 24px;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(139, 90, 60, 0.25);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
}

/* Wrapper for notebook + side navigation */
.notebook-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  position: relative;
}

/* Floating side navigation */
.nav-side {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 120px;
  padding-top: 60px;
}

.nav-side a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.2s;
  text-decoration: none;
}

.nav-side a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-left {
  align-items: flex-end;
  text-align: right;
}

.nav-right {
  align-items: flex-start;
  text-align: left;
}

.nav-arrow {
  font-size: 20px;
  font-weight: 600;
}

.nav-label {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-back {
  font-size: 24px;
  font-weight: 600;
  padding: 8px 12px;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Notebook paper container */
.page-shell {
  flex: 0 1 760px;
  background: var(--paper);
  padding: 48px 56px 64px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.06),
    inset 0 0 80px rgba(0, 0, 0, 0.01);
  border-radius: 2px;
  position: relative;
  min-height: 90vh;
}

/* Subtle paper edge effect */
.page-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
}

/* Header with logo */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}

.site-logo {
  width: 130px;
  height: 130px;
  object-fit: contain;
  opacity: 0.9;
}

.site-title-block {
  flex: 1;
}

.site-name {
  font-family: 'Caveat', cursive;
  font-size: 56px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.site-name:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-note {
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink-soft);
}

/* Main content - with ruled lines */
.site-main {
  max-width: 100%;
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent calc(var(--line-height) - 1px),
      var(--paper-lines) calc(var(--line-height) - 1px),
      var(--paper-lines) var(--line-height)
    );
  background-position: 0 24px;
}

/* Intro section */
.intro {
  margin-bottom: 40px;
  font-size: 26px;
  color: var(--ink-soft);
  font-style: italic;
}

.intro p {
  margin: 0;
}

/* Post list (index page) - numbered with title + date */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
}


.post-number {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-soft);
  min-width: 24px;
}

.post-title {
  flex: 1;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}

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

.post-date {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Article pages */
.post {
  font-size: 24px;
  background: var(--paper);
}

.post h1 {
  font-size: 38px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

.post-meta {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

/* Post body - ruled lines for content only */
.post-body {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent calc(var(--line-height) - 1px),
      var(--paper-lines) calc(var(--line-height) - 1px),
      var(--paper-lines) var(--line-height)
    );
  background-position: 0 6px;
  padding-top: 8px;
}

.post h2 {
  font-size: 32px;
  font-weight: 600;
  margin: 40px 0 16px;
}

.post h3 {
  font-size: 28px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.post p {
  margin: 0 0 var(--line-height);
}

.post blockquote {
  margin: var(--line-height) 0;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}

.post ul,
.post ol {
  padding-left: 28px;
  margin: 0 0 var(--line-height);
}

.post li {
  margin-bottom: 8px;
}

.post code {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 3px;
}

.post pre {
  background: rgba(0, 0, 0, 0.03);
  padding: 16px 20px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0 0 var(--line-height);
}

.post pre code {
  background: none;
  padding: 0;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Responsive */
@media (max-width: 900px) {
  .notebook-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .nav-side {
    position: static;
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
    min-width: auto;
  }

  .nav-left {
    order: -1;
    align-items: center;
  }

  .nav-right {
    align-items: center;
  }

  .nav-label {
    display: none;
  }

  .page-shell {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .notebook-wrapper {
    margin: 20px auto;
    padding: 0 12px;
  }

  .page-shell {
    padding: 36px 28px 48px;
    --line-height: 30px;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .site-logo {
    width: 40px;
    height: 40px;
  }

  .site-name {
    font-size: 42px;
  }

  .post-item {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .post-title {
    font-size: 22px;
    flex-basis: calc(100% - 36px);
  }

  .post-date {
    margin-left: 36px;
    font-size: 12px;
  }

  .post h1 {
    font-size: 32px;
  }
}
