/* Cards: thumbnails keep their own shape, nothing is cropped */
.page-title { font: 700 var(--fs-2) var(--font-display); letter-spacing: -0.02em; margin: 0 0 var(--sp-4); }
.card { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); break-inside: avoid; }
.card-thumb { display: block; border-radius: var(--r-card); }
.thumb { position: relative; border-radius: var(--r-card); overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, transparent); transition: border-radius 150ms var(--ease); }
.card:hover .thumb { border-radius: 4px; }
.thumb img, .thumb video { display: block; width: 100%; height: auto; }
.thumb-ph { display: grid; place-items: center; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.thumb-ph span { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-5); letter-spacing: -0.02em; color: var(--muted); }
.play-badge { position: absolute; right: var(--sp-3); bottom: var(--sp-3); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, 0.82); color: #fff; }
.play-badge svg { width: 20px; height: 20px; }
.card-body { min-width: 0; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-0); letter-spacing: -0.02em; line-height: 1.3; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; display: block; }
.card-title a:hover { color: var(--teal-deep); text-decoration: underline; }
.card-summary { margin: var(--sp-1) 0 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-small); }

.masonry { list-style: none; margin: 0; padding: 0; column-width: 280px; column-gap: var(--sp-4); }
.masonry > .card { margin-bottom: var(--sp-6); }
.grid > .empty { grid-column: 1 / -1; }

.row-section + .row-section { margin-top: var(--sp-7); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-3); }
.row-head h2 { margin: 0; font-size: var(--fs-1); }
.see-all { font-weight: 600; }
.cards-slider > .card { flex: 0 0 min(300px, 78vw); align-self: flex-start; }

.detail-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.detail-head h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.share-btn svg, .contact-btn svg { width: 20px; height: 20px; margin-right: var(--sp-2); }
.gallery-single { margin-bottom: var(--sp-5); }
.gallery > .slide-media { flex: 0 0 auto; max-width: 100%; display: grid; place-items: center; }
.gallery .media img, .gallery .media video, .gallery-single .media img, .gallery-single .media video { max-height: 75vh; max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--r-card); display: block; }
.slider + .prose, .gallery-single + .prose { margin-top: var(--sp-5); }
.slider { margin-bottom: var(--sp-5); }
.detail-links { margin: 0 0 var(--sp-5); }
.detail-sub { margin: 0 0 var(--sp-3); font-size: var(--fs-0); color: var(--muted); font-weight: 600; }
.post-date { margin: calc(var(--sp-3) * -1) 0 var(--sp-4); color: var(--muted); font-size: var(--fs-small); display: flex; align-items: center; gap: var(--sp-2); }
.card-meta time, .post-date time { font-variant-numeric: tabular-nums; }
.new-chip { display: inline-block; padding: 1px 8px; margin-right: var(--sp-2); border-radius: var(--r-pill); background: var(--teal-deep); color: var(--on-teal); font-size: 0.75rem; font-weight: 600; line-height: 1.5; }
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-link { background: var(--paper); border-radius: var(--r-card); }
.link-tile { display: flex; align-items: center; gap: var(--sp-4); min-height: 72px; padding: var(--sp-3) var(--sp-4); color: var(--ink); text-decoration: none; border-radius: var(--r-card); }
.link-tile:hover { background: color-mix(in srgb, var(--teal) 12%, transparent); }
.link-text { display: grid; min-width: 0; }
.link-text .card-title, .link-text .card-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-head { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--sp-6); align-items: center; padding: var(--sp-6); background: var(--paper); border-radius: var(--r-feature); }
.avatar { width: 160px; height: 160px; border-radius: 50%; overflow: hidden; background: var(--surface); display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-5); color: var(--muted); }
.profile-id h1 { margin: 0; }
.profile-bio { margin: var(--sp-2) 0 0; font-size: var(--fs-1); color: var(--ink); }
.hire-badge { display: inline-flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 0; padding: 4px 14px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal-deep); font-weight: 600; }
.hire-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.profile-id .actions { margin-top: var(--sp-4); }
.contact-btn { display: inline-flex; align-items: center; border: 1px solid var(--field-border); border-radius: var(--r-pill); padding: 0 var(--sp-4); }
.about-block { margin-top: var(--sp-7); }
.about-block h2 { font-size: var(--fs-1); margin: 0 0 var(--sp-3); }
.skill-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.skill-chips li { padding: 6px 14px; border-radius: var(--r-btn); background: color-mix(in srgb, var(--ink) 7%, transparent); font-weight: 600; }

.prose { max-width: 68ch; }
.prose h2, .prose h3, .prose h4 { margin-top: var(--sp-6); }
.prose pre, .prose code { font-family: var(--font-mono); font-size: 0.9em; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 6px; }
.prose code { padding: 1px 6px; }
.prose pre { padding: var(--sp-4); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin: var(--sp-4) 0; padding: 0 var(--sp-4); border-left: 3px solid var(--teal); color: var(--muted); }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-card); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-6) 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: var(--sp-3); font-weight: 600; }

.skeleton {
  height: 20px; border-radius: 6px; margin-bottom: var(--sp-4); max-width: 640px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 8%, transparent), color-mix(in srgb, var(--ink) 16%, transparent), color-mix(in srgb, var(--ink) 8%, transparent));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton-title { height: 44px; max-width: 360px; }
