:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --text: #e7e9ee;
  --text-muted: #9aa3b2;
  --accent: #7aa2ff;
  --accent-2: #b388ff;
  --border: #262b36;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  --max-width: 760px;
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfd;
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --text: #1a1d24;
    --text-muted: #5c6370;
    --accent: #3d6fe0;
    --accent-2: #7a4dd6;
    --border: #e5e7ee;
    --shadow: 0 4px 18px rgba(20, 25, 40, 0.08);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.site-title:hover { text-decoration: none; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.site-nav ul {
  display: flex; gap: 18px;
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px 2px;
}
.site-nav a.is-active { color: var(--text); border-bottom: 2px solid var(--accent); }

/* Hero (トップページ) */
.hero {
  text-align: center;
  padding: 56px 0 24px;
}
.hero__avatar {
  width: 88px; height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.hero__title {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0.02em;
}
.hero__lead {
  margin: 0;
  color: var(--text-muted);
}

/* Prose (Markdown 本文) */
.prose {
  padding: 8px 0 32px;
}
.prose h2 {
  margin-top: 2em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
}
.prose h3 { font-size: 17px; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.prose blockquote {
  margin: 1em 0;
  padding: 0.4em 1em;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Recent / Live list */
.recent { margin: 32px 0 48px; }
.recent__head {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.recent__head h2 { margin: 0; font-size: 18px; }
.recent__more { font-size: 14px; color: var(--text-muted); }

.page-head { padding: 40px 0 16px; }
.page-head h1 { margin: 0 0 8px; }

.live-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 12px;
}
.live-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.live-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}
.live-card a {
  display: block;
  padding: 16px 18px;
  color: var(--text);
}
.live-card a:hover { text-decoration: none; }
.live-card__date {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.live-card__title {
  margin: 4px 0 4px;
  font-size: 16px;
}
.live-card__meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.live-card__meta span + span::before { content: " · "; }
.live-card__rating {
  margin: 6px 0 0;
  color: #f5a524;
  letter-spacing: 2px;
  font-size: 13px;
}

.empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius);
}

/* Single post */
.post { padding: 32px 0; }
.post__back { margin: 0 0 16px; font-size: 13px; }
.post__title { margin: 0 0 8px; font-size: 26px; line-height: 1.3; }
.post__meta { margin: 0 0 20px; color: var(--text-muted); font-size: 13px; }
.post__facts {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 16px;
  padding: 16px 18px;
  margin: 0 0 24px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 14px;
}
.post__facts dt { color: var(--text-muted); }
.post__facts dd { margin: 0; }

.tags {
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid var(--border);
}
.tags li {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 999px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 24px 0 40px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
}

/* ─── /projects/jagged-edge デモ ─── */
.je-app__head .je-app__intro {
  margin-top: 0.5rem;
}
.je-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.je-hint.je-status {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}
.je-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.je-row:last-child {
  margin-bottom: 0;
}
.je-row--grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
}
.je-row--grid .je-label {
  flex: 1 1 220px;
  margin: 0;
}
.je-row--grid .je-val {
  flex: 0 0 auto;
  margin-bottom: 4px;
}
.je-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}
.je-label--radio select {
  max-width: 100%;
}
.je-file {
  font-size: 13px;
  color: var(--text);
}
.je-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 22%, var(--surface)),
    var(--surface-2)
  );
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.je-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
.je-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.je-btn--ghost {
  background: var(--surface-2);
  font-weight: 500;
}
.je-val {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.je-preview {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 680px) {
  .je-preview {
    grid-template-columns: 1fr 1fr;
  }
}
.je-preview__title {
  font-size: 15px;
  margin: 0 0 8px;
}
.je-canvas {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}
.je-panel .je-progress-wrap {
  margin: 10px 0 12px;
}
.je-progress-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.je-progress-label-main {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.je-progress-wrap progress {
  min-width: 0;
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
}
.je-progress-values {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.je-label input[type="number"],
.je-label input[type="text"],
.je-label select {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
