:root {
  --fg: #1c1f1a;
  --bg: #f7f5f0;
  --surface: #eeeae1;
  --accent: #c1392b;
  --muted: #6b7266;
  --rule: #ddd6c8;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.75;
  /* 長い非分割トークン(URL・環境変数名等)がモバイル幅で本文からはみ出して
     横スクロールを起こさないよう、必要な時だけ語中で折り返す */
  overflow-wrap: break-word;
}

header, main, footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header {
  padding-top: 1.1rem;
}

header nav a {
  color: var(--fg);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  text-decoration: none;
}

header nav a::before {
  content: "❯ ";
  color: var(--accent);
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration-thickness: 2px;
}

time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  margin-right: 0.6em;
}

#hero {
  padding: 2rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

#hero h1 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

#hero h1::before {
  content: "❯ ";
  color: var(--accent);
}

#hero #tagline {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted);
  margin: 0;
}

#hero #tagline::before {
  content: "# ";
  color: var(--rule);
}

h2 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin: 2rem 0 1rem;
}

ul {
  padding-left: 1.2rem;
}

#articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#articles li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--rule);
  flex-wrap: wrap;
}

#articles li a {
  color: var(--fg);
  text-decoration: none;
}

#articles li a:hover {
  color: var(--accent);
}

.kind {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border-radius: 3px;
  padding: 0.12em 0.45em;
}

#profile ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

#profile li {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92em;
  padding: 0.3rem 0;
}

/* イベントでスマホに表示して読み取ってもらうQRコード。白地と余白を確保する */
#profile .qr {
  margin: 1.5rem 0 0;
  width: max-content;
  text-align: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85em;
  color: var(--muted);
}

#profile .qr img {
  display: block;
  width: 240px;
  height: 240px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin: 0 auto 0.4rem;
}

.cover {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--rule);
}

article img {
  max-width: 100%;
  height: auto;
}

/* YouTube等のembedはwidth/height属性でピクセル固定されるため、本文カラムより
   狭いモバイル幅でははみ出して横スクロールを起こす。幅を本文に合わせて縮め、
   高さは16:9の比で追従させる */
article iframe {
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

article > p > time {
  display: block;
  margin-bottom: 1rem;
}

footer {
  margin-top: 3rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85em;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted);
}

audio, video {
  width: 100%;
  border-radius: 6px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95em;
}

th, td {
  border: 1px solid var(--rule);
  padding: 0.4em 0.6em;
  text-align: left;
}

th {
  background: var(--surface);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

pre {
  overflow-x: auto;
  padding: 0.9em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9em;
}

/* 記事末尾の共有リンク。外部widget JSを読まず、各サービスの共有URLへ素で飛ばす */
.share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--rule);
}

.share a {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.3em 0.7em;
}

.share a::before {
  content: "❯ ";
  color: var(--accent);
}

.share a:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.share a:hover::before {
  color: var(--bg);
}

/* ❤️は共有リンクと同じchipの意匠に揃える。❯の代わりにハートが立つ */
.share .heart {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.3em 0.7em;
  cursor: pointer;
  /* 連打でダブルタップ拡大が起きないようにする */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.share .heart:hover,
.share .heart:focus-visible {
  border-color: var(--accent);
}

.share .heart:active {
  background: var(--accent);
  border-color: var(--accent);
}