.skeleton-short { max-width: 320px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.toasts { position: fixed; right: var(--sp-4); bottom: 16px; z-index: 95; display: grid; gap: var(--sp-2); max-width: min(92vw, 360px); }
.toast { padding: 12px 16px; border-radius: var(--r-btn); background: var(--ink); color: var(--on-ink); font-weight: 600; animation: page-in 200ms var(--ease); }
.toast-error { background: var(--error); color: var(--on-error); }

dialog.dialog { padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink); max-width: min(92vw, 480px); }
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.52); }
dialog.dialog h2 { font-size: var(--fs-1); }
dialog.dialog .actions { justify-content: flex-end; margin-top: var(--sp-5); }

@media (max-width: 699.98px) {
  .profile-head { grid-template-columns: 1fr; justify-items: start; padding: var(--sp-5); }
  .avatar { width: 112px; height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .toast { animation: none; }
  .thumb { transition: none; }
}

.actions { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }

.card-post, .card-folder { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-feature); overflow: hidden; gap: 0; transition: transform 200ms var(--ease), border-color 200ms var(--ease); }
.card-post:hover, .card-folder:hover { transform: translateY(-3px); border-color: var(--teal); }
.card-post .card-thumb, .card-post .thumb { border-radius: 0; }
.card-post:hover .thumb { border-radius: 0; }
.card-post .card-body { padding: var(--sp-4); }
.card-post .card-title a::after { content: ""; position: absolute; inset: 0; }
.card-post { position: relative; }

.folder-link { display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-4); color: var(--ink); text-decoration: none; min-height: 112px; }
.folder-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 9999px; border: 1px solid var(--nav-border); background: var(--surface); color: var(--folder, var(--accent)); }
.folder-ico svg { width: 20px; height: 20px; }
.folder-ico-lg { width: 56px; height: 56px; border-radius: 9999px; }
.folder-ico-lg svg { width: 24px; height: 24px; }
.folder-text { display: grid; gap: 2px; min-width: 0; }
.folder-text .card-meta { margin-top: var(--sp-1); }
.folders-slider > .card { flex: 0 0 min(300px, 78vw); }
.folder-head { display: flex; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.folder-head .page-title { margin-bottom: var(--sp-1); }
.folder-desc { margin: 0 0 var(--sp-2); max-width: 68ch; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .card-post, .card-folder { transition: none; } .card-post:hover, .card-folder:hover { transform: none; } }

.card-folder-tag { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); font-size: var(--fs-small); font-weight: 600; color: var(--folder, var(--teal)); }
.card-folder-tag svg { width: 16px; height: 16px; flex: none; }

.nc-coral { --note-bg: #FAAFA8; --ink: #1D2B44; }
.nc-peach { --note-bg: #F39F76; --ink: #1D2B44; }
.nc-sand { --note-bg: #FFF8B8; --ink: #1D2B44; }
.nc-mint { --note-bg: #E2F6D3; --ink: #1D2B44; }
.nc-sage { --note-bg: #B4DDD3; --ink: #1D2B44; }
.nc-fog { --note-bg: #D4E4ED; --ink: #1D2B44; }
.nc-storm { --note-bg: #AECCDC; --ink: #1D2B44; }
.nc-dusk { --note-bg: #D3BFDB; --ink: #1D2B44; }
.nc-blossom { --note-bg: #F6E2DD; --ink: #1D2B44; }
.nc-clay { --note-bg: #E9E3D4; --ink: #1D2B44; }
.nc-chalk { --note-bg: #EFEFF1; --ink: #1D2B44; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nc-coral { --note-bg: #77172E; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-peach { --note-bg: #692B17; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-sand { --note-bg: #7C4A03; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-mint { --note-bg: #264D3B; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-sage { --note-bg: #0C625D; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-fog { --note-bg: #256377; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-storm { --note-bg: #284255; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-dusk { --note-bg: #472E5B; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-blossom { --note-bg: #6C394F; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-clay { --note-bg: #4B443A; --ink: #E8EDF5; }
  :root:not([data-theme="light"]) .nc-chalk { --note-bg: #232427; --ink: #E8EDF5; }
}
:root[data-theme="dark"] .nc-coral { --note-bg: #77172E; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-peach { --note-bg: #692B17; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-sand { --note-bg: #7C4A03; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-mint { --note-bg: #264D3B; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-sage { --note-bg: #0C625D; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-fog { --note-bg: #256377; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-storm { --note-bg: #284255; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-dusk { --note-bg: #472E5B; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-blossom { --note-bg: #6C394F; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-clay { --note-bg: #4B443A; --ink: #E8EDF5; }
:root[data-theme="dark"] .nc-chalk { --note-bg: #232427; --ink: #E8EDF5; }
.card-note[class*="nc-"], .sx-note[class*="nc-"], .sx-note-sheet[class*="nc-"], .sx-note-preview[class*="nc-"] { background: var(--note-bg); }

.copy-row { display: flex; justify-content: flex-end; margin: 0 0 var(--sp-3); }
.copy-btn svg { width: 18px; height: 18px; margin-right: var(--sp-2); }
.note-blocks { display: grid; gap: var(--sp-4); margin-top: var(--sp-5); }
.note-block-card { padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.note-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.note-block-title { margin: 0; font-size: var(--fs-1); overflow-wrap: anywhere; }
.note-block-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
