/* The Notebook — a clean, warm personal blog
   Type: Hanken Grotesk (headings) + Work Sans (body). One orange accent. */

:root {
  --paper: #faf7f1;
  --surface: #f3ede2;
  --ink: #211f1b;
  --ink-soft: #6d685e;
  --ink-faint: #9a9488;
  --line: #e6ded0;
  --accent: #e8721c;
  --accent-ink: #b9540e;
  /* darker accent for text on paper */
  --accent-bg: rgba(232, 114, 28, 0.10);

  --head: 'Hanken Grotesk', system-ui, sans-serif;
  --body: 'Work Sans', system-ui, sans-serif;

  --sidebar-w: 232px;
  --content-max: 660px;
  --gutter: 72px;

}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent-bg);
}

/* ───────────────────────── shell / layout ───────────────────────── */
.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 76px var(--gutter) 96px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 64px;
  align-items: start;
}

/* ───────────────────────── sidebar ───────────────────────── */
.sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-name {
  font-family: var(--head);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.caret {
  color: var(--accent);
  font-weight: 600;
  margin-left: 1px;
  animation: caret-blink 1.05s steps(1) infinite;
}

@keyframes caret-blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.brand-role {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.brand-bio {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 14px 0 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.nav a {
  font-family: var(--head);
  font-weight: 500;
  font-size: 15.5px;
  color: var(--ink-soft);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: color .15s;
  width: fit-content;
}

.nav a .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .15s;
}

.nav a:hover {
  color: var(--ink);
}

.nav a.active {
  color: var(--accent-ink);
}

.nav a.active .dot {
  opacity: 1;
}

.social {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.social a {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  transition: color .15s;
}

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

.side-foot {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 8px;
}

/* ───────────────────────── content / views ───────────────────────── */
.content {
  min-width: 0;
  max-width: var(--content-max);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fade .35s ease;
}

@keyframes fade {
  from {
    transform: translateY(7px);
  }

  to {
    transform: none;
  }
}

.eyebrow {
  font-family: var(--head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 18px;
}

.intro {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 4px;
  max-width: 38ch;
}

.intro .soft {
  color: var(--ink-soft);
}

.intro-typed {
  display: inline-block;
  white-space: nowrap;
  vertical-align: bottom;
}

.intro-caret {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -0.18em;
  animation: caret-blink 1.05s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .intro-caret {
    animation: none;
  }
}

/* post list */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  padding: 26px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.post-item:first-child {
  border-top: none;
  padding-top: 8px;
}

.post-meta {
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.post-title {
  font-family: var(--head);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  transition: color .15s;
}

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

.post-excerpt {
  color: var(--ink-soft);
  font-size: 15.5px;
  margin-top: 9px;
  line-height: 1.6;
  max-width: 54ch;
}

/* tag chip */
.chip {
  font-family: var(--head);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: var(--accent-bg);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
}

/* ───────────────────────── single post (article) ───────────────────────── */
.back {
  font-family: var(--head);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 30px;
  transition: color .15s;
}

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

.article-head .post-meta {
  margin-bottom: 14px;
}

.article-title {
  font-family: var(--head);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}

.byline {
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.byline .av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
}

.hero {
  width: 100%;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  margin: 32px 0 36px;
  display: block;
}

.article-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
}

.article-body p {
  margin: 0 0 22px;
}

.article-body h2 {
  font-family: var(--head);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.01em;
  margin: 38px 0 14px;
  color: var(--ink);
}

.article-body a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  font-style: normal;
}

.article-body code {
  font-family: 'Hanken Grotesk', monospace;
  font-size: 14.5px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 5px;
}

.article-body pre {
  background: #2a2722;
  color: #f1ece2;
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
  margin: 24px 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.article-foot {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.prevnext a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 46%;
}

.prevnext .pn-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.prevnext .pn-title {
  font-family: var(--head);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  transition: color .15s;
}

.prevnext a:hover .pn-title {
  color: var(--accent-ink);
}

.prevnext .next {
  text-align: right;
  margin-left: auto;
}

/* ───────────────────────── archive ───────────────────────── */
.page-title {
  font-family: var(--head);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.page-sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 36px;
}

.year-group {
  margin-bottom: 34px;
}

.year-label {
  font-family: var(--head);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.arc-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.arc-row .d {
  font-size: 13px;
  color: var(--ink-faint);
  width: 58px;
  flex: 0 0 auto;
  letter-spacing: 0.02em;
}

.arc-row .t {
  font-family: var(--head);
  font-weight: 500;
  font-size: 16.5px;
  transition: color .15s;
}

.arc-row:hover .t {
  color: var(--accent-ink);
}

.arc-row .arc-tags {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

/* ───────────────────────── tags ───────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.tag-cloud button {
  font-family: var(--head);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 22px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: all .15s;
}

.tag-cloud button .n {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.tag-cloud button:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tag-cloud button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tag-cloud button.on .n {
  color: rgba(255, 255, 255, 0.75);
}

/* ───────────────────────── mobile top bar (hidden on desktop) ───────────────────────── */
.menu-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topbar {
  display: none;
}

.scrim {
  display: none;
}

/* ───────────────────────── responsive ───────────────────────── */
@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 0 80px;
    max-width: 560px;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 14px 22px;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .topbar .tb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .topbar .tb-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
  }

  .topbar .tb-name {
    font-family: var(--head);
    font-weight: 600;
    font-size: 16px;
  }

  .menu-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .menu-btn span {
    width: 17px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: .2s;
  }

  /* sidebar becomes slide-in drawer */
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    z-index: 50;
    background: var(--paper);
    padding: 28px 26px;
    gap: 20px;
    box-shadow: -16px 0 50px rgba(30, 24, 16, 0.16);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2, .7, .3, 1);
    border-left: 1px solid var(--line);
  }

  .menu-toggle:checked~.shell .sidebar {
    transform: none;
  }

  .sidebar .avatar {
    width: 56px;
    height: 56px;
  }

  .nav a {
    font-size: 19px;
    padding: 8px 0;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(28, 22, 14, 0.34);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }

  .menu-toggle:checked~.scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    padding: 26px 22px 0;
    max-width: none;
  }

  .article-title {
    font-size: 30px;
  }

  .hero {
    height: 220px;
  }

  .article-body {
    font-size: 17px;
  }
}