:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #17171b;
  --text-2: #45454d;
  --muted: #6a6a73;
  --line: #e5e2d9;
  --accent: #cf3b26;
  --accent-ink: #b5321e;
  --accent-soft: #fbe8e3;
  --link: #b5321e;
  --mark-bg: #17171b;
  --focus: #2563eb;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(20, 20, 25, .10), 0 2px 6px rgba(20, 20, 25, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111216;
  --surface: #17181d;
  --surface-2: #1f2128;
  --text: #ecebe8;
  --text-2: #c3c2bf;
  --muted: #9b9ba4;
  --line: #2b2d35;
  --accent: #f0563f;
  --accent-ink: #ff8a76;
  --accent-soft: #33201d;
  --link: #ff8a76;
  --mark-bg: #2a2b33;
  --focus: #7aa2ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111216;
    --surface: #17181d;
    --surface-2: #1f2128;
    --text: #ecebe8;
    --text-2: #c3c2bf;
    --muted: #9b9ba4;
    --line: #2b2d35;
    --accent: #f0563f;
    --accent-ink: #ff8a76;
    --accent-soft: #33201d;
    --link: #ff8a76;
    --mark-bg: #2a2b33;
    --focus: #7aa2ff;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { text-wrap: balance; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 16px; }
.preview-bar { background: #f5c542; color: #17171b; text-align: center; padding: 8px 16px; font-weight: 700; font-size: .9rem; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.bm-bg { fill: var(--mark-bg); }
.bm-sun { fill: var(--accent); }
.bm-arrow { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.brand-name b { color: var(--accent); font-weight: 800; }
.brand-sm { font-size: 1.15rem; }
.brand-sm .brand-mark { width: 28px; height: 28px; }

.search { margin-left: auto; display: flex; align-items: center; height: 40px; width: min(320px, 38vw); padding: 0 4px 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: .95rem; }
.search input::placeholder { color: var(--muted); }
.search button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 999px; }
.search svg, .icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: border-color .15s, color .15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.nav-toggle { display: none; }

.nav { border-top: 1px solid var(--line); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.nav-list > li { position: relative; }
.nav-list > li > a { display: block; padding: 12px 12px; font-weight: 650; font-size: .94rem; color: var(--text-2); transition: color .15s; }
.nav-list > li:first-child > a { padding-left: 0; }
.nav-list > li > a:hover, .nav-list > li > a[aria-current="page"] { color: var(--accent-ink); }
.has-sub > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .55; }
.sub { display: none; position: absolute; top: 100%; left: 0; z-index: 30; min-width: 220px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.has-sub:hover > .sub, .has-sub:focus-within > .sub { display: block; }
.sub a { display: block; padding: 8px 12px; border-radius: 6px; font-size: .92rem; color: var(--text-2); }
.sub a:hover { background: var(--surface-2); color: var(--accent-ink); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 32px; padding-bottom: 48px; }
.main { min-width: 0; }

.cards { display: flex; flex-direction: column; }
.card { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.cards > .card:first-child { padding-top: 0; }
.card-noimg { grid-template-columns: minmax(0, 1fr); }
.card-media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); aspect-ratio: 16 / 10; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.kicker { display: inline-block; margin-bottom: 6px; font-size: .74rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); }
.kicker:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-title { margin: 0 0 8px; font-size: 1.24rem; line-height: 1.3; font-weight: 760; letter-spacing: -.01em; }
.card-title a { transition: color .15s; }
.card-title a:hover { color: var(--accent-ink); }
.card-excerpt { margin: 0 0 10px; color: var(--text-2); font-size: .97rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: .82rem; color: var(--muted); }
.card-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-bottom: 30px; }
.card-hero .card-media { aspect-ratio: 16 / 9; }
.card-hero .card-title { font-size: clamp(1.65rem, 3.2vw, 2.3rem); line-height: 1.14; letter-spacing: -.02em; font-weight: 800; }
.card-hero .card-excerpt { font-size: 1.07rem; -webkit-line-clamp: 4; }

.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .76rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.crumbs a { color: var(--accent-ink); }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

