:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-card: #fbf9f4;
  --paper-subtle: #ebe5d8;
  --ink: #242520;
  --ink-soft: #484740;
  --quiet: #66655d;
  --accent: #aa472e;
  --accent-soft: rgba(170, 71, 46, 0.1);
  --line: #d4cfc3;
  --line-dark: #282923;
  --serif: "AppleMyungjo", "Noto Serif KR", "Nanum Myeongjo", "Batang", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="celadon"] {
  --paper: #eaefe8;
  --paper-card: #f4f7f2;
  --paper-subtle: #dce4d9;
  --ink: #1e2822;
  --ink-soft: #3f4e45;
  --quiet: #5d6c62;
  --accent: #2e6b4e;
  --accent-soft: rgba(46, 107, 78, 0.12);
  --line: #c5d0c1;
  --line-dark: #1e2822;
}

[data-theme="night"] {
  color-scheme: dark;
  --paper: #151513;
  --paper-card: #1e1e1b;
  --paper-subtle: #272723;
  --ink: #ece8de;
  --ink-soft: #c4bfb2;
  --quiet: #918d82;
  --accent: #de7a5e;
  --accent-soft: rgba(222, 122, 94, 0.15);
  --line: #32312c;
  --line-dark: #57554d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.78;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.24em; }
button, input, select, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}
::selection { background: var(--accent); color: #fff; }

.skip {
  position: absolute;
  top: -100px;
  left: 24px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap {
  width: min(1184px, calc(100% - 88px));
  margin-inline: auto;
}

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 92px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: background-color 0.3s ease;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 18px;
}
.brand-mark {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
.brand-address {
  font-size: 12px;
  font-weight: 400;
  color: var(--quiet);
  letter-spacing: 0.015em;
  margin-left: 6px;
}

.nav-center {
  display: flex;
  gap: 26px;
  font-size: 13px;
}
.nav-center a { text-decoration: none; color: var(--ink-soft); }
.nav-center a:hover { color: var(--accent); text-decoration: underline; }

.masthead-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-pill {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--paper-card);
  border-radius: 100px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}
.tool-pill:hover, .tool-pill.active {
  border-color: var(--accent);
  color: var(--accent);
}
.write-btn {
  padding: 7px 15px;
  border-radius: 100px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.write-btn:hover { opacity: 0.9; }

/* Hero */
.hero { padding: 38px 0 48px; }
.edition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0.09em;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.edition span:last-child { letter-spacing: 0.02em; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 50px 0 56px;
}
h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(72px, 9.2vw, 136px);
  font-weight: 400;
  letter-spacing: -0.09em;
  line-height: 1.1;
}
h1 span { display: block; }
h1 span:last-child { padding-left: 0.55em; }

.hero-side {
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 80px 0 7px;
}
.paper-sun {
  position: absolute;
  width: 174px;
  height: 174px;
  top: 0;
  right: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  transition: transform 0.6s ease;
}
.hero-side:hover .paper-sun { transform: rotate(14deg) scale(1.03); }
.paper-sun::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.paper-sun::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -38px;
  right: -38px;
  border-top: 1px solid var(--paper);
  transform: rotate(-25deg);
}
.hero-line {
  position: relative;
  max-width: 345px;
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 33px);
  line-height: 1.62;
  letter-spacing: -0.05em;
}
.hero-description {
  margin: 0;
  color: var(--quiet);
  font-size: 14px;
  max-width: 390px;
}
.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.status-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.text-link {
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  gap: 16px;
  align-items: center;
}
.text-link:hover { color: var(--accent); }

/* Cover Story Banner */
.cover-story {
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 38px 42px;
  margin-bottom: 56px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 36px;
  align-items: center;
}
.cover-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.cover-story h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.045em;
  margin: 0 0 14px;
}
.cover-excerpt {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.9;
  margin: 0 0 22px;
}
.cover-quote {
  margin: 0;
  border-left: 2px solid var(--accent);
  padding-left: 22px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.82;
  color: var(--ink-soft);
}

