/* ============================================================
   Sakana AI Defense and Intelligence — Reports
   Layout modeled on sakana.ai/blog: a single narrow column,
   logo masthead, title + date entries, "read more" buttons.
   ============================================================ */

:root {
  --ink: #222;
  --ink-2: #444;
  --muted: #888;
  --line: #e8e8e8;
  --bg-soft: #f7f7f7;
  --link: #3c5bd8;
  --accent: #e10a0a;

  --sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;

  /* content column: matches sakana.ai/blog (≈762px at a 1190px viewport, grows with the window) */
  --col: clamp(760px, 64vw, 960px);
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; height: auto; }

.container { max-width: calc(var(--col) + 48px); margin: 0 auto; padding: 0 24px; }

/* ---------- Masthead ---------- */

.masthead { border-bottom: 1px solid var(--line); }
.masthead .container { padding-top: 32px; padding-bottom: 32px; }
.masthead a { display: block; width: min(100%, 640px); }
.masthead img { width: 100%; height: auto; }

/* PDF download at the end of an article */
.download { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 48px 0 8px; padding-top: 32px; border-top: 1px solid var(--line); }
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 400;
  transition: background 0.15s;
}
/* beats the generic `.article a:not(.cite)` link style */
.article a.download-btn:not(.cite) { color: #fff; border-bottom: 0; }
.download-btn:hover { background: var(--accent); }
.download-meta { color: var(--muted); font-size: 13px; }

/* lead text between the masthead and the list */
.intro { padding: 40px 0 4px; border-bottom: 1px solid var(--line); }
.intro p { margin: 0 0 18px; font-size: 16px; line-height: 2; color: var(--ink-2); }
.masthead .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }


/* ---------- Post list (index) ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post {
  padding: 44px 0 38px;
  border-bottom: 1px solid var(--line);
}
.post:first-child { padding-top: 36px; }

.post-title {
  font-size: 25px;
  font-weight: 400;
  line-height: 1.7;
  margin: 0;
}
.post-title a:hover { color: var(--link); }

.post-date { color: var(--muted); font-size: 15px; margin: 6px 0 0; }

.post-image { display: block; margin: 32px auto 0; max-width: 80%; }
.post-image img { width: 100%; }

.post-excerpt { color: var(--ink-2); font-size: 15px; margin: 22px 0 0; }

.read-more {
  display: inline-block;
  margin-top: 30px;
  padding: 3px 12px;
  border: 1px solid var(--link);
  border-radius: 2px;
  color: var(--link);
  font-size: 15px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
}
.read-more:hover { background: var(--link); color: #fff; }

.empty { padding: 80px 0; color: var(--muted); text-align: center; }

/* ---------- Footer ---------- */

.site-footer { padding: 48px 0 72px; color: var(--muted); font-size: 14px; }
.site-footer a:hover { color: var(--ink); }

/* ============================================================
   Report (post) page
   ============================================================ */

.article { padding: 48px 0 24px; }

.article-header { margin-bottom: 40px; }
.article-header h1 {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
}
.article-header .tagline { font-style: italic; color: var(--ink-2); margin: 12px 0 0; }
.article-header .post-date { margin-top: 10px; }

.article h2 {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.6;
  margin: 56px 0 18px;
}
.article h2::after {
  /* short underline dash, as on sakana.ai posts */
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: var(--ink);
  margin-top: 10px;
}
.article h3 { font-size: 17px; font-weight: 600; margin: 36px 0 10px; }
.article p { margin: 0 0 22px; }
.article ul, .article ol { padding-left: 1.4em; margin: 0 0 22px; }
.article li { margin-bottom: 6px; }
.article strong { font-weight: 600; }
.article a:not(.cite) { color: var(--link); border-bottom: 1px solid rgba(60, 91, 216, 0.3); }
.article a:not(.cite):hover { border-bottom-color: var(--link); }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 56px 0; }

.article figure { margin: 36px 0; }
.article figure img { width: 100%; }
.article figcaption { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.7; }

