/* ============================================================
   PM AI Lab — site stylesheet
   Recreates the MERYDS design-system components (PillNav,
   PillButton, cards, SectionHeader, FooterBar) as plain CSS,
   driven entirely by the DS tokens in assets/ds/.
   "The Night & the Ignite" — navy night, off-white ink,
   Instrument Serif italic display, one hot orange accent.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: hsl(var(--bg));
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--color-white); }

::selection { background: hsl(var(--ignite) / 0.3); color: var(--color-white); }

input::placeholder { color: var(--color-muted); opacity: .6; }
input:focus { outline: none; border-color: var(--grad-blue-b) !important; }

.page { flex: 1; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

/* ---------- Display / type helpers ---------- */
.italic { font-family: var(--font-display); font-style: italic; }
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.jp { font-family: var(--font-jp); }
.muted { color: var(--text-secondary); }

/* ---------- Member band (visible only on member pages) ---------- */
.member-band {
  background: hsl(var(--surface) / 0.9);
  border-bottom: 1px solid var(--border-default);
}
.member-band .inner {
  max-width: 1120px; margin: 0 auto; padding: 9px 28px;
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-secondary);
}
.member-band .brand {
  font-family: var(--font-display); font-style: italic;
  font-size: 14px; color: var(--text-primary);
}

/* ---------- Live ping dot ---------- */
.ping { position: relative; display: inline-flex; width: 8px; height: 8px; flex-shrink: 0; }
.ping::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--color-live); opacity: .75;
  animation: meryds-ping 1.4s cubic-bezier(0,0,0.2,1) infinite;
}
.ping::after {
  content: ""; position: relative; display: inline-flex; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-live);
}
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border-default); display: inline-block; }

/* ============================================================
   PillNav — the floating capsule nav
   ============================================================ */
.nav-shell { position: sticky; top: 0; z-index: 50; padding-top: 1.25rem; }
.nav {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px;
  background: hsl(var(--surface) / 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,0.7);
}
.nav .brand { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.monogram {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  padding: 1px; display: inline-flex; flex-shrink: 0;
  background: var(--accent-gradient);
}
.monogram span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  background: hsl(var(--bg));
  font-family: var(--font-display); font-style: italic; font-size: 14px; color: var(--text-primary);
}
.nav .brand .name { font-family: var(--font-jp); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.nav .links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav .links a {
  font-family: var(--font-jp); font-size: 13px; color: var(--text-secondary);
  padding: 8px 14px; border-radius: var(--radius-pill); white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard);
}
.nav .links a:hover { color: var(--text-primary); background: hsl(var(--surface)); }
.nav .links a[aria-current="page"] { color: var(--text-primary); background: hsl(var(--surface)); }
.nav .cta-slot { margin-left: 6px; }

/* ============================================================
   PillButton — solid (white) / outline / soft / text
   ============================================================ */
.pill {
  --pill-h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--pill-h); padding: 0 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-jp); font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--dur-med) var(--ease-standard),
              color var(--dur-med) var(--ease-standard),
              border-color var(--dur-med) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}
.pill .arw { transition: transform var(--dur-med) var(--ease-standard); }
.pill:hover .arw { transform: translateX(3px); }
.pill.lg { --pill-h: 48px; padding: 0 26px; }

.pill.solid { background: var(--cta-bg); color: var(--cta-fg); }
.pill.solid:hover { color: var(--cta-fg); background: var(--color-white); }

.pill.outline { background: transparent; color: var(--text-primary); border-color: var(--border-default); }
.pill.outline:hover { border-color: var(--color-muted); }

.pill.soft { background: hsl(var(--surface)); color: var(--text-primary); border-color: var(--border-glass); }
.pill.soft:hover { background: hsl(var(--surface) / 1); border-color: var(--color-muted); }

.pill.text {
  height: auto; padding: 0; background: none; border: none;
  color: var(--text-secondary); font-weight: 500;
}
.pill.text:hover { color: var(--text-primary); }

/* ============================================================
   Chips / badges
   ============================================================ */
