/* Lab Notes: トップの一覧行、記事一覧のカード、記事ページ。土台は css/home.css。 */
.note-card-news, .note-row-news, .note-tag-news { --note-c: var(--acid); --note-fg: var(--ink); }
.note-card-press, .note-row-press, .note-tag-press { --note-c: var(--ink); --note-fg: var(--acid); }
.note-card-blog, .note-row-blog, .note-tag-blog { --note-c: #c9d5f1; --note-fg: var(--ink); }
.note-card-site, .note-row-site, .note-tag-site { --note-c: #e8e7de; --note-fg: var(--ink); }

.note-tag { display: inline-block; width: fit-content; padding: .05rem .5rem; border: 1px solid var(--ink); border-radius: 3px; background: var(--note-c, var(--ink)); color: var(--note-fg, #fff); font-family: var(--f-mono), 'Noto Sans JP', sans-serif; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; line-height: 1.7; white-space: nowrap; }

/* ---------- Top page: rows ---------- */
.notes-home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.notes-home-head h2 { font-family: var(--f-display); font-size: clamp(3rem, 8vw, 8rem); font-weight: 800; line-height: .9; letter-spacing: -.06em; }
.notes-home-head h2 span { color: var(--acid-deep); }
.notes-home-head p { flex: 1 1 18rem; max-width: 24rem; color: var(--muted); font-size: .9375rem; }
.note-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.note-row { position: relative; isolation: isolate; display: grid; grid-template-columns: 7rem 8rem minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: clamp(1.1rem, 2vw, 1.6rem) 0; border-bottom: 1px solid var(--ink); }
.note-row::before { content: ''; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1; background: var(--note-c); transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease); }
.note-row:hover::before { transform: scaleY(1); }
.note-row-press:hover { color: var(--paper); }
.note-row time { font-family: var(--f-mono); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.note-row-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.note-row strong { font-size: clamp(1.1rem, 1.9vw, 1.5rem); font-weight: 700; line-height: 1.45; letter-spacing: -.03em; transition: translate .5s var(--ease); }
.note-row:hover strong { translate: .3em 0; }
.note-row-summary { overflow: hidden; color: var(--muted); font-size: .875rem; text-overflow: ellipsis; white-space: nowrap; }
.note-row-press:hover .note-row-summary { color: var(--on-dark-muted); }
.note-row-arrow { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid currentColor; border-radius: 50%; transition: rotate .5s var(--spring), background .3s, color .3s; }
.note-row:hover .note-row-arrow { rotate: 45deg; background: var(--ink); color: var(--acid); }
.note-row-press:hover .note-row-arrow { background: var(--acid); color: var(--ink); }

/* ---------- Notes index: cards ---------- */
.notes-hero .notes-hero-links { margin-top: 1.25rem; }
.notes-hero-links a { display: inline-block; padding: .25rem .75rem; border: 1px solid var(--ink); border-radius: 3px; font-family: var(--f-mono); font-size: .75rem; font-weight: 700; transition: background .2s; }
.notes-hero-links a:hover { background: var(--acid); }
.notes-section { padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem); }
.note-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.note-filter { padding: .45rem 1rem; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .875rem; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.note-filter:hover { background: var(--paper-2); }
.note-filter.is-active { background: var(--ink); color: var(--paper); }
.note-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.note-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 340px; overflow: hidden; border: 1px solid var(--ink); border-radius: var(--radius-lg); background: var(--surface); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.note-card:hover { transform: translateY(-4px); box-shadow: 6px 6px 0 var(--ink); }
.note-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 1.4rem; border-bottom: 1px solid var(--ink); background: var(--note-c); color: var(--note-fg); }
.note-card-code { font-family: var(--f-display); font-size: clamp(2.4rem, 4vw, 3.6rem); font-weight: 800; line-height: .9; letter-spacing: -.06em; }
.note-card-top time { padding-top: .3rem; font-family: var(--f-mono); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.note-card-body { display: flex; flex: 1; flex-direction: column; gap: .6rem; padding: 1.25rem 4.25rem 1.4rem 1.25rem; }
.note-card-body strong { font-size: 1.1875rem; font-weight: 700; line-height: 1.5; letter-spacing: -.03em; word-break: auto-phrase; text-wrap: balance; }
.note-card-summary { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .875rem; line-height: 1.8; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.note-card-arrow { position: absolute; right: 1rem; bottom: 1rem; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--acid); font-size: 1.15rem; transition: rotate .5s var(--spring); }
.note-card:hover .note-card-arrow { rotate: 45deg; }
.note-card[hidden] { display: none; }
.note-empty { padding: 3rem 0; color: var(--muted); text-align: center; }

/* ---------- Article ---------- */
.note-article-head { width: 100%; max-width: calc(48rem + 2 * var(--gutter)); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) var(--gutter) clamp(1.75rem, 4vw, 2.75rem); }
.note-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ink); font-family: var(--f-mono); font-size: .8125rem; }
.note-article-meta .note-tag { background: var(--note-c); color: var(--note-fg); }
.note-article-meta time, .note-updated { color: var(--muted); font-variant-numeric: tabular-nums; }
.note-article-head h1 { margin: clamp(1.25rem, 3vw, 2rem) 0 1rem; font-family: var(--f-sig); font-size: clamp(1.9rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.25; letter-spacing: -.06em; overflow-wrap: anywhere; text-wrap: balance; }
.note-article-lead { position: relative; padding-left: 1.1rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.9; }
.note-article-lead::before { content: ''; position: absolute; left: 0; top: .3em; bottom: .3em; width: 4px; background: var(--note-c); box-shadow: 0 0 0 1px var(--ink); }
.note-body { max-width: 48rem; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) var(--gutter) 3rem; box-sizing: content-box; }
.note-body p, .note-body li { color: #3d413a; font-size: 1.0625rem; line-height: 2.05; overflow-wrap: anywhere; }
.note-body p { margin: 0 0 1.4rem; }
.note-body strong { color: var(--ink); font-weight: 700; background: linear-gradient(transparent 62%, rgb(197 242 59 / .7) 62%); }
.note-body h2 { margin: 3.25rem 0 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--ink); font-family: var(--f-sig); font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 800; line-height: 1.45; letter-spacing: -.05em; }
.note-body h3 { margin: 2.25rem 0 .8rem; font-size: 1.2rem; font-weight: 700; line-height: 1.6; }
.note-body ul, .note-body ol { margin: 0 0 1.6rem; padding-left: 1.4rem; }
.note-body li::marker { color: var(--acid-deep); }
.note-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--acid-deep); text-decoration-thickness: 2px; text-underline-offset: .25em; }
.note-body a:hover { background: var(--acid); text-decoration-color: var(--ink); }
.note-body img { display: block; height: auto; margin: 2rem 0; border: 1px solid var(--ink); border-radius: var(--radius-md); }
.note-body blockquote { margin: 0 0 1.6rem; padding: 1.1rem 1.4rem; border: 1px solid var(--ink); border-left-width: 6px; border-radius: var(--radius-sm); background: var(--surface); }
.note-body blockquote p { margin: 0; }
.note-body code { padding: .1rem .4rem; border-radius: 3px; background: var(--paper-2); color: var(--ink); font-family: var(--f-mono); font-size: .88em; }
.note-body hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }
.note-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; max-width: calc(48rem + 2 * var(--gutter)); margin: 0 auto 2.5rem; padding: 0 var(--gutter); }
.note-pager a { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.25rem; border: 1px solid var(--ink); border-radius: var(--radius-md); background: var(--surface); font-weight: 600; line-height: 1.6; transition: background .2s, transform .3s var(--ease), box-shadow .3s var(--ease); }
.note-pager a:hover { background: var(--acid); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.note-pager small { color: var(--muted); font-family: var(--f-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .06em; }
.note-pager a:hover small { color: var(--ink); }
.note-pager-next { grid-column: 2; text-align: right; }
.note-pager .is-empty { display: none; }

/* ---------- Comments (giscus) ---------- */
.note-comments { width: 100%; max-width: calc(48rem + 2 * var(--gutter)); margin: 0 auto 2.5rem; padding: 0 var(--gutter); }
.note-comments-inner { padding: clamp(1.5rem, 3.5vw, 2.5rem); border: 1px solid var(--ink); border-radius: var(--radius-lg); background: var(--surface); }
.note-comments .eyebrow { color: var(--muted); }
.note-comments h2 { margin: .5rem 0 .9rem; font-family: var(--f-sig); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; line-height: 1.4; letter-spacing: -.05em; }
.note-comments p { color: var(--muted); font-size: .9375rem; line-height: 1.95; }
.note-comments a { text-decoration: underline; text-decoration-color: var(--acid-deep); text-decoration-thickness: 2px; text-underline-offset: .25em; }
.note-comments a:hover { background: var(--acid); }
.note-comments .pill-button { margin: 1.4rem 0 0; }
.note-comments .pill-button[hidden] { display: none; }
.note-comments-mount { margin-top: 1rem; }
.note-comments-mount:empty { display: none; }
.note-comments-mail { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .875rem !important; }

.is-fun .note-card:nth-child(3n + 1) { rotate: -.6deg; }
.is-fun .note-card:nth-child(3n + 2) { rotate: .5deg; }
.is-fun .note-card-code { display: inline-block; rotate: -4deg; }

@media (max-width: 1100px) {
    .note-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .note-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem .9rem; }
    .note-row time { grid-area: 1 / 1; }
    .note-row .note-tag { grid-area: 1 / 2; justify-self: start; }
    .note-row-text { grid-area: 2 / 1 / 3 / 3; }
    .note-row-arrow { grid-area: 1 / 3 / 3 / 4; width: 40px; height: 40px; }
    .note-row-summary { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 680px) {
    .note-list { grid-template-columns: 1fr; }
    .note-card { min-height: 0; }
    .note-pager { grid-template-columns: 1fr; }
    .note-pager-next { grid-column: auto; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    .note-card:hover, .note-pager a:hover { transform: none; }
}