.archive-head { margin-bottom: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.archive-head h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 3.5vw, 2.35rem); line-height: 1.15; letter-spacing: -.02em; }
.archive-intro { margin: 0; color: var(--text-2); }
.chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .86rem; font-weight: 650; color: var(--text-2); transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.search-big { display: flex; gap: 8px; max-width: 560px; margin-top: 18px; }
.search-big input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.search-big input:focus { outline: none; border-color: var(--accent); }
.search-big button { height: 46px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.search-big button:hover { filter: brightness(1.08); }
.empty { padding: 24px 0; color: var(--muted); }
.page-note { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.feed-link { margin-top: 26px; font-size: .88rem; }
.feed-link a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; }
.pager-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager a, .pager-cur { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 650; font-size: .92rem; transition: border-color .15s, color .15s; }
.pager a:hover { border-color: var(--accent); color: var(--accent-ink); }
.pager-cur { background: var(--text); border-color: var(--text); color: var(--bg); }
.pager-gap { color: var(--muted); padding: 0 2px; }

.article-head { margin-bottom: 4px; }
.article-title { margin: 0 0 14px; font-size: clamp(1.85rem, 4.2vw, 2.7rem); line-height: 1.12; font-weight: 820; letter-spacing: -.025em; }
.standfirst { margin: 0 0 14px; max-width: 720px; font-size: 1.2rem; line-height: 1.5; color: var(--text-2); }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 24px; font-size: .9rem; color: var(--muted); }
.lead-image { margin: 0 0 30px; }
.lead-image img { width: 100%; border-radius: var(--radius); background: var(--surface-2); }
figcaption { margin-top: 8px; font-size: .86rem; line-height: 1.45; color: var(--muted); }