.chip {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  padding: 4px 10px; font-family: var(--font-jp); font-size: 11px; line-height: 1;
  color: var(--text-secondary); white-space: nowrap;
}
.chip.filter { padding: 8px 16px; font-size: 12.5px; cursor: pointer; background: transparent;
  transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.chip.filter:hover { color: var(--text-primary); border-color: var(--color-muted); }
.chip.filter[aria-pressed="true"] { background: var(--text-primary); color: hsl(var(--bg)); border-color: transparent; }
.chip.ignite { border-color: var(--ignite-border); color: var(--ignite-solid); background: var(--ignite-faint); }

/* ============================================================
   SectionHeader
   ============================================================ */
.section-header { margin-bottom: 30px; }
.section-header .eyebrow { margin-bottom: 14px; display: block; }
.section-header h2 {
  margin: 0; font-family: var(--font-sans); font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, var(--fs-display)); letter-spacing: var(--ls-tight);
  line-height: 1.1; color: var(--text-primary);
}
.section-header p {
  margin: 14px 0 0; font-family: var(--font-jp); font-size: 14px; line-height: 1.85;
  color: var(--text-secondary); max-width: 42rem;
}

/* ============================================================
   Cards & list rows
   ============================================================ */
.card, .row {
  background: hsl(217 34% 12%);
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 16px 40px -16px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.card:hover, .row:hover { background: hsl(217 34% 15%); border-color: rgba(255,255,255,0.24); }

/* news list row */
.news-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 24px; align-items: center;
  padding: 20px 26px; border-radius: var(--radius-20);
}
.news-row .date { font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: .06em; color: var(--text-secondary); }
.news-row .title { font-family: var(--font-jp); font-size: 16px; font-weight: 500; line-height: 1.55; color: var(--text-primary); }
.news-row .lead {
  margin-top: 6px; font-family: var(--font-jp); font-size: 13px; line-height: 1.75; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-row .tail { display: flex; align-items: center; gap: 12px; }
.arrow { color: var(--text-secondary); font-size: 15px; }

/* tips pill row */
.tips-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 24px; border-radius: var(--radius-pill);
}
.tips-row .date { font-family: 'Inter', sans-serif; font-size: 11.5px; color: var(--text-secondary); flex-shrink: 0; width: 78px; }
.tips-row .title {
  flex: 1; min-width: 0; font-family: var(--font-jp); font-size: 14px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* feed card (mixed) */
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feed-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: var(--radius-3xl); }
.feed-card .head { display: flex; align-items: center; justify-content: space-between; }
.feed-card .kind { font-family: 'Inter', sans-serif; font-size: 10.5px; letter-spacing: .25em; text-transform: uppercase; color: var(--text-secondary); }
.feed-card .date { font-family: 'Inter', sans-serif; font-size: 11.5px; color: var(--text-secondary); }
.feed-card .title { font-family: var(--font-jp); font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--text-primary); flex: 1; }
.feed-card .lead {
  font-family: var(--font-jp); font-size: 12.5px; line-height: 1.75; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-card .foot { display: flex; align-items: center; justify-content: space-between; }

.list-col { display: flex; flex-direction: column; gap: 12px; }
.list-col.tight { gap: 10px; }

/* ============================================================
   FooterBar
   ============================================================ */
.site-footer { max-width: 1120px; margin: 0 auto; padding: 104px 28px 40px; width: 100%; }
.site-footer .footlinks { display: flex; gap: 22px; margin-bottom: 22px; flex-wrap: wrap; }
.footer-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 22px; border-top: 1px solid var(--border-default);
  font-family: var(--font-jp); font-size: 12px; color: var(--text-secondary);
}
.footer-bar .spacer { flex: 1; }

/* ============================================================
   Article detail (members)
   ============================================================ */
.article { max-width: 720px; margin: 0 auto; padding: 56px 28px 0; }
.article .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.article h1 {
  margin: 0; font-family: var(--font-sans); font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.5; letter-spacing: -0.01em; color: var(--text-primary);
}
.article .lead { margin: 18px 0 0; font-family: var(--font-jp); font-size: 14.5px; line-height: 1.95; color: var(--text-secondary); }
.article .body { font-family: var(--font-jp); font-size: 15px; line-height: 2; color: var(--text-secondary); }
.article .body h2 {
  font-family: 'Inter', sans-serif; font-size: 10.5px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--text-secondary); font-weight: 400; margin: 36px 0 16px; display: flex; align-items: center; gap: 10px;
}
.article .body h2::after { content: ""; flex: 1; height: 1px; background: var(--border-default); }
.rule { height: 1px; background: var(--border-default); margin: 36px 0; }
.path-tag {
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: hsl(215 14% 58% / .6);
  border: 1px dashed var(--border-default); border-radius: 6px; padding: 3px 8px;
}

