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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
	font-size: 18px;
  background: #060818;
  color: #f5f5f7;
  line-height: 1.6;
  padding: 2rem 1rem 4rem;
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === LAYOUT === */
.page {
  max-width: 1100px;
  margin: 0 auto;
}

header {
  margin-bottom: 2.5rem;
  text-align: center;
}

header h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

header p {
  max-width: 50rem;
  color: #cbd5f5;
  margin: 0 auto;
}

/* === TABLE OF CONTENTS === */
.toc {
  margin-bottom: 2.5rem;
  padding: 1.25rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.toc h2 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.toc ol {
  list-style: decimal;
  padding-left: 1.25rem;
  column-count: 2;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
}

.toc li + li {
  margin-top: 0.25rem;
}

.toc a {
  font-size: 0.96rem;
}

/* === ART SECTIONS === */
.art-piece {
  margin-bottom: 2.75rem;
  padding: 1.75rem 1.25rem;
  border-radius: 1rem;
  background: radial-gradient(circle at top left, #1e293b, #020617);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.art-header {
  margin-bottom: 1.25rem;
}

.art-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.art-title {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.art-title span.art-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
}

.art-title span.art-number {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 500;
}

.art-description {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.art-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: stretch;
}

/* ART PREVIEW BOX */
.art-preview {
  border-radius: 0.9rem;
  background: radial-gradient(circle at top, #0f172a, #020617);
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

/* ART CODE BLOCK / CONTROLS */
.art-code {
  border-radius: 0.9rem;
  background: #020617;
  border: 1px solid rgba(30, 64, 175, 0.8);
  padding: 0.9rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.86rem;
}

.art-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.art-code-header span {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  color: #9ca3af;
  font-size: 0.78rem;
}

.code-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

button.copy-btn,
button.collapse-btn {
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  background: rgba(37, 99, 235, 0.12);
  color: #e5e7eb;
  transition: background 0.15s ease, transform 0.08s ease;
}

button.collapse-btn {
  background: rgba(148, 163, 184, 0.14);
}

button.copy-btn:hover,
button.collapse-btn:hover {
  background: rgba(59, 130, 246, 0.22);
}

button.collapse-btn:hover {
  background: rgba(148, 163, 184, 0.26);
}

button.copy-btn:active,
button.collapse-btn:active {
  transform: scale(0.97);
}

details.code-details {
  background: #020617;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.9);
}

details.code-details[open] summary::after {
  transform: rotate(90deg);
}

details.code-details summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem 0.5rem 0.5rem 0.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #9ca3af;
  background: #020617;
}

details.code-details summary::-webkit-details-marker {
  display: none;
}

details.code-details summary span.label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

details.code-details summary::after {
  content: "▶";
  font-size: 0.7rem;
  transition: transform 0.15s ease;
  opacity: 0.8;
}

.code-body {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
}

pre {
  margin: 0;
  padding: 0.75rem 0.9rem 0.85rem;
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  background: #020617;
  color: #e5e7eb;
  white-space: pre;
}

code {
  white-space: pre;
}

.code-body::-webkit-scrollbar {
  width: 6px;
}

.code-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

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

  .art-piece {
    padding: 1.5rem 1.1rem;
  }

  .art-preview {
    min-height: 200px;
  }

  .toc ol {
    column-count: 1;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.6rem;
  }
}