/* glossary term */
.term { border-bottom: 1px dotted var(--ink-2); cursor: help; position: relative; }
.term::after {
  content: attr(data-def);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 260px;
  padding: 10px 12px;
  background: #222;
  color: #f2f2f2;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}
.term:hover::after,
.term:focus::after { opacity: 1; }

/* source reference [1] */
.cite { font-size: 0.75em; vertical-align: super; color: var(--link); }

/* key point */
.callout {
  background: var(--bg-soft);
  border-left: 3px solid var(--ink);
  padding: 18px 22px;
  margin: 32px 0;
}
.callout p { margin: 0; }

/* bar chart */
.chart { border: 1px solid var(--line); padding: 24px; }
.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 14px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: var(--bg-soft); position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width 0.9s ease; }
.bar.is-accent .bar-fill { background: var(--accent); }
.bar-val { text-align: right; font-family: var(--mono); font-size: 13px; }

/* scenarios */
.scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; }
.scenario { border: 1px solid var(--line); padding: 18px; }
.scenario .prob { font-size: 32px; font-weight: 400; line-height: 1.2; }
.scenario .prob small { font-size: 15px; color: var(--muted); }
.scenario.is-base { border-color: var(--ink); }
.scenario.is-base .prob { color: var(--accent); }
.scenario h4 { margin: 6px 0 6px; font-size: 15px; font-weight: 600; }
.scenario p { margin: 0; font-size: 14px; line-height: 1.75; }

/* update note */
.update { border: 1px solid var(--ink); padding: 18px 22px; margin: 32px 0; }
.update p { margin: 0; }
.update .update-date { font-weight: 600; margin-bottom: 6px; }

/* sources */
.sources ol { font-size: 14px; color: var(--ink-2); }
.sources li { word-break: break-word; }
.sources li:target { background: #fff6d6; }

/* ---------- Report components ---------- */

.notice {
  margin: 18px 0 0;
  padding: 10px 14px;
  background: #fff4f4;
  border-left: 3px solid var(--accent);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.article h3 { font-size: 18px; margin-top: 48px; }
.article h4.subhead { font-size: 16px; font-weight: 600; margin: 32px 0 10px; }
.article p.note { font-size: 13px; color: var(--muted); line-height: 1.8; }

.summary-box { background: var(--bg-soft); padding: 22px 26px 8px; margin: 0 0 28px; }
.summary-box ol { padding-left: 1.3em; }
.summary-box li { margin-bottom: 14px; }

.meta-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 24px; }
.meta-table th, .meta-table td { border-bottom: 1px solid var(--line); padding: 10px 0; vertical-align: top; text-align: left; line-height: 1.75; }
.meta-table th { width: 150px; padding-right: 20px; font-weight: 400; color: var(--muted); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.card { border: 1px solid var(--line); padding: 18px 20px; }
.card h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.card p, .card ul { margin: 0; font-size: 14px; line-height: 1.8; }
.card ul { padding-left: 1.2em; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 20px 0 24px; }
.article figure .table-scroll { margin: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.6; }
.data-table th, .data-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table thead th { font-weight: 600; color: var(--ink-2); border-bottom: 1px solid #ccc; white-space: nowrap; }
.data-table th.group { text-align: left; border-bottom: 1px solid var(--line); }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td:first-child { white-space: nowrap; color: var(--muted); }
.data-table td:last-child,
.data-table td:nth-child(3),
.data-table td:nth-child(4) { white-space: nowrap; }
.pill { display: inline-block; padding: 0 8px; border: 1px solid #ccc; border-radius: 999px; font-size: 12px; white-space: nowrap; }

.appendix { border-top: 1px solid var(--line); padding: 4px 0; }
.appendix:last-of-type { border-bottom: 1px solid var(--line); }
.appendix summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 16px; list-style: none; }
.appendix summary::-webkit-details-marker { display: none; }
.appendix summary::before { content: "+"; display: inline-block; width: 1.4em; color: var(--muted); }
.appendix[open] summary::before { content: "−"; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .masthead .container { padding-top: 20px; padding-bottom: 20px; }
  .masthead .container { flex-wrap: wrap; gap: 12px; }
  .intro p { font-size: 15px; }
  .post { padding: 32px 0 28px; }
  .post-title { font-size: 21px; }
  .article-header h1 { font-size: 24px; }
  .scenarios, .cards { grid-template-columns: 1fr; }
  .meta-table th { width: 96px; padding-right: 12px; }
  .bar { grid-template-columns: 84px 1fr 36px; gap: 10px; }
  .term::after { width: 210px; }
}
