:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f9fa;
  --text: #17202a;
  --muted: #66727d;
  --line: #dce2e6;
  --line-strong: #bdc7ce;
  --accent: #175c7d;
  --accent-soft: #edf6fa;
  --draft: #8b4b08;
  --max: 50rem;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-synthesis: none;
}


*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }
body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
img, video, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #7cb6d0; outline-offset: 3px; }


.shell { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.site-header__inner { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem 1.5rem; padding-block: 1.25rem; flex-wrap: wrap; }
.site-name { color: var(--text); font-size: clamp(1.25rem, 5vw, 1.65rem); font-weight: 750; letter-spacing: -.035em; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .9rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.site-nav__social { display: inline-flex; width: 1.05rem; height: 1.05rem; align-items: center; justify-content: center; }
.site-nav__social img { width: 1rem; height: 1rem; object-fit: contain; }
.main-content { padding-block: 2.25rem 5rem; min-height: 70vh; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.site-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; padding-block: 1.5rem 2.5rem; }


h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(1.75rem, 7vw, 2.5rem); }
h2 { margin: 0 0 1rem; font-size: 1.1rem; text-transform: none; }
h3 { margin: 0; font-size: 1.18rem; }
.home-intro { margin-bottom: 3rem; color: #34414b; font-size: 1.06rem; }
.home-intro p { margin: 0; }
.home-section { border-top: 1px solid var(--line-strong); border-left: 2px solid var(--accent); padding: 1rem; background: #fbfcfd; }
.home-section > h2 { margin: -1rem -1rem 1rem; border-bottom: 2px solid var(--line); padding: .65rem 1rem; background: var(--accent-soft); }
.home-section + .home-section { margin-top: 3rem; }
.page-header { border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.page-header p:last-child { color: var(--muted); margin-bottom: 0; }
.eyebrow { margin: 0 0 .35rem; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }


.card-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.card { min-width: 0; border: 1px solid var(--line-strong); padding: 1.15rem; background: var(--bg); }
.card--pinned { border-left: 3px solid var(--text); }
.card--featured { border-left: 3px solid var(--accent); }
.card--secondary { background: #fbfcfc; }
.card__heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1rem; margin: -1.15rem -1.15rem 0; border-bottom: 1px solid var(--line-strong); padding: .75rem 1.15rem; background: var(--surface); }
.card__title-link { color: inherit; text-decoration: none; }
.card__title-link:hover { color: var(--accent); text-decoration: underline; }
.badges, .actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.badges { justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; min-height: 1.55rem; border: 1px solid var(--line-strong); padding: .05rem .48rem; color: var(--text); font-size: .7rem; line-height: 1.2; white-space: normal; }
.badge--muted { color: var(--muted); border-color: var(--line); }
.badge--draft { color: var(--draft); border-color: #d9a86b; background: #fff8ee; }
.summary-wrap { margin-top: .7rem; }
.card__summary { margin: 0; color: #34414b; line-height: 1.65; }
.card__note, .detail__note { padding-left: .75rem; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: .9rem; }
.topics { display: flex; flex-wrap: wrap; gap: .4rem .75rem; margin: .75rem 0 0; padding: 0; color: var(--muted); font-size: .76rem; list-style: none; }
.topics li::before { content: "#"; }
.actions { margin-top: .9rem; align-items: stretch; }
.button { display: inline-flex; min-width: 0; min-height: 2.25rem; align-items: center; justify-content: center; border: 1px solid var(--line-strong); padding: .35rem .7rem; background: var(--bg); color: var(--text); font-size: .82rem; font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none; white-space: normal; }
.button:hover { border-color: var(--text); }
.button--primary { border-color: var(--text); background: var(--text); color: white; }
.card__media-link { margin: .8rem 0 0; font-size: .82rem; }
.card__media { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.card__media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.empty-state { color: var(--muted); }


.breadcrumbs { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-bottom: 1.5rem; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { color: inherit; }
.detail__header { border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; }
.detail__summary { margin: 1rem 0 0; color: #34414b; font-size: 1.06rem; }
.draft-banner { border: 1px solid #d9a86b; background: #fff8ee; color: var(--draft); padding: .6rem .8rem; }
.subnav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: 1.25rem 0; padding: .75rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.subnav [aria-current="page"] { color: var(--text); font-weight: 700; }
.prose { margin-top: 1.75rem; }
.prose h2 { margin-top: 2.25rem; font-size: 1.35rem; }
.prose h3 { margin-top: 1.75rem; }
.prose pre { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); padding: .85rem; }
.prose code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.prose :not(pre) > code { background: var(--surface); padding: .1em .25em; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; }

.media-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 2rem; }
.media-item { margin: 0; min-width: 0; }
.media-item__title { margin: 0 0 .45rem; border-bottom: 1px solid var(--line); padding: .3rem .4rem; background: var(--surface); color: #34414b; font-size: .84rem; }
.media-item img, .media-item video, .video-frame { border: 1px solid var(--line); }
.media-item--card { width: 100%; }
.media-item__fallback { margin: .55rem 0 0; font-size: .82rem; }
.media-item--small { max-width: 20rem; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.video-frame--short { aspect-ratio: 9 / 16; max-width: 20rem; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.media-item figcaption { margin-top: .4rem; color: var(--muted); font-size: .8rem; }

.twitter-tweet { width: 100% !important; max-width: 100% !important; margin: 0 !important; }
.twitter-tweet + .media-item__fallback { margin-top: .55rem; }
.x-preview { min-width: 0; }
.x-preview__heading { margin-bottom: .45rem; border-bottom: 1px solid var(--line); padding: .3rem .4rem; background: var(--surface); }
.x-preview__label { margin: 0; color: #34414b; font-size: .84rem; line-height: 1.35; }
.x-preview__actions { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .55rem; margin-top: .25rem; }
.x-preview__toggle { border: 0; padding: .1rem .2rem; background: transparent; color: var(--accent); cursor: pointer; font-size: .76rem; }
.x-preview__toggle:hover { background: var(--accent-soft); }
.x-preview__external { font-size: .76rem; text-decoration: none; }
.x-preview__viewport { position: relative; width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.x-preview__scaled { width: 34.375rem; max-width: none; transform: scale(var(--x-preview-scale, 1)); transform-origin: top left; }
.x-preview__scaled > iframe { display: block !important; width: 34.375rem !important; max-width: none !important; margin: 0 !important; }
.x-preview__open-area { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.x-preview__open-area:hover { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(23, 92, 125, .05); }
.x-preview.is-error .x-preview__viewport { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.x-modal { width: min(40rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); border: 2px solid var(--text); padding: 0; background: var(--bg); color: var(--text); }
.x-modal::backdrop { background: rgba(17, 31, 42, .72); }
.x-modal__panel { display: grid; max-height: calc(100dvh - 2.25rem); grid-template-rows: auto minmax(0, 1fr) auto; }
.x-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--line); padding: .7rem .85rem; background: var(--accent-soft); }
.x-modal__header h2 { margin: 0; font-size: 1rem; }
.x-modal__close { flex: 0 0 auto; border: 1px solid var(--line-strong); padding: .25rem .5rem; background: var(--bg); color: var(--text); cursor: pointer; font-size: .8rem; }
.x-modal__body { overflow: auto; overscroll-behavior: contain; padding: .85rem; }
.x-modal__body .twitter-tweet, .x-modal__body iframe { margin-inline: auto !important; }
.x-modal__loading { margin: 0 0 .75rem; color: var(--muted); font-size: .85rem; text-align: center; }
.x-modal__footer { border-top: 1px solid var(--line); padding: .55rem .85rem; font-size: .8rem; text-align: right; }
body.has-modal { overflow: hidden; }


@media (min-width: 42rem) {
  .card:has(.media-item--x-card) .card__main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13.5rem, 16rem); align-items: start; gap: 1rem 1.25rem; }
  .card:has(.media-item--x-card) .card__media { margin-top: 0; border-top: 0; padding-top: 0; }
  .card:has(.media-item--x-card) .card__media-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}


@media (max-width: 40rem) {
  .card__media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


@media (max-width: 24rem) {
  .shell { width: min(100% - 1.25rem, var(--max)); }
  .site-header__inner { padding-block: .9rem; }
  .main-content { padding-block: 1.5rem 3.5rem; }
  .card { padding: .9rem; }
  .card__heading { margin: -.9rem -.9rem 0; padding: .7rem .9rem; }
  .card__heading { display: block; }
  .badges { justify-content: flex-start; margin-top: .45rem; }
  .button { flex: 1 1 8.5rem; }
  .home-section { padding: .75rem; }
  .home-section > h2 { margin: -.75rem -.75rem .75rem; padding-inline: .75rem; }
  .card__media-grid { grid-template-columns: minmax(0, 1fr); }
  .x-modal { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .x-modal__panel { max-height: calc(100dvh - 1.25rem); }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
