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

:root {
  --bg: #ece4d0;
  --text: #111;
  --text-muted: #5a5a5a;
  --accent: #111;
  --code-bg: #ddd4bd;
  --border: #b8af96;
  --bar-color: #111;
  --max-w: 640px;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Page frame with crop marks */
.page-frame {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  position: relative;
}
.page-frame::before,
.page-frame::after {
  content: '—';
  position: fixed;
  color: var(--text);
  font-size: 0.9rem;
  letter-spacing: -2px;
}
.page-frame::before { top: 20px; left: 24px; }
.page-frame::after { top: 20px; right: 24px; }

.corner-bl, .corner-br {
  position: fixed;
  bottom: 20px;
  color: var(--text);
  font-size: 0.9rem;
  letter-spacing: -2px;
}
.corner-bl { left: 24px; }
.corner-br { right: 24px; }

/* Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  padding: 60px 0 0;
  margin-bottom: 8px;
}
.site-id {
  font-size: 0.75rem;
  color: var(--text);
  margin-bottom: 32px;
  line-height: 1.4;
}
.site-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  display: block;
  text-transform: uppercase;
}
.site-title:hover { opacity: 0.7; }

/* Bar divider */
.bar {
  display: flex;
  gap: 8px;
  margin: 12px 0 6px;
}
.bar-fill {
  height: 8px;
  background: var(--bar-color);
  flex: 3;
}
.bar-short {
  height: 8px;
  background: var(--bar-color);
  flex: 1;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--text);
  margin: 6px 0 32px;
}

/* Index */
.index-intro {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-weight: 400;
}
.article-list { list-style: none; }
.article-list li {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.article-list li:first-child { border-top: 1px solid var(--border); }
.article-list a {
  text-decoration: none;
  display: block;
  color: var(--text);
}
.article-list .num {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.article-list .title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.article-list a:hover .title { opacity: 0.5; }
.article-list .summary {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: justify;
}

/* Article */
article { padding-bottom: 60px; }
article h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}
article h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  text-transform: uppercase;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}
article p {
  margin-bottom: 18px;
  font-size: 0.82rem;
  text-align: justify;
}
article ul, article ol {
  margin-bottom: 18px;
  padding-left: 20px;
  font-size: 0.82rem;
}
article li {
  margin-bottom: 4px;
  text-align: justify;
}
article strong {
  font-weight: 700;
}

/* Generative art */
#gen-art {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin-bottom: 32px;
}

/* Code */
code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 2px;
}
pre {
  background: var(--code-bg);
  border-left: 3px solid var(--text);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.5;
  position: relative;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.78rem;
}

/* Copy button */
pre .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  font-family: var(--mono);
}
pre:hover .copy-btn { opacity: 1; }
pre .copy-btn:hover { color: var(--text); border-color: var(--text); }
pre .copy-btn.copied { color: #2d7d46; border-color: #2d7d46; }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.78rem;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Back link */
.back {
  display: inline-block;
  margin-bottom: 32px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
}
.back:hover { color: var(--text); }
.back::before { content: '← '; }

/* Footer */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.7rem;
}
.email-img {
  display: block;
  height: 11px;
  margin-top: 8px;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 15px; }
  header { padding: 40px 0 0; }
  .container { padding: 0 16px; }
  article h1 { font-size: 1.4rem; }
  .site-title { font-size: 1.8rem; }
  pre { padding: 12px 14px; }
  .page-frame::before, .page-frame::after,
  .corner-bl, .corner-br { display: none; }
}