/* Archive Section */
section { scroll-margin-top: 96px; }
.archive-section {
  padding: 58px 0;
  border-top: 1px solid var(--line-dark);
}
.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}
.section-label {
  margin: 0 0 8px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 400;
}
.section-label span {
  color: var(--accent);
  margin-right: 16px;
  font-size: 11px;
  font-weight: 700;
}
.archive-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.7vw, 36px);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.archive-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cat-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-tab {
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.cat-tab.active, .cat-tab:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-input {
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: var(--paper-card);
  font-size: 13px;
  min-width: 220px;
}

.essay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.essay-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease;
}
.essay-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.essay-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--quiet);
}
.essay-cat { color: var(--accent); font-weight: 600; }
.essay-card h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.48;
  letter-spacing: -0.035em;
  margin: 12px 0 10px;
}
.essay-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--quiet);
  line-height: 1.85;
}
.essay-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}
.essay-open-label {
  color: var(--accent);
  font-weight: 600;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  text-align: center;
  color: var(--quiet);
  border: 1px dashed var(--line);
}

/* Interactive Split: Quote of the Day & Journal */
.interactive-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 32px;
  padding: 56px 0;
  border-top: 1px solid var(--line-dark);
}
.quote-box, .journal-box {
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quote-text {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.72;
  letter-spacing: -0.035em;
  margin: 18px 0 14px;
}
.quote-author {
  font-size: 13px;
  color: var(--quiet);
  margin: 0 0 24px;
}
.quote-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.journal-heading {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
}
.journal-sub {
  margin: 0;
  font-size: 13px;
  color: var(--quiet);
}
.journal-form {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.journal-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
}
.journal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 210px;
  overflow-y: auto;
}
.journal-item {
  padding: 10px 14px;
  background: var(--paper);
  border-left: 2px solid var(--accent);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.journal-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--quiet);
  white-space: nowrap;
}
.journal-del {
  border: none;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  padding: 2px 5px;
  font-size: 12px;
}
.journal-del:hover { color: var(--accent); }

/* Notice & Space Info */
.notice {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.85fr 1.7fr;
  gap: 48px;
  padding: 46px 0 64px;
}
.note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.note h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.note p { margin: 0; font-size: 13px; color: var(--quiet); line-height: 1.9; }
.note .small-status { color: var(--accent); font-size: 12px; margin-bottom: 8px; font-weight: 600; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.68);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
}
.modal-backdrop.open { display: grid; }
.reader-sheet {
  width: min(780px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper-card);
  border: 1px solid var(--line-dark);
  padding: 42px 48px;
  position: relative;
}
.reader-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.reader-meta-accent {
  color: var(--accent);
  font-weight: 600;
}
.reader-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.reader-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 10px;
}
.reader-date {
  font-size: 13px;
  color: var(--quiet);
  margin: 0 0 28px;
}
.reader-body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.05;
  color: var(--ink-soft);
  white-space: pre-line;
}

.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-size: 12px;
  color: var(--quiet);
  margin-bottom: 5px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
}
.manuscript-counter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin: 6px 0 16px;
}
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

footer {
  padding: 25px 0 34px;
  border-top: 1px solid var(--line-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.footer-name { margin: 0; font-family: var(--serif); font-size: 18px; letter-spacing: -0.05em; }
.footer-address { margin: 1px 0 0; color: var(--quiet); font-size: 11px; letter-spacing: 0.03em; }
footer a { color: var(--quiet); font-size: 11px; text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 920px) {
  .wrap { width: calc(100% - 48px); }
  .hero-grid, .cover-story, .interactive-split, .notice { grid-template-columns: 1fr; gap: 28px; }
  .essay-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-center { display: none; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .essay-grid, .note { grid-template-columns: 1fr; }
  .reader-sheet { padding: 28px 20px; }
  .cover-story { padding: 26px 20px; }
}