.prose { max-width: 720px; font-size: 1.09rem; line-height: 1.75; overflow-wrap: break-word; }
.prose > * { margin: 0 0 1.15em; }
.prose > :last-child { margin-bottom: 0; }
.prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose h2 { margin: 1.8em 0 .6em; font-size: 1.5rem; line-height: 1.25; letter-spacing: -.01em; }
.prose h3 { margin: 1.6em 0 .5em; font-size: 1.24rem; line-height: 1.3; }
.prose h4 { margin: 1.4em 0 .4em; font-size: 1.06rem; }
.prose blockquote { margin: 1.6em 0; padding: 2px 0 2px 20px; border-left: 4px solid var(--accent); color: var(--text-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote p { margin: 0 0 .8em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose figure { margin: 1.8em 0; }
.prose figure img { border-radius: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; }
.prose code { font-family: var(--mono); font-size: .88em; padding: .12em .35em; border-radius: 4px; background: var(--surface-2); }
.prose pre { padding: 14px 16px; border-radius: 8px; background: var(--surface-2); overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.prose pre code { padding: 0; background: none; }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 .15em; }
.prose .update { padding: 12px 16px; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); }
.prose .note { padding: 12px 16px; border-radius: 8px; background: var(--surface-2); font-size: .98rem; }
.prose a.dl { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 650; text-decoration: none; transition: border-color .15s; }
.prose a.dl::before { content: ""; width: 18px; height: 18px; flex: none; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat; }
.prose a.dl:hover { border-color: var(--accent); }

.yt { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #0d0d10; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; color: #fff; background: radial-gradient(circle at 50% 45%, #2a2b33 0%, #0d0d10 70%); }
.yt-play small { font-size: .78rem; opacity: .7; }
.yt-icon { position: relative; width: 68px; height: 48px; border-radius: 14px; background: var(--accent); transition: transform .15s; }
.yt-icon::after { content: ""; position: absolute; left: 28px; top: 15px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.yt-play:hover .yt-icon { transform: scale(1.06); }

.tags, .share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 720px; }
.tags { margin-top: 30px; }
.share { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.tags-label, .share-label { margin-right: 4px; font-size: .74rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.share a, .share button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-2); font-size: .86rem; font-weight: 650; cursor: pointer; transition: border-color .15s, color .15s; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent-ink); }

.article-sponsors { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin-top: 28px; }
.section-title, .widget-title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.section-title::after, .widget-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.related { margin-top: 52px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.mini-media { display: block; margin-bottom: 10px; overflow: hidden; border-radius: 8px; background: var(--surface-2); aspect-ratio: 16 / 10; }
.mini-media img { width: 100%; height: 100%; object-fit: cover; }
.mini-title { margin: 0 0 6px; font-size: 1rem; line-height: 1.35; font-weight: 720; }
.mini-title a:hover { color: var(--accent-ink); }

.sidebar { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular li { counter-increment: pop; border-bottom: 1px solid var(--line); }
.popular li:last-child { border-bottom: 0; }
.popular a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; }
.popular a::before { content: counter(pop); grid-column: 1; grid-row: 1; font-size: 1.35rem; font-weight: 800; line-height: 1; color: var(--accent); }
.pop-title { grid-column: 2; grid-row: 1; font-size: .94rem; font-weight: 650; line-height: 1.38; }
.popular a:hover .pop-title { color: var(--accent-ink); }
.pop-img { grid-column: 3; grid-row: 1; width: 68px; height: 50px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.sponsor-list { display: flex; flex-direction: column; gap: 12px; }
.sponsor { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s; }
.sponsor:hover { border-color: var(--accent); }
.sponsor-img { width: 100%; border-radius: 6px; }
.sponsor-name { font-weight: 750; }
.sponsor-blurb { font-size: .9rem; line-height: 1.45; color: var(--text-2); }
.sponsor-label { position: absolute; top: 10px; right: 12px; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sponsor-wide { flex-direction: row; align-items: center; gap: 16px; padding-right: 90px; }
.sponsor-wide .sponsor-img { width: 120px; flex: none; }
.sponsor-text { display: flex; flex-direction: column; gap: 4px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list > li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.cat-list > li:last-child { border-bottom: 0; }
.cat-list > li > a { font-weight: 700; }
.cat-list a:hover { color: var(--accent-ink); }
.cat-list ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .88rem; color: var(--text-2); }

.site-footer { margin-top: 24px; background: var(--surface); border-top: 1px solid var(--line); font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-top: 42px; padding-bottom: 30px; }
.foot-about p { max-width: 340px; margin: 14px 0 0; color: var(--text-2); line-height: 1.55; }
.foot-h { margin: 0 0 12px; font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.site-footer ul a { color: var(--text-2); }
.site-footer ul a:hover { color: var(--accent-ink); }
.foot-bottom { padding-top: 16px; padding-bottom: 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

@media (max-width: 999px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .sidebar { padding-top: 32px; border-top: 1px solid var(--line); }
}

@media (max-width: 859px) {
  .bar { flex-wrap: wrap; gap: 10px; min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .theme-toggle { margin-left: auto; }
  .search { order: 5; width: 100%; margin: 2px 0 0; }
  .nav-toggle { display: grid; }
  .nav { display: none; }
  .nav.open { display: block; }
  .nav-list { flex-direction: column; gap: 0; padding: 6px 0 12px; }
  .nav-list > li { border-bottom: 1px solid var(--line); }
  .nav-list > li:last-child { border-bottom: 0; }
  .nav-list > li > a { padding: 12px 0; }
  .has-sub > a::after { display: none; }
  .sub, .has-sub:hover > .sub, .has-sub:focus-within > .sub { display: flex; flex-wrap: wrap; gap: 2px 16px; position: static; min-width: 0; padding: 0 0 12px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .sub a { padding: 3px 0; color: var(--muted); }
  .sub a:hover { background: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .layout { padding-top: 22px; }
  .card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card-media { aspect-ratio: 16 / 9; }
  .card-title { font-size: 1.18rem; }
  .prose { font-size: 1.05rem; }
  .standfirst { font-size: 1.1rem; }
  .sponsor-wide { flex-direction: column; align-items: flex-start; padding-right: 14px; }
  .sponsor-wide .sponsor-img { width: 100%; }
  .pager { justify-content: center; }
}

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

@media print {
  .site-header, .sidebar, .site-footer, .share, .related, .article-sponsors, .pager { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; }
}