/* prompt copy block (tips) */
.prompt-box {
  margin-top: 36px; background: hsl(217 42% 5%); border: 1px solid var(--border-glass);
  border-radius: var(--radius-2xl); overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.prompt-box .bar {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
  border-bottom: 1px solid var(--border-default);
}
.prompt-box .bar .lbl { font-family: 'Inter', sans-serif; font-size: 10.5px; letter-spacing: .25em; text-transform: uppercase; color: var(--text-secondary); }
.prompt-box pre {
  margin: 0; padding: 20px 18px; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.8; color: var(--text-primary);
}
.copy-btn {
  background: hsl(var(--bg)); border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  color: var(--text-primary); font-family: var(--font-jp); font-size: 11.5px; padding: 6px 14px; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.copy-btn:hover { border-color: var(--color-muted); }

/* gate (login-required) */
.gate { max-width: 560px; margin: 0 auto; padding: 96px 28px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.gate svg { margin-bottom: 22px; }
.gate h2 { margin: 0 0 10px; font-family: var(--font-sans); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.02em; color: var(--text-primary); }
.gate p { margin: 0 0 30px; font-family: var(--font-jp); font-size: 13.5px; line-height: 1.9; color: var(--text-secondary); }

/* generic hero */
.hero { padding-top: 96px; }
.hero .kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.hero .kicker .line { width: 32px; height: 1px; background: var(--border-default); }
.hero h1 {
  margin: 0; font-family: var(--font-sans); font-weight: 400;
  font-size: clamp(2.75rem, 5.2vw, 4.5rem); line-height: 1.15; letter-spacing: var(--ls-tight); color: var(--text-primary);
}
.hero p { margin: 26px 0 0; font-family: var(--font-jp); font-size: 15px; line-height: 1.9; color: var(--text-secondary); max-width: 40rem; }
.hero .actions { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.pill-tags { display: flex; gap: 10px; margin-top: 44px; flex-wrap: wrap; }
.pill-tags .t {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill); padding: 9px 18px; background: hsl(217 34% 11%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); font-family: var(--font-jp); font-size: 12.5px; color: var(--text-secondary);
}

/* callout band */
.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 40px 44px; border: 1px solid var(--border-glass); border-radius: var(--radius-3xl);
  background: hsl(217 34% 12%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 16px 40px -16px rgba(0,0,0,0.6);
  flex-wrap: wrap;
}
.callout h2 { margin: 0 0 10px; font-family: var(--font-sans); font-weight: 400; font-size: 1.75rem; letter-spacing: var(--ls-tight); color: var(--text-primary); }
.callout .body { font-family: var(--font-jp); font-size: 14px; line-height: 1.9; color: var(--text-secondary); max-width: 34rem; }
.callout .actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 30px; }

/* ============================================================
   Prose (Markdown body output) + code blocks
   ============================================================ */
.article .body.prose > p { margin: 0 0 20px; }
.article .body.prose > p:last-child { margin-bottom: 0; }
.article .body.prose ul, .article .body.prose ol { padding-left: 1.4em; margin: 0 0 20px; }
.article .body.prose li { margin: 4px 0; }
.article .body.prose a { color: var(--text-primary); border-bottom: 1px solid var(--border-default); }
.article .body.prose a:hover { border-color: var(--color-muted); }
.article .body.prose code {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.9em;
  background: hsl(var(--surface)); border: 1px solid var(--border-default);
  border-radius: 6px; padding: 1px 6px;
}
/* fenced code block (e.g. コピペ用プロンプト) — override Shiki bg to match the DS prompt box */
.article .body.prose pre {
  position: relative;
  background: hsl(217 42% 5%) !important;
  border: 1px solid var(--border-glass); border-radius: var(--radius-2xl);
  padding: 20px 18px; margin: 0 0 24px; overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.article .body.prose pre code {
  background: none; border: none; padding: 0; font-size: 12.5px; line-height: 1.85;
  color: var(--text-primary); white-space: pre;
}
.copy-btn.code-copy {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; padding: 5px 12px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .feed-grid { grid-template-columns: 1fr; }
  .nav .brand .name { display: none; }
}
@media (max-width: 680px) {
  .news-row { grid-template-columns: 1fr; gap: 10px; }
  .news-row .tail { justify-content: space-between; }
  .nav .links a { padding: 8px 10px; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .callout { padding: 28px 24px; }
}
