:root {
  --paper: #fcfaf6;
  --ink: #1f2428;
  --muted: #6b6b6b;
  --line: #1f2428;
  --soft-line: #9a9a9a;
  --shell-max: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Crimson Text", "Source Serif 4", Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 16px 72px;
}

/* Global header restored from original site rhythm */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: rgb(252 250 246 / 0.95);
  backdrop-filter: blur(8px);
}

.topbar-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 0;
}

.nav-toggle,
.nav-close {
  display: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
}

.nav-toggle:focus-visible,
.nav-close:focus-visible,
.lang button:focus-visible {
  outline: 1px solid var(--line);
  outline-offset: 2px;
}

.lang {
  display: flex;
  gap: 12px;
}

.lang button {
  border: none;
  background: transparent;
  color: #bbb;
  font-family: "Crimson Text", serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
}

.lang button.active {
  color: var(--ink);
  font-weight: 700;
}

.logo-stack {
  text-align: center;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.15em;
  color: var(--ink);
  white-space: normal;
  padding: 24px 0;
  width: 100%;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 4px double var(--line);
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0;
  font-size: 13px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  background: transparent;
  letter-spacing: 0.08em;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  line-height: 1.2;
}

.nav a span {
  font-size: 11px;
  color: #575757;
  font-family: "Crimson Text", serif;
  letter-spacing: 0;
}

.nav a:hover {
  text-decoration: underline;
}

.nav-overlay {
  display: none;
}

.vibe-page {
  width: 100%;
  margin: 0;
  padding: 56px 0 0;
}

.section-header {
  text-align: center;
  padding: 0 0 18px;
}

.section-header h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5.2vw, 44px);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.2;
}

.section-subtitle {
  margin: 12px 0 0;
  font-size: 12px;
  color: #a8a8a8;
  letter-spacing: 0.08em;
}

/* Single, full-width rule under section title */
.section-rule {
  width: 100%;
  border-top: 0.5px solid var(--line);
  margin: 0 0 28px;
}

.chronicle-snippets {
  display: grid;
  gap: 24px;
}

/* 20/80 timeline split aligned to global shell width */
.chronicle-item {
  display: grid;
  grid-template-columns: 20% minmax(0, 1fr);
  column-gap: 34px;
  align-items: start;
}

.time-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-note h2 {
  margin: 0 0 10px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  line-height: 1.18;
}

.story-note p {
  margin: 0;
  font-size: 1rem;
}

.story-markdown p {
  margin: 0 0 10px;
  font-size: 1rem;
}

.major-item .story-markdown p:first-of-type::first-letter {
  float: left;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 3.15rem;
  line-height: 0.84;
  margin-right: 8px;
  margin-top: 7px;
}

.entry-tags {
  margin: 10px 0 0;
  color: #7a7a7a;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.custom-embed iframe,
.custom-embed video,
.custom-embed canvas,
.custom-embed img {
  max-width: 100%;
  height: auto;
}

/* Double rule only at month transitions */
.month-divider {
  position: relative;
  height: 12px;
  margin: 2px 0;
}

.month-divider::before,
.month-divider::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
}

.month-divider::before {
  top: 2px;
  border-top: 1.25px solid var(--line);
}

.month-divider::after {
  top: 8px;
  border-top: 0.5px solid var(--soft-line);
}

.project-embed {
  margin-top: 18px;
  border: 0.5px solid #333;
  padding: 18px;
  background: rgb(255 255 255 / 0.56);
}

.embed-title {
  margin: 0 0 12px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.map-embed canvas {
  width: 100%;
  height: auto;
  display: block;
  border: 0.5px solid #333;
  background: linear-gradient(160deg, #f8f8f6 0%, #ece7dc 100%);
}

.canvas-caption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
}

.translator-embed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.translator-embed input,
.translator-embed button {
  border: 0.5px solid #333;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
}

.translator-embed input {
  padding: 9px 12px;
}

.translator-embed button {
  padding: 0 16px;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.translator-embed button:hover {
  background: #f5f3ee;
}

.translation-output {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  color: #4e4e4e;
}

.wechat-mockup .phone-frame {
  width: min(100%, 300px);
  margin: 0 auto;
  border: 0.5px solid #333;
  border-radius: 24px;
  background: #fefefe;
  padding: 14px 12px;
}

.phone-notch {
  width: 80px;
  height: 9px;
  border-radius: 999px;
  margin: 0 auto 10px;
  border: 0.5px solid #333;
}

.phone-screen {
  border: 0.5px solid #333;
  min-height: 240px;
  padding: 12px;
  background: #fff;
}

.phone-header {
  font-size: 0.92rem;
  margin-bottom: 10px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

.phone-line {
  height: 7px;
  border: 0.5px solid #333;
  margin-bottom: 8px;
}

.phone-line.short {
  width: 60%;
}

.phone-card {
  margin-top: 18px;
  border: 0.5px solid #333;
  padding: 10px;
  font-size: 0.92rem;
  min-height: 74px;
  transition: opacity 220ms ease;
}

.phone-card.is-fading {
  opacity: 0.25;
}

.phone-caption {
  margin: 10px 0 0;
  color: #666;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .chronicle-item {
    column-gap: 24px;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 0 14px 40px;
  }

  .logo-stack {
    font-size: 15px;
    letter-spacing: 0.1em;
    padding: 16px 0;
  }

  .nav {
    gap: 12px;
  }

  .topbar-header {
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-block;
  }

  .lang {
    gap: 10px;
  }

  .logo-stack {
    padding: 16px 0;
  }

  .vibe-page {
    padding-top: 34px;
  }

  .chronicle-snippets {
    gap: 20px;
  }

  .chronicle-item {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .time-note p {
    font-size: 0.74rem;
  }

  .major-item .story-markdown p:first-of-type::first-letter {
    font-size: 2.7rem;
    margin-top: 5px;
  }

  .project-embed {
    padding: 14px;
  }

  .translator-embed {
    grid-template-columns: 1fr;
  }

  .translator-embed button {
    width: 100%;
  }
}
