/* みどぽ。 — twilight */
:root {
  --bg: #f3f2f8;
  --surface: #ffffff;
  --ink: #1d1b3a;
  --muted: #625f80;
  --line: #dedbed;
  --accent: #5546d6;
  --chip: #e8e5fb;
  --chip-ink: #3b2fae;
  --ridge-back: color-mix(in srgb, var(--bg) 58%, #4a3a9a);
  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --r-img: 14px;
  --header-h: 60px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0c1e;
  --surface: #16152b;
  --ink: #edebfa;
  --muted: #a3a0c2;
  --line: #2a2848;
  --accent: #a69bff;
  --chip: #26244a;
  --chip-ink: #d0c9ff;
  --ridge-back: color-mix(in srgb, var(--bg) 66%, #5a4bd0);
  color-scheme: dark;
}

/* sky (time of day) */
:root { --sky: linear-gradient(180deg, #1b1745 0%, #4b2a7a 38%, #b8447f 68%, #ff8a4c 100%); }
:root[data-sky="dawn"] { --sky: linear-gradient(180deg, #2a2a6b 0%, #7a5fb0 40%, #f08aa8 72%, #ffc58a 100%); }
:root[data-sky="day"] { --sky: linear-gradient(180deg, #173d8a 0%, #2f6fcf 55%, #8cc3f7 100%); }
:root[data-sky="night"] { --sky: linear-gradient(180deg, #060614 0%, #12123a 55%, #2d2a6e 100%); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.8 var(--font-body); letter-spacing: .01em;
  overflow-wrap: anywhere; word-break: normal; word-break: auto-phrase; line-break: strict;
}
img, svg, iframe { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }
.section { padding-block: 40px 72px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-in { height: 100%; display: flex; align-items: center; gap: 6px; }
.brand { font: 900 22px/1 var(--font-head); text-decoration: none; margin-right: auto; letter-spacing: .02em; }
.nav { display: flex; gap: 2px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--chip); }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--chip); }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #5546d6, #e24a8d, #ff8a4c); display: none; }
.is-post .progress { display: block; }

/* header on top of the hero (home only) */
.is-home .site-header:not(.is-scrolled) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; }
.is-home .site-header:not(.is-scrolled) .nav a { color: rgba(255, 255, 255, .85); }
.is-home .site-header:not(.is-scrolled) .nav a:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.is-home .site-header:not(.is-scrolled) .icon-btn { color: #fff; }
.is-home .site-header:not(.is-scrolled) .icon-btn:hover { background: rgba(255, 255, 255, .16); }

/* hero */
.hero { position: relative; overflow: hidden; background: var(--sky); color: #fff; margin-top: calc(var(--header-h) * -1); padding-top: var(--header-h); isolation: isolate; }
.hero-in { padding: clamp(40px, 9vh, 88px) 0 clamp(150px, 24vw, 250px); position: relative; z-index: 2; }
.hero-title { margin: 0; font: 900 clamp(72px, 15vw, 176px)/1.02 var(--font-head); letter-spacing: -.01em; text-shadow: 0 2px 30px rgba(20, 10, 60, .25); }
.hero-lede { margin: 18px 0 0; font-size: clamp(15px, 2vw, 19px); max-width: 30em; text-shadow: 0 1px 12px rgba(20, 10, 60, .35); }
.orb { position: absolute; z-index: 1; border-radius: 50%; width: clamp(150px, 22vw, 260px); aspect-ratio: 1; right: 12%; bottom: 3%;
  background: radial-gradient(circle at 50% 38%, #ffe2a8 0%, #ff9a55 55%, #e24a8d 100%); box-shadow: 0 0 120px 40px rgba(255, 138, 76, .45); }
:root[data-sky="dawn"] .orb { right: 62%; background: radial-gradient(circle at 50% 38%, #fff1c9, #ffb27a 60%, #f08aa8); box-shadow: 0 0 120px 40px rgba(255, 190, 140, .4); }
:root[data-sky="day"] .orb { bottom: auto; top: 14%; width: clamp(80px, 11vw, 130px); background: #fff8d8; box-shadow: 0 0 90px 36px rgba(255, 246, 190, .6); }
:root[data-sky="night"] .orb { bottom: auto; top: 14%; width: clamp(70px, 10vw, 120px);
  background: radial-gradient(circle at 35% 35%, #fff, #cfc9f5 70%); box-shadow: 0 0 80px 24px rgba(180, 170, 255, .28); }
:root[data-sky="night"] .hero::before { content: ""; position: absolute; inset: 0; z-index: 0; opacity: .9;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 58% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 73% 20%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 90% 38%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 55%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 36% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 56%, #fff 50%, transparent 51%); }
.ridge { position: absolute; z-index: 2; left: 0; bottom: -1px; width: 100%; height: clamp(90px, 15vw, 190px); display: block; }
.ridge-back { fill: var(--ridge-back); }
.ridge-front { fill: var(--bg); }

/* chips / pills / meta */
.chip { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); font-size: 12px; line-height: 22px; text-decoration: none; font-weight: 700; }
a.chip:hover { filter: brightness(.96); }
.tag { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin: 0 14px 6px 0; }
.tag::before { content: "#"; opacity: .6; }
.tag:hover { color: var(--accent); }
.meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.pill { text-decoration: none; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.pill small { margin-left: 6px; color: var(--muted); font-size: 12px; }
.pill:hover { border-color: var(--accent); }
.pill.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.is-active small { color: inherit; opacity: .7; }

/* thumbnails */
.thumb { aspect-ratio: 16 / 10; border-radius: var(--r-img); overflow: hidden; background: var(--chip); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.thumb-none { display: grid; place-items: center; background: linear-gradient(180deg, #1b1745 0%, #4b2a7a 38%, #b8447f 68%, #ff8a4c 100%); color: rgba(255, 255, 255, .92); font: 900 clamp(22px, 3vw, 34px)/1 var(--font-head); }
.thumb-lg { aspect-ratio: 16 / 11; }

/* feature + grid */
.feature a { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; text-decoration: none; margin-bottom: 56px; }
.feature-body h2 { margin: 12px 0 12px; font: 900 clamp(24px, 3.2vw, 38px)/1.35 var(--font-head); text-wrap: balance; }
.feature-body p { margin: 0 0 18px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { font-weight: 700; color: var(--accent); border-bottom: 2px solid currentColor; padding-bottom: 1px; }
.feature a:hover .thumb img, .tile a:hover .thumb img { transform: scale(1.03); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 40px 28px; }
.tile a { display: block; text-decoration: none; }
.tile-body { padding-top: 14px; }
.tile h3 { margin: 8px 0 0; font: 700 17px/1.55 var(--font-head); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.tile a:hover h3 { color: var(--accent); }
.empty { color: var(--muted); padding: 48px 0; }

/* pager */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 56px; }
.pager a { text-decoration: none; min-width: 40px; text-align: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.pager a.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* page head / archive */
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0 0 6px; font: 900 clamp(28px, 4.5vw, 44px)/1.3 var(--font-head); }
.page-head p { margin: 0; color: var(--muted); }
.year h2 { font: 900 28px/1 var(--font-head); margin: 40px 0 8px; display: flex; align-items: baseline; gap: 12px; }
.year h2 small { font: 400 14px var(--font-body); color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.rows a { text-decoration: none; font-weight: 700; }
.rows a:hover { color: var(--accent); }
.sub-h { font: 900 22px var(--font-head); margin: 48px 0 20px; }
.btn { display: inline-block; text-decoration: none; background: var(--ink); color: var(--bg); padding: 10px 22px; border-radius: 999px; font-weight: 700; }
.btn-quiet { appearance: none; font: inherit; font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--line); padding: 6px 16px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.6; }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }

/* post */
.post-head { max-width: 860px; margin: clamp(28px, 6vw, 64px) 0 28px; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.post-head h1 { margin: 0 0 14px; font: 900 clamp(27px, 4.6vw, 46px)/1.4 var(--font-head); text-wrap: balance; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.cover { margin: 0 0 clamp(28px, 5vw, 52px); border-radius: 20px; overflow: hidden; aspect-ratio: 21 / 9; max-height: 420px; background: var(--chip); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
.post-main { min-width: 0; max-width: 740px; }
.post-side { display: none; }
@media (min-width: 1100px) {
  .post-grid { grid-template-columns: minmax(0, 740px) 260px; justify-content: space-between; }
  .post-side { display: block; }
  .toc-inline { display: none; }
  .toc-side { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; }
}
.toc { font-size: 14px; line-height: 1.6; }
.toc-title { margin: 0 0 10px; font: 900 15px var(--font-head); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc li.l2 { counter-increment: t; }
.toc li.l2 a::before { content: counter(t) ". "; font-variant-numeric: tabular-nums; }
.toc li.l3 a { padding-left: 30px; font-size: 13px; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--accent); border-left-color: var(--accent); font-weight: 700; }
.toc-inline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-img); padding: 18px 22px; margin-bottom: 36px; }

.prose { font-size: 17px; line-height: 2; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.5em; }
.prose a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose h2 { position: relative; margin: 2.6em 0 1em; padding-left: 20px; font: 900 clamp(22px, 3vw, 27px)/1.5 var(--font-head); text-wrap: balance; }
.prose h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 6px; border-radius: 3px; background: linear-gradient(180deg, #5546d6, #e24a8d 60%, #ff8a4c); }
.prose h3 { margin: 2.2em 0 .8em; font: 700 20px/1.6 var(--font-head); }
.prose h4 { margin: 2em 0 .6em; font: 700 17px/1.6 var(--font-head); }
.prose img { height: auto; border-radius: 12px; display: block; margin: 1.2em 0; cursor: zoom-in; }
.prose a > img { cursor: pointer; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1.5em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--line); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3em 0; }
.prose code { font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--chip); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #14132b; color: #e9e7ff; padding: 18px 20px; border-radius: var(--r-img); overflow-x: auto; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: inherit; }
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
.prose table { border-collapse: collapse; min-width: 100%; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--chip); }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.6em 0; border-radius: var(--r-img); overflow: hidden; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* link card (affiliate / external) */
a.linkcard { display: flex; gap: 16px; align-items: stretch; margin: 1.4em 0; padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-img); text-decoration: none; color: var(--ink); line-height: 1.6; }
a.linkcard:hover { border-color: var(--accent); }
.lc-thumb { flex: 0 0 96px; display: block; }
.lc-thumb img { width: 96px; height: 96px; object-fit: contain; margin: 0; border-radius: 8px; background: #fff; cursor: inherit; }
.lc-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.lc-title { font-weight: 700; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-site { font-size: 12px; color: var(--accent); }

.post-tags { margin-top: 48px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.share-label { font-size: 14px; color: var(--muted); margin-right: 6px; }
.author { display: flex; gap: 18px; align-items: flex-start; max-width: 740px; margin: 56px 0 0; padding: 24px; background: var(--surface); border-radius: 18px; }
.author img { border-radius: 50%; flex: none; }
.author p { margin: 0; font-size: 14px; color: var(--muted); }
.author .author-name { font: 900 17px var(--font-head); color: var(--ink); margin-bottom: 2px; }
.author-links { display: flex; gap: 14px; margin-top: 8px; font-size: 14px; }
.author-links a { color: var(--accent); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 740px; margin-top: 24px; }
.prevnext a { display: block; text-decoration: none; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-img); background: var(--surface); }
.prevnext a:hover { border-color: var(--accent); }
.prevnext small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.prevnext span { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prevnext .is-next { text-align: right; }
.related { margin: 80px 0 72px; }
.related h2 { font: 900 24px var(--font-head); margin: 0 0 24px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.footer-in { display: grid; gap: 14px; }
.footer-brand .brand { color: var(--ink); font-size: 20px; }
.footer-brand p { margin: 4px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { text-decoration: none; color: var(--ink); }
.footer-links a:hover { color: var(--accent); }
.notice { margin: 0; font-size: 12.5px; max-width: 60em; }
.copy { margin: 0; font-size: 13px; }

/* dialogs */
.dlg { width: min(640px, 100% - 32px); max-height: 80vh; margin: 12vh auto auto; padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(10, 5, 40, .45); }
.dlg::backdrop, .lb::backdrop { background: rgba(8, 6, 30, .6); backdrop-filter: blur(4px); }
.dlg-in { padding: 16px; }
.search-row { display: flex; gap: 10px; }
#search-input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
#search-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search-results { list-style: none; margin: 12px 0 0; padding: 0; overflow: auto; max-height: calc(80vh - 100px); }
.search-results a { display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none; }
.search-results a:hover, .search-results a:focus-visible { background: var(--chip); }
.search-results strong { display: block; font-family: var(--font-head); line-height: 1.5; }
.search-results span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.search-results .none { color: var(--muted); padding: 14px; }
.lb { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 24px; border: 0; background: transparent; display: none; place-items: center; }
.lb[open] { display: grid; }
.lb img { max-width: min(1200px, 100%); max-height: calc(100vh - 80px); object-fit: contain; border-radius: 10px; cursor: zoom-out; }
.lb-close { position: fixed; top: 16px; right: 16px; appearance: none; border: 0; background: rgba(255, 255, 255, .92); color: #1d1b3a; padding: 8px 18px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; }

/* responsive */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .pills { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding-inline: 20px; scrollbar-width: none; }
  .pill { white-space: nowrap; flex: none; }
  .nav a { padding: 8px 8px; }
  .feature a { grid-template-columns: 1fr; margin-bottom: 40px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .tile h3 { font-size: 15px; }
  .prose { font-size: 16px; line-height: 1.95; }
  .cover { aspect-ratio: 16 / 10; border-radius: 14px; }
  .rows li { grid-template-columns: 48px 1fr; }
  .rows .chip { display: none; }
  .prevnext { grid-template-columns: 1fr; }
  a.linkcard { gap: 12px; }
  .lc-thumb, .lc-thumb img { flex-basis: 72px; width: 72px; height: 72px; }
}
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } .nav a { padding: 8px 6px; font-size: 13px; } .brand { font-size: 20px; } }
