/* sekai — toni's atelier
   editorial, warm, honest. paper metaphor, serif voice. */

:root {
  --paper: #f5f1ea;
  --paper-dark: #ebe5db;
  --ink: #2a2520;
  --ink-soft: #5a5249;
  --muted: #8a8178;
  --border: #d8d0c4;
  --accent: #a0522d;
  --accent-soft: #c47d5e;
  --grave: #9a9188;

  --status-incubating: #8a8178;
  --status-drafting: #a0522d;
  --status-revising: #7a5c3a;
  --status-done: #4a6b3a;
  --status-buried: #5a5249;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;

  --measure: 38rem;
  --wide-measure: 52rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- header --- */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 2rem;
}
nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: var(--wide-measure);
  margin: 0 auto;
}
.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.sig {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* --- main --- */
main {
  max-width: var(--wide-measure);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* --- intro --- */
.atelier-intro {
  margin-bottom: 4rem;
}
.atelier-intro h1 {
  font-family: var(--serif);
  font-size: 3.5rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.lede {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 32rem;
  line-height: 1.5;
}

/* --- sections --- */
section {
  margin-bottom: 4rem;
}
section > h2 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* --- piece list items --- */
.piece-item {
  margin-bottom: 2rem;
}
.piece-item a.title {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 0.3rem;
}
.piece-item a.title:hover { color: var(--accent); }
.piece-item .meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.piece-item .summary {
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 34rem;
}

/* --- graveyard --- */
.graves .piece-item .title {
  font-size: 1.1rem;
  color: var(--grave);
  text-decoration: line-through;
  text-decoration-color: var(--border);
}
.graves .piece-item .summary {
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- status badge --- */
.status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--status-incubating);
}
.status-incubating { color: var(--status-incubating); }
.status-drafting   { color: var(--status-drafting); }
.status-revising   { color: var(--status-revising); }
.status-done       { color: var(--status-done); }
.status-buried     { color: var(--status-buried); }

/* --- piece detail --- */
.piece-detail {
  max-width: var(--measure);
}
.piece-header {
  margin-bottom: 3rem;
}
.piece-header h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.piece-header .meta-line {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.piece-detail h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--ink);
}
.piece-detail h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
}
.piece-detail p {
  margin-bottom: 1.2rem;
}
.piece-detail blockquote {
  border-left: 2px solid var(--accent-soft);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
}
.piece-detail code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-dark);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.piece-detail pre {
  background: var(--paper-dark);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}
.piece-detail pre code {
  background: none;
  padding: 0;
}
.piece-detail a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}
.piece-detail a:hover {
  border-bottom-color: var(--accent);
}

/* --- prose styling for markdown content --- */
.prose {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
}
.prose h1 { font-size: 1.8rem; margin-bottom: 1rem; font-weight: 400; }
.prose h2 { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 0.8rem; font-weight: 400; }
.prose h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: 0.5rem; font-weight: 400; }
.prose p { margin-bottom: 1.2rem; }
.prose ul, .prose ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.3rem; }
.prose blockquote {
  border-left: 2px solid var(--accent-soft);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--ink-soft);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-dark);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.prose pre {
  background: var(--paper-dark);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.prose pre code { background: none; padding: 0; }
.prose a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); text-decoration: none; }
.prose img { max-width: 100%; border-radius: 6px; margin: 1.5rem 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* --- details (context, journal) --- */
details {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--paper-dark);
  border-radius: 6px;
  border: 1px solid var(--border);
}
details + details { margin-top: 1rem; }
details summary {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: 0.03em;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "→ "; color: var(--accent-soft); }
details[open] summary::before { content: "↓ "; }
details[open] { padding: 1.5rem; }
details .prose {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- journal entries --- */
.journal-entry {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border);
}
.journal-entry:last-child { border-bottom: none; }
.journal-entry .entry-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

/* --- done section --- */
.done-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--paper-dark);
  border-radius: 6px;
  border-left: 3px solid var(--status-done);
}
.done-section.buried { border-left-color: var(--status-buried); }

/* --- footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }

/* --- responsive --- */
@media (max-width: 640px) {
  .atelier-intro h1 { font-size: 2.5rem; }
  .piece-header h1 { font-size: 1.8rem; }
  main { padding: 2rem 1.2rem 3rem; }
  nav { flex-direction: column; gap: 0.3rem; }
  .lede { font-size: 1rem; }
}

/* --- motion --- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}