@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Noto+Sans+KR:wght@400;500;600&family=Noto+Serif+KR:wght@400;500;600;700&display=swap");

:root {
  --paper: #f4f1e9;
  --paper-deep: #e9e4d9;
  --white: #fbfaf6;
  --ink: #1d211c;
  --ink-soft: #4f554d;
  --muted: #7f827b;
  --line: rgba(29, 33, 28, 0.16);
  --line-strong: rgba(29, 33, 28, 0.34);
  --sage: #aebba6;
  --sage-light: #d5ddd0;
  --orange: #d66543;
  --orange-soft: #eac0ae;
  --serif: "Noto Serif KR", "Iropke Batang", "Batang", Georgia, serif;
  --sans: "DM Sans", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --sidebar: 244px;
  --content: 1180px;
  --shadow: 0 20px 60px rgba(37, 39, 32, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.editor-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

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

::selection {
  color: var(--white);
  background: var(--orange);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 8px 12px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-80px);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 34px 30px 28px;
  border-right: 1px solid var(--line);
  background: rgba(244, 241, 233, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: flex-start;
  gap: 2px;
  background: transparent;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.07em;
}

.brand-mark {
  color: var(--orange);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

.brand-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 70px;
}

.nav-link {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-link::before {
  width: 0;
  height: 1px;
  background: var(--ink);
  content: "";
  transition: width 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  transform: translateX(2px);
}

.nav-link.active::before {
  width: 16px;
}

.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sidebar-actions {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.new-post-button,
.outline-button,
.primary-button,
.text-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease,
    border-color 180ms ease;
}

.new-post-button {
  min-height: 44px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
}

.new-post-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  background: var(--orange);
}

.manage-link {
  padding: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.manage-link:hover {
  color: var(--ink);
}

.mobile-header {
  display: none;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.page {
  animation: page-in 520ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-wrap {
  width: min(calc(100% - 72px), var(--content));
  margin: 0 auto;
}

.home-hero {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  gap: clamp(44px, 7vw, 100px);
  align-items: center;
  padding: 64px 0 82px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 24px;
  height: 1px;
  background: currentColor;
  content: "";
}

.hero-copy h1 {
  max-width: 510px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(45px, 5.2vw, 77px);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 1.15;
}

.hero-copy h1 em {
  position: relative;
  color: var(--orange);
  font-style: normal;
}

.hero-description {
  max-width: 390px;
  margin: 34px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
}

.hero-feature {
  position: relative;
  min-height: 486px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 4px;
  background: var(--sage-light);
  cursor: pointer;
  isolation: isolate;
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.hero-feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.hero-feature::before {
  position: absolute;
  z-index: -1;
  top: -12%;
  right: -7%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sage);
  content: "";
}

.hero-feature::after {
  position: absolute;
  z-index: -1;
  right: 14%;
  bottom: -25%;
  width: 44%;
  aspect-ratio: 0.58;
  border: 1px solid rgba(29, 33, 28, 0.28);
  border-radius: 50%;
  content: "";
  transform: rotate(29deg);
}

.feature-index {
  position: absolute;
  right: 22px;
  bottom: -50px;
  color: rgba(29, 33, 28, 0.07);
  font-family: var(--serif);
  font-size: 220px;
  font-weight: 700;
  line-height: 1;
}

.feature-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-title {
  max-width: 550px;
  margin: 146px 0 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 41px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.38;
}

.feature-bottom {
  position: absolute;
  right: clamp(28px, 4vw, 48px);
  bottom: 34px;
  left: clamp(28px, 4vw, 48px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(29, 33, 28, 0.25);
  padding-top: 18px;
}

.feature-bottom p {
  display: -webkit-box;
  max-width: 390px;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.round-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.hero-feature:hover .round-arrow,
.post-row:hover .round-arrow {
  background: var(--ink);
  color: var(--white);
  transform: rotate(-35deg);
}

.home-section {
  padding: 88px 0 100px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.section-heading h2,
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.post-list {
  border-top: 1px solid var(--ink);
}

.post-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 145px 42px;
  gap: 24px;
  align-items: center;
  padding: 32px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding 220ms ease, background 220ms ease;
}

.post-row:hover {
  padding-right: 14px;
  padding-left: 14px;
  background: rgba(251, 250, 246, 0.55);
}

.post-number {
  align-self: start;
  padding-top: 8px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.post-row-content h3 {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.48;
}

.post-row-content p {
  display: -webkit-box;
  max-width: 700px;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-category,
.article-category {
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.post-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  text-align: right;
}

.post-meta span {
  display: block;
}

.empty-state {
  padding: 80px 20px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 25px;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 42px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer-motto {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
}

.footer-meta {
  margin: 7px 0 0;
}

.footer-top {
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.footer-top:hover {
  color: var(--ink);
}

/* common inner pages */
.inner-page {
  min-height: calc(100vh - 100px);
  padding: 90px 0 100px;
}

.page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  padding-bottom: 46px;
  border-bottom: 1px solid var(--ink);
}

.page-head-copy {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
}

.page-count {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--line);
}

.topic-card {
  position: relative;
  min-height: 270px;
  padding: 30px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 200ms ease, color 200ms ease;
}

.topic-card:hover,
.topic-card.selected {
  background: var(--ink);
  color: var(--white);
}

.topic-card-index {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
}

.topic-card h2 {
  margin: 74px 0 8px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.topic-card svg {
  position: absolute;
  right: 28px;
  bottom: 28px;
}

.filtered-posts {
  padding-top: 72px;
}

.filtered-title {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
}

/* archive */
.archive-body {
  padding-top: 60px;
}

.archive-year {
  display: grid;
  grid-template-columns: 130px 1fr;
  margin-bottom: 74px;
}

.archive-year > h2 {
  position: sticky;
  top: 40px;
  height: fit-content;
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
}

.archive-month {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 22px;
  padding: 0 0 38px;
}

.archive-month-label {
  padding-top: 6px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.archive-items {
  border-top: 1px solid var(--line-strong);
}

.archive-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  width: 100%;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.archive-item:hover .archive-item-title {
  color: var(--orange);
}

.archive-day,
.archive-item-category {
  color: var(--muted);
  font-size: 11px;
}

.archive-item-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.025em;
  transition: color 160ms ease;
}

/* about */
.about-layout {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 9vw;
  padding-top: 70px;
}

.about-art {
  position: sticky;
  top: 60px;
  min-height: 490px;
  overflow: hidden;
  background: var(--orange-soft);
}

.about-art::before {
  position: absolute;
  top: 13%;
  left: 15%;
  width: 68%;
  aspect-ratio: 1;
  border: 1px solid rgba(29, 33, 28, 0.45);
  border-radius: 50%;
  content: "";
}

.about-art::after {
  position: absolute;
  right: -17%;
  bottom: -10%;
  width: 70%;
  aspect-ratio: 0.6;
  border-radius: 50% 50% 0 0;
  background: var(--orange);
  content: "";
  transform: rotate(-22deg);
}

.about-art span {
  position: absolute;
  z-index: 1;
  bottom: 24px;
  left: 28px;
  font-family: var(--serif);
  font-size: 11px;
}

.about-prose h2 {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.45;
}

.about-prose p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
}

.about-rules {
  display: grid;
  gap: 0;
  margin-top: 58px;
  border-top: 1px solid var(--ink);
}

.about-rule {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.about-rule strong {
  font-size: 13px;
}

.about-rule span {
  color: var(--orange);
  font-family: var(--serif);
  font-size: 11px;
}

/* article */
.reading-progress {
  position: fixed;
  z-index: 80;
  top: 0;
  left: var(--sidebar);
  width: 0;
  height: 3px;
  background: var(--orange);
}

.article-page {
  padding-bottom: 110px;
}

.article-head {
  padding: 100px 0 72px;
  border-bottom: 1px solid var(--line);
}

.article-head-inner {
  width: min(calc(100% - 72px), 960px);
  margin: 0 auto;
  text-align: center;
}

.article-head h1 {
  margin: 22px auto 28px;
  font-family: var(--serif);
  font-size: clamp(36px, 5.4vw, 67px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1.35;
}

.article-deck {
  max-width: 710px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 11px;
}

.article-body-wrap {
  position: relative;
  width: min(calc(100% - 72px), 1000px);
  margin: 0 auto;
  padding-top: 78px;
}

.article-body {
  width: min(100%, 700px);
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.018em;
  line-height: 2.05;
  word-break: keep-all;
}

.article-body > p:first-child::first-letter {
  float: left;
  margin: 10px 10px 0 0;
  color: var(--orange);
  font-family: var(--serif);
  font-size: 68px;
  font-weight: 600;
  line-height: 0.8;
}

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

.article-body h2 {
  margin: 72px 0 25px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.5;
}

.article-body h3 {
  margin: 48px 0 20px;
  font-size: 22px;
  font-weight: 600;
}

.article-body blockquote {
  margin: 54px -70px;
  padding: 30px 50px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 24px;
  line-height: 1.75;
  text-align: center;
}

.article-body blockquote p {
  margin: 0;
}

.article-body ul,
.article-body ol {
  margin: 22px 0 34px;
  padding-left: 28px;
}

.article-body li {
  margin: 8px 0;
}

.article-body a {
  border-bottom: 1px solid var(--orange);
  color: var(--orange);
}

.article-body img,
.content-editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 44px auto;
}

.article-body hr {
  width: 45px;
  height: 1px;
  margin: 64px auto;
  border: 0;
  background: var(--ink);
}

.article-aside {
  position: absolute;
  top: 86px;
  left: 0;
  display: grid;
  gap: 8px;
  width: 90px;
  color: var(--muted);
  font-size: 10px;
}

.article-aside::before {
  width: 30px;
  height: 1px;
  margin-bottom: 5px;
  background: var(--line-strong);
  content: "";
}

.article-tags {
  display: flex;
  width: min(calc(100% - 72px), 700px);
  flex-wrap: wrap;
  gap: 8px;
  margin: 68px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.tag {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  font-size: 11px;
}

.article-actions {
  display: flex;
  width: min(calc(100% - 72px), 700px);
  justify-content: space-between;
  margin: 28px auto 0;
}

.text-button {
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.text-button:hover {
  color: var(--orange);
}

.next-article {
  width: min(calc(100% - 72px), 960px);
  margin: 100px auto 0;
  padding: 45px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  cursor: pointer;
  text-align: center;
}

.next-article span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.next-article h3 {
  max-width: 720px;
  margin: 18px auto 0;
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.5;
  transition: color 180ms ease;
}

.next-article:hover h3 {
  color: var(--orange);
}

/* studio */
.studio-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.outline-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.primary-button {
  background: var(--ink);
  color: var(--white);
}

.outline-button {
  border: 1px solid var(--line-strong);
  background: transparent;
}

.outline-button:hover {
  border-color: var(--ink);
  background: var(--white);
}

.studio-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 34px 0 54px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.summary-cell {
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-cell strong {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.summary-cell span {
  color: var(--muted);
  font-size: 11px;
}

.studio-table {
  border-top: 1px solid var(--ink);
}

.studio-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 110px 110px;
  gap: 20px;
  align-items: center;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--sage-light);
  font-size: 10px;
}

.status-pill.draft {
  background: var(--paper-deep);
  color: var(--muted);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.studio-title {
  overflow: hidden;
}

.studio-title strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-title small,
.studio-date {
  color: var(--muted);
  font-size: 10px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.icon-button.danger:hover {
  border-color: #a74837;
  color: #a74837;
}

/* editor */
.editor-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  background: var(--white);
  animation: editor-in 360ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes editor-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.editor-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(12px);
}

.editor-brand {
  justify-self: start;
  background: transparent;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.save-state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

.save-state.saving .save-state-dot {
  animation: pulse 800ms ease infinite alternate;
  background: var(--orange);
}

@keyframes pulse {
  to {
    opacity: 0.25;
  }
}

.editor-top-actions {
  display: flex;
  justify-self: end;
  gap: 8px;
}

.editor-top-actions .outline-button,
.editor-top-actions .primary-button {
  min-height: 36px;
  padding: 0 14px;
}

.editor-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 290px;
}

.editor-main {
  min-width: 0;
  overflow-y: auto;
  background: var(--white);
}

.editor-paper {
  width: min(calc(100% - 80px), 760px);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 72px 0 160px;
}

.editor-title,
.editor-deck {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: transparent;
}

.editor-title {
  min-height: 76px;
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1.35;
}

.editor-title::placeholder,
.editor-deck::placeholder {
  color: #c5c3bd;
}

.editor-deck {
  min-height: 60px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
}

.format-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 2px;
  margin: 28px 0 42px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 250, 246, 0.94);
  box-shadow: 0 8px 24px rgba(29, 33, 28, 0.07);
  backdrop-filter: blur(8px);
}

.tool-button {
  display: grid;
  min-width: 32px;
  height: 30px;
  place-items: center;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 12px;
}

.tool-button:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.tool-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--line);
}

.content-editor {
  min-height: 470px;
  outline: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 2;
}

.content-editor:empty::before {
  color: #b9b7b0;
  content: attr(data-placeholder);
  pointer-events: none;
}

.content-editor p {
  margin: 0 0 25px;
}

.content-editor h2 {
  margin: 54px 0 20px;
  font-size: 27px;
  line-height: 1.5;
}

.content-editor h3 {
  margin: 40px 0 16px;
  font-size: 21px;
}

.content-editor blockquote {
  margin: 40px 0;
  padding: 22px 28px;
  border-left: 3px solid var(--orange);
  background: var(--paper);
}

.editor-side {
  overflow-y: auto;
  padding: 28px 24px;
  border-left: 1px solid var(--line);
  background: var(--paper);
}

.editor-side h2 {
  margin: 0 0 28px;
  font-size: 12px;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.field label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: var(--white);
  font-size: 12px;
}

.field input:focus,
.field select:focus {
  border-color: var(--ink);
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.cover-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cover-swatch {
  aspect-ratio: 1.3;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.cover-swatch[data-cover="sage"] {
  background: var(--sage-light);
}

.cover-swatch[data-cover="orange"] {
  background: var(--orange-soft);
}

.cover-swatch[data-cover="charcoal"] {
  background: #bdc0b9;
}

.cover-swatch.selected {
  border-color: var(--ink);
}

.editor-tip {
  margin-top: 34px;
  padding: 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.75;
}

.editor-tip strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

/* preview */
.preview-layer {
  position: fixed;
  z-index: 200;
  inset: 0;
  overflow-y: auto;
  background: var(--paper);
  animation: page-in 300ms ease both;
}

.preview-bar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  height: 55px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 233, 0.94);
  backdrop-filter: blur(12px);
}

.preview-bar span {
  color: var(--muted);
  font-size: 11px;
}

.preview-article .article-head {
  padding-top: 76px;
}

/* search */
.search-wrap {
  padding: 10px 0 50px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ink);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 27px;
}

.search-field input::placeholder {
  color: #b4b2aa;
}

.search-result-copy {
  margin: 28px 0;
  color: var(--muted);
  font-size: 11px;
}

.not-found {
  display: grid;
  min-height: 70vh;
  place-items: center;
  text-align: center;
}

.not-found strong {
  display: block;
  color: var(--orange);
  font-family: var(--serif);
  font-size: 100px;
  line-height: 1;
}

.not-found h1 {
  margin: 20px 0 8px;
  font-family: var(--serif);
}

.not-found p {
  margin: 0 0 24px;
  color: var(--muted);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.boot-screen .brand {
  animation: pulse 800ms ease infinite alternate;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px 22px;
}

.login-card {
  width: min(100%, 470px);
  padding: clamp(34px, 6vw, 58px);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-card > .brand {
  margin-bottom: 62px;
}

.login-card h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 47px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.4;
}

.login-copy {
  margin: 18px 0 36px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.8;
}

.login-card form {
  display: grid;
}

.login-card form label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.login-card form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  background: transparent;
}

.login-card form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(214, 101, 67, 0.12);
}

.login-card form .primary-button {
  width: 100%;
  margin-top: 8px;
}

.login-card form .primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.login-error {
  min-height: 22px;
  margin: 7px 0 0;
  color: #a74837;
  font-size: 10px;
}

.login-card > .text-button {
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 500;
  right: 26px;
  bottom: 26px;
  max-width: 340px;
  padding: 13px 17px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

svg {
  display: block;
}

@media (max-width: 1120px) {
  :root {
    --sidebar: 210px;
  }

  .sidebar {
    padding-right: 24px;
    padding-left: 24px;
  }

  .home-hero {
    grid-template-columns: 1fr 1.15fr;
    gap: 45px;
  }

  .hero-feature {
    min-height: 455px;
  }

  .article-aside {
    display: none;
  }

  .editor-workspace {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar: 0px;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    height: 62px;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 241, 233, 0.93);
    backdrop-filter: blur(12px);
  }

  .mobile-header .brand {
    font-size: 22px;
  }

  .mobile-actions {
    display: flex;
    gap: 7px;
  }

  .mobile-actions .icon-button {
    width: 35px;
    height: 35px;
  }

  .mobile-menu {
    position: fixed;
    z-index: 35;
    inset: 62px 0 auto;
    display: grid;
    padding: 20px 22px 26px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 20px 45px rgba(29, 33, 28, 0.1);
    transform: translateY(-120%);
    transition: transform 260ms ease;
  }

  .mobile-menu.open {
    transform: translateY(0);
  }

  .mobile-menu .nav-link {
    padding: 12px 0;
  }

  .page-wrap {
    width: min(calc(100% - 44px), var(--content));
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 72px 0;
  }

  .hero-copy h1 {
    max-width: 580px;
  }

  .hero-description {
    margin-top: 24px;
  }

  .hero-feature {
    min-height: 470px;
  }

  .post-row {
    grid-template-columns: 36px minmax(0, 1fr) 120px;
  }

  .post-row .round-arrow {
    display: none;
  }

  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-art {
    position: relative;
    top: auto;
    min-height: 400px;
  }

  .article-body blockquote {
    margin-right: 0;
    margin-left: 0;
  }

  .reading-progress {
    left: 0;
  }

  .editor-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-side {
    position: fixed;
    z-index: 4;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 290px;
    box-shadow: -20px 0 40px rgba(29, 33, 28, 0.1);
    transform: translateX(105%);
    transition: transform 220ms ease;
  }

  .editor-side.open {
    transform: translateX(0);
  }

  .editor-meta-toggle {
    display: inline-flex !important;
  }
}

@media (max-width: 620px) {
  .page-wrap {
    width: calc(100% - 36px);
  }

  .home-hero {
    gap: 46px;
    padding: 56px 0;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .hero-feature {
    min-height: 430px;
    padding: 24px;
  }

  .feature-title {
    margin-top: 124px;
    font-size: 28px;
  }

  .feature-bottom {
    right: 24px;
    bottom: 24px;
    left: 24px;
  }

  .feature-index {
    font-size: 170px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .home-section {
    padding: 70px 0 80px;
  }

  .post-row {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 10px;
    padding: 26px 0;
  }

  .post-meta {
    grid-column: 2;
    text-align: left;
  }

  .post-meta span {
    display: inline;
  }

  .post-meta span + span::before {
    margin: 0 6px;
    content: "·";
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .inner-page {
    padding-top: 62px;
  }

  .page-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 220px;
  }

  .archive-year {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .archive-year > h2 {
    position: static;
  }

  .archive-month {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .archive-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .archive-item-category {
    grid-column: 2;
  }

  .article-head {
    padding: 64px 0 52px;
  }

  .article-head-inner,
  .article-body-wrap,
  .article-tags,
  .article-actions,
  .next-article {
    width: calc(100% - 36px);
  }

  .article-head h1 {
    font-size: 36px;
  }

  .article-deck {
    font-size: 14px;
  }

  .article-body-wrap {
    padding-top: 54px;
  }

  .article-body {
    font-size: 16.5px;
    line-height: 2;
    word-break: normal;
  }

  .article-body h2 {
    margin-top: 56px;
    font-size: 25px;
  }

  .article-body blockquote {
    padding: 24px 18px;
    font-size: 20px;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .studio-actions {
    width: 100%;
  }

  .studio-summary {
    grid-template-columns: 1fr;
  }

  .studio-row {
    grid-template-columns: 80px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .studio-date {
    display: none;
  }

  .editor-topbar {
    grid-template-columns: auto 1fr;
    padding: 0 12px;
  }

  .save-state {
    display: none;
  }

  .editor-top-actions {
    gap: 4px;
  }

  .editor-top-actions .outline-button,
  .editor-top-actions .primary-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .editor-paper {
    width: calc(100% - 36px);
    padding-top: 48px;
  }

  .editor-title {
    font-size: 37px;
  }

  .format-toolbar {
    max-width: 100%;
    overflow-x: auto;
  }

  .editor-side {
    width: min(88vw, 310px);
  }

  .preview-bar {
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
