/* ─── 作品ページ共通 (masamune-jimbaori / railsgirls-logo) ── */

body { line-height: 1.75; }
a:hover { text-decoration-color: var(--ink); }
::selection { background: var(--pale); color: #1a1a1a; }
footer .egg { background: var(--pale); }

/* Header */
.head {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kicker {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin: 0;
}
.kicker .egg {
  display: inline-block; width: 9px; height: 11px; vertical-align: -1px;
  background: var(--pale);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  margin: 0 8px 0 0;
}
h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .005em;
}
.inspiration {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px dashed var(--hair);
  border-radius: 14px;
  background: color-mix(in oklab, var(--cream-2) 50%, transparent);
  font-size: 13.5px;
  color: var(--ink-muted);
}
.inspiration b {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
  margin-right: 8px;
}
.inspiration a { color: var(--ink); }

/* Stage */
.stage-wrap {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.stage {
  position: relative;
  width: var(--canvas-w);
  height: var(--canvas-h);
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--hair);
  background: var(--ink-muted);
  aspect-ratio: 1 / 1;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: manipulation;
}
.stage::after {
  content: ""; position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 0 30px 60px -30px rgba(0,0,0,.4);
  border-radius: inherit;
}
.hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.18);
  padding: 10px 18px;
  border-radius: 999px;
  letter-spacing: .04em;
  pointer-events: none;
  transition: opacity .35s ease;
}
.hint.hide { opacity: 0; }

/* Controls */
.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  width: var(--canvas-w);
  max-width: 100%;
  justify-content: space-between;
}
.palette {
  display: flex; align-items: center; gap: 10px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.palette ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 6px;
}
.palette li {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  box-shadow: 0 1px 0 rgba(0,0,0,.25) inset;
  transition: transform .2s ease, box-shadow .2s ease;
}
.palette li.active {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--pale), 0 1px 0 rgba(0,0,0,.25) inset;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover {
  border-color: var(--pale);
  color: var(--pale);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn .egg {
  display: inline-block; width: 7px; height: 9px;
  background: var(--pale);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

/* Body copy */
.copy {
  margin-top: 40px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
}
.copy p { margin: 0 0 14px; }
.copy p:last-child { margin-bottom: 0; }
.copy p.lede {
  font-weight: 700;
  color: var(--ink);
  font-size: 16px;
}
.copy a { color: var(--pale); }
.refs {
  margin-top: 18px !important;
  padding-top: 16px;
  border-top: 1px dashed var(--hair);
  font-size: 13px;
  color: var(--ink-muted);
}
.refs__label {
  display: inline-block;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-right: 10px;
  padding: 2px 9px;
  border: 1px solid var(--hair);
  border-radius: 999px;
}

/* Source code section */
.source {
  margin-top: 40px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #081a2b;
}
.source__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--cream-2) 70%, #081a2b), var(--surface));
  border-bottom: 1px solid var(--hair);
  flex-wrap: wrap;
}
.source__file {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: .04em;
}
.source__file::before {
  content: ""; width: 8px; height: 10px;
  background: var(--pale);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.source__chip {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 3px 9px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: color-mix(in oklab, var(--cream-2) 50%, transparent);
}
.source__tools { display: inline-flex; gap: 8px; }
.source__btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.source__btn:hover { color: var(--pale); border-color: var(--pale); }
.source__btn[aria-pressed="true"] { color: var(--pale); border-color: var(--pale); }
.source__body {
  position: relative;
  max-height: 440px;
  overflow: auto;
  background: #081a2b;
}
.source.collapsed .source__body { max-height: 220px; }
.source.collapsed .source__body::after {
  content: ""; position: sticky; bottom: 0; left: 0; right: 0;
  display: block; height: 60px; margin-top: -60px;
  background: linear-gradient(180deg, transparent, #081a2b 85%);
  pointer-events: none;
}
.source pre {
  margin: 0;
  padding: 18px 18px 22px 14px;
  font-family: "DM Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #d8e6f5;
  tab-size: 2;
}
.source ol {
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: ln;
}
.source ol li {
  counter-increment: ln;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  white-space: pre;
  padding: 0 4px;
}
.source ol li::before {
  content: counter(ln);
  text-align: right;
  color: rgba(216,230,245,.28);
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.source ol li:hover { background: rgba(255,255,255,.025); }

/* syntax highlight */
.src-kw { color: #f2b5a0; }
.src-str { color: #a8d8a8; }
.src-num { color: #e6c98a; }
.src-com { color: #6a8aa8; font-style: italic; }
.src-fn  { color: #cfe1ee; }
.src-pn  { color: #a8c0d6; }

@media (max-width: 640px) {
  .page { padding: 24px 16px 80px; }
  .copy { padding: 22px 20px; }
  .controls { justify-content: center; }
  .source pre { font-size: 12px; padding: 14px 12px 18px 8px; }
  .source ol li { grid-template-columns: 28px 1fr; gap: 10px; }
}
