/* Light through glass: controls float above a quiet, readable canvas. */
:root {
  --paper: #f5f7fb;
  --ink: #242b39;
  --muted: #5c6678;
  --blue: #2852cf;
  --blue-deep: #2142a8;
  --line: #dce2eb;
  --wash: #edf1f7;
  --tint: #e8efff;
  --glass: rgba(255, 255, 255, .10);
  --glass-edge: rgba(255, 255, 255, .82);
  --glass-sheen: linear-gradient(128deg, rgba(255,255,255,.34), rgba(255,255,255,.015) 38%, rgba(255,255,255,.035) 68%, rgba(255,255,255,.2));
  --glass-shadow: 0 12px 30px -18px rgba(38, 57, 92, .24), 0 2px 6px rgba(38, 57, 92, .035);
  --glass-rim: inset 0 1px 0 rgba(255,255,255,.95), inset 1px 0 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(108,133,174,.12);
  --spring: cubic-bezier(.22, .9, .25, 1.12);
  scroll-padding-top: 120px;
}
body { background: radial-gradient(ellipse 680px 390px at 78% 0, rgba(155,192,235,.34), transparent 78%), radial-gradient(ellipse 460px 430px at 98% 340px, rgba(167,206,217,.25), transparent 75%), radial-gradient(ellipse 520px 390px at 8% 480px, rgba(236,213,195,.23), transparent 80%), var(--paper); }
body > .header {
  position: sticky; top: 16px; z-index: 30;
  min-height: 78px; padding: 10px 16px 10px 26px; margin-top: 20px;
  border: 1px solid var(--glass-edge); border-radius: 28px;
  background: var(--glass-sheen), var(--glass); box-shadow: var(--glass-shadow), var(--glass-rim);
  border-bottom-color: rgba(140,161,193,.22); border-right-color: rgba(255,255,255,.4);
  -webkit-backdrop-filter: blur(8px) saturate(1.45); backdrop-filter: blur(8px) saturate(1.45);
  isolation: isolate;
}
/* Light is on the surface; the material underneath remains transparent. */
body > .header::before, body > .header::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; }
body > .header::before { padding: 1px; background: linear-gradient(115deg, #fff, rgba(255,255,255,.1) 32%, rgba(255,255,255,.07) 67%, rgba(255,255,255,.88)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
body > .header::after { background: radial-gradient(ellipse 180px 75px at var(--light-x, 24%) var(--light-y, 0%), rgba(255,255,255,.65), rgba(255,255,255,.12) 45%, transparent 75%); opacity: .52; transition: opacity 240ms ease; }
body > .header.has-light::after { opacity: .9; }
.header .wordmark { font-size: 34px; padding: 4px 0; }
.site-nav { position: relative; gap: 4px; isolation: isolate; }
.site-nav a { position: relative; padding: 9px 16px; color: var(--muted); border-radius: 18px; font-size: 13px; min-height: 44px; }
.site-nav a[aria-current="page"] { color: var(--blue-deep); background: rgba(255,255,255,.16); }
.site-nav a:hover { color: var(--blue-deep); background: rgba(255,255,255,.2); }
.site-nav.lens-ready a { background: transparent; }
.nav-lens {
  position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .98); border-radius: 18px;
  background: linear-gradient(155deg, rgba(255,255,255,.48), rgba(255,255,255,.04) 48%, rgba(198,219,246,.16));
  border-bottom-color: rgba(117,147,193,.2);
  box-shadow: 0 3px 9px rgba(38,68,113,.08), var(--glass-rim);
  transition: transform 380ms var(--spring), width 320ms var(--ease), height 320ms var(--ease);
}
.skip-link { z-index: 50; }
body > main { padding-top: 12px; }
body > footer { margin-top: 44px; border-color: var(--line); }
.button, .secondary, .project-filter, .subtle {
  border-radius: 999px; min-height: 44px;
  transition: transform 220ms var(--spring), box-shadow 220ms ease, background-color 180ms ease, color 180ms ease;
}
.button { background: linear-gradient(145deg, #4268df, #284dc5); border: 1px solid rgba(255,255,255,.5); box-shadow: 0 5px 16px -7px rgba(37,75,190,.5), inset 0 1px 0 rgba(255,255,255,.3); }
.button:hover { background: linear-gradient(145deg, #375bce, #2445af); transform: translateY(-2px); box-shadow: 0 9px 22px -9px rgba(37,75,190,.5); }
.button.secondary, .project-filter, .subtle { color: var(--ink); background: var(--glass-sheen), var(--glass); border: 1px solid var(--glass-edge); box-shadow: 0 2px 8px rgba(47,66,100,.05), var(--glass-rim); }
.project-filter[aria-pressed="true"] { background: linear-gradient(145deg, rgba(255,255,255,.3), rgba(181,204,250,.22)); color: var(--blue-deep); border-color: #b6c6e6; box-shadow: var(--glass-rim); }
.panel, .home-postcard { background: var(--glass-sheen), var(--glass); border: 1px solid var(--glass-edge); border-bottom-color: rgba(140,161,193,.2); border-radius: 24px; box-shadow: var(--glass-shadow), var(--glass-rim); -webkit-backdrop-filter: blur(6px) saturate(1.25); backdrop-filter: blur(6px) saturate(1.25); }
.panel { padding: 30px; }
.panel input, .panel textarea, .search { background: rgba(255,255,255,.85); border-color: #d1d9e5; border-radius: 13px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 3px; }
.collection-card .collection-link { padding: 12px 12px 21px; border-radius: 25px; background: var(--glass-sheen), var(--glass); border: 1px solid var(--glass-edge); border-bottom-color: rgba(140,161,193,.2); box-shadow: var(--glass-shadow), var(--glass-rim); transition: transform 340ms var(--spring), box-shadow 340ms ease; }
.collection-card .collection-art { border-radius: 16px; }
.collection-card .collection-caption, .collection-card .collection-link > p { margin-inline: 8px; }
.collection-card .collection-caption h2 { font-size: 19px; }
.collection-card .collection-link:hover { transform: translateY(-5px); box-shadow: 0 20px 45px -24px rgba(47,66,100,.3), inset 0 1px 0 #fff; }
.collection-card .collection-link > p { font-size: 13px; }
.note-row { padding-inline: 12px; border-radius: 10px; transition: background-color 180ms, transform 250ms var(--ease); }
.note-row:hover { background: rgba(255,255,255,.65); transform: translateX(3px); }
.life-gallery a, .preview-image { border-radius: 17px; }
.project-reader .project-toc { top: 116px; max-height: calc(100dvh - 142px); }
.project-reader .toc-resizer { top: 116px; }
.project-prose h2, .project-prose h3 { scroll-margin-top: 120px; }
.project-prose { color: #262d38; }
.project-prose pre, .prose pre { border: 1px solid var(--line); border-radius: 14px; }
.project-sources { background: rgba(255,255,255,.4); padding-inline: 14px; border-radius: 12px; }

/* Homepage: a personal introduction, one moment, three quiet entrances. */
.home-quiet { max-width: 1000px; }
.home-introduction { display: grid; grid-template-columns: minmax(0,1fr) 292px; align-items: center; gap: 60px; padding: 64px 0 40px; }
.home-words .hero-greeting { font-size: 14px; letter-spacing: .08em; margin-bottom: 16px; }
.home-words .hero-title { font-size: clamp(54px,6.8vw,82px); white-space: nowrap; margin-bottom: 22px; }
.home-description { color: var(--muted); font-size: 17px; line-height: 2; margin-bottom: 0; }
.home-postcard { padding: 18px; transform: rotate(2deg); transition: transform 400ms var(--spring), box-shadow 400ms ease; }
.home-postcard:hover, .home-postcard:focus-within { transform: rotate(0deg) translateY(-3px); }
.postcard-heading { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 0 3px 12px; }
.postcard-heading > a { display: grid; place-items: center; color: var(--blue); width: 44px; height: 44px; margin: -12px -7px -5px 0; }
.postcard-content { min-height: 210px; }
.postcard-content > .status { display: grid; place-items: center; min-height: 210px; }
.postcard-entry { display: block; }
.postcard-entry > img { display: block; width: 100%; height: 165px; object-fit: cover; border-radius: 12px; }
.postcard-entry > p { margin: 12px 2px 6px; font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.postcard-entry > time { font-size: 11px; color: var(--muted); margin-inline: 2px; }
.postcard-text { min-height: 210px; display: flex; flex-direction: column; justify-content: center; }
.postcard-text > p { font-family: "Songti SC", serif; font-size: 20px; -webkit-line-clamp: 4; }
.postcard-empty { display: flex; min-height: 210px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.postcard-symbol { color: #6282c8; font-size: 48px; font-weight: 200; line-height: 1.5; margin-bottom: 16px; }
.postcard-empty > span:not(.postcard-symbol) { font-size: 14px; }
.postcard-empty > small { margin-top: 8px; font-size: 11px; color: var(--muted); }
nav.home-entrances { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 34px; margin: 16px 0 34px; }
.home-entrances .home-entrance { display: flex; flex-direction: column; align-items: center; padding: 18px 8px 20px; border-radius: 20px; background: transparent; color: var(--ink); white-space: normal; min-width: 0; }
.home-entrance .entrance-drawing { width: 168px; height: 112px; max-width: 100%; color: #52657c; overflow: visible; transition: transform 450ms var(--spring), filter 350ms ease; filter: drop-shadow(0 5px 2px rgba(58,83,130,.06)); }
.drawing-accent { stroke: #4a72d5; }
.entrance-title { display: flex; align-items: center; gap: 16px; font-size: 17px; font-weight: 550; margin: 14px 0 4px; }
.entrance-title > span { color: var(--blue); font-size: 15px; transition: transform 250ms var(--spring); }
.entrance-hint { color: var(--muted); font-size: 12px; }
.home-entrances .home-entrance:hover, .home-entrances .home-entrance:focus-visible { color: var(--blue-deep); background: transparent; }
.home-entrance:hover .entrance-drawing, .home-entrance:focus-visible .entrance-drawing { transform: translateY(-8px) rotate(-3deg); filter: drop-shadow(0 12px 4px rgba(58,83,130,.12)); }
.home-entrance:hover .entrance-title > span { transform: translate(2px,-2px); }

/* Admin uses the same material for chrome; the editor stays opaque. */
.admin-shell .admin-sidebar nav { padding: 8px; border: 1px solid var(--glass-edge); border-radius: 21px; background: var(--glass-sheen), var(--glass); box-shadow: var(--glass-shadow), var(--glass-rim); }
.admin-shell .admin-sidebar button { border-radius: 14px; min-height: 44px; }
.admin-shell .admin-stat { border-color: var(--glass-edge); border-radius: 21px; background: var(--glass-sheen), var(--glass); box-shadow: var(--glass-rim); }
.admin-shell .admin-form, .admin-shell .admin-login { background: rgba(255,255,255,.88); border: 1px solid var(--glass-edge); border-radius: 24px; box-shadow: var(--glass-shadow); }
.admin-shell .admin-login { padding: 36px; margin-top: 40px; background: var(--glass-sheen), var(--glass); box-shadow: var(--glass-shadow), var(--glass-rim); -webkit-backdrop-filter: blur(6px) saturate(1.25); backdrop-filter: blur(6px) saturate(1.25); }
.admin-shell .admin-login h1 { font-size: clamp(30px,3.5vw,44px); }
.admin-shell .admin-quiet, .admin-shell .admin-secondary, .admin-shell .admin-danger { min-height: 44px; border-radius: 999px; }
.admin-shell #article-body { background: #fff; }
.admin-shell input:not([type=file]), .admin-shell textarea, .admin-shell select { border-radius: 11px; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { body > .header, .panel, .home-postcard, .admin-shell .admin-login { background: #f9fafc; } }
@media (max-width: 900px) {
  .home-introduction { gap: 30px; grid-template-columns: minmax(0,1fr) 250px; }
  .home-words .hero-title { font-size: 56px; }
  .project-reader .project-toc { position: static; max-height: none; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 19px; }
}
@media (max-width: 650px) {
  body > .header { top: 8px; width: calc(100% - 24px); margin-top: 10px; padding: 12px 10px 8px; gap: 5px; border-radius: 24px; flex-direction: column; min-height: 108px; }
  .header .wordmark { font-size: 28px; line-height: 1; padding: 0 0 4px; }
  .header .site-nav { width: 100%; display: flex; justify-content: space-between; gap: 0; }
  .site-nav a { padding: 9px 12px; font-size: 12px; min-height: 44px; }
  .home-introduction { grid-template-columns: minmax(0,1fr); padding: 40px 0 16px; gap: 30px; }
  .home-words { text-align: center; }
  .home-words .hero-title { font-size: clamp(48px,12vw,66px); margin-left: 0; margin-bottom: 16px; }
  .home-words .hero-greeting { font-size: 12px; }
  .home-description { font-size: 14px; line-height: 1.85; }
  .home-postcard { width: min(310px,100%); justify-self: center; padding: 14px 16px; border-radius: 21px; transform: rotate(1deg); }
  .postcard-content, .postcard-empty, .postcard-text, .postcard-content > .status { min-height: 135px; }
  .postcard-entry > img { height: 145px; }
  .postcard-symbol { font-size: 30px; margin-bottom: 7px; }
  nav.home-entrances { gap: 8px; margin-top: 12px; margin-bottom: 8px; }
  .home-entrances .home-entrance { padding-inline: 0; }
  .home-entrance .entrance-drawing { width: 100px; height: 76px; }
  .entrance-title { font-size: 15px; gap: 7px; margin-top: 7px; }
  .entrance-hint { font-size: 11px; }
  .panel { padding: 22px; }
  body > footer { flex-wrap: wrap; gap: 12px 20px; margin-top: 30px; padding: 22px 0; }
  .project-prose h2, .project-prose h3 { scroll-margin-top: 140px; }
  :root { scroll-padding-top: 140px; }
  .admin-shell .admin-login { padding: 24px; margin-top: 10px; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  body { background: var(--paper); }
  body > .header, .panel, .home-postcard, .collection-card .collection-link, .project-reader .project-toc, .admin-shell .admin-sidebar nav, .admin-shell .admin-stat, .admin-shell .admin-login, .admin-shell .admin-form, .project-filter, .button.secondary, .subtle { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #a9b5c7; }
  body > .header::before, body > .header::after { display: none; }
  .nav-lens { background: #e6edfa; border-color: #b7c7e5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .home-postcard, .home-postcard:hover, .home-postcard:focus-within, .collection-card .collection-link:hover, .home-entrance:hover .entrance-drawing, .home-entrance:focus-visible .entrance-drawing, .note-row:hover, .button:hover { transform: none; }
}

/* Independent glass pills retain their spacing; only selection light travels. */
.glass-tabs { position: relative; isolation: isolate; display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 36px; }
.glass-tabs .nav-lens { z-index: 0; border-radius: 999px; border-color: #b6c6e6; background: linear-gradient(145deg, rgba(255,255,255,.3), rgba(181,204,250,.22)); box-shadow: var(--glass-rim); }
.glass-tabs .project-filter { position: relative; z-index: 1; }
.glass-tabs.lens-ready .project-filter:is([aria-pressed="true"],[aria-current="page"]) { background: var(--glass-sheen), var(--glass); border-color: transparent; }
.life-collections { margin-top: 0; margin-bottom: 42px; }
.life-collections .collection-link[aria-current="true"] { border-color: #a0b8e4; box-shadow: var(--glass-shadow), var(--glass-rim); }
#life-records { scroll-margin-top: 130px; }
.life-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.life-category { font-size: 12px; color: var(--blue-deep); text-decoration: none; border: 1px solid rgba(131,159,211,.3); border-radius: 999px; padding: 3px 11px; background: rgba(255,255,255,.2); }
.panel select { width: 100%; min-height: 44px; border: 1px solid #d1d9e5; border-radius: 13px; padding: 10px 12px; background: rgba(255,255,255,.65); color: var(--ink); font: inherit; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass-tabs .nav-lens { background: #e6edfa; }
  .glass-tabs.lens-ready .project-filter:is([aria-pressed="true"],[aria-current="page"]) { background: transparent; }
}

/* Collections open onto a category-specific stream of personal posts. */
.life-index-actions { display: flex; align-items: center; flex-shrink: 0; gap: 10px; }
.life-index-actions > a, .life-page-tabs > a { display: inline-flex; align-items: center; justify-content: center; }
.life-page-tabs > a[aria-current="page"] { color: var(--blue-deep); }
.life-back { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--muted); margin-top: 28px; }
.life-category-page .page-title { margin-top: 28px; margin-bottom: 28px; }
.life-category-page .life-feed { margin: 28px auto 60px; }
.life-category-page .life-entry { padding: 26px; margin-bottom: 28px; border: 1px solid var(--glass-edge); border-bottom-color: rgba(140,161,193,.2); border-radius: 24px; background: rgba(255,255,255,.18); box-shadow: var(--glass-shadow), var(--glass-rim); scroll-margin-top: 130px; }
.life-author { color: var(--ink); font-size: 14px; font-weight: 550; }
.life-category-page .life-meta { row-gap: 4px; }
.life-category-page .life-caption { font-size: 16px; margin: 18px 0 20px; }
.life-category-page .life-gallery { gap: 8px; }
.life-category-page .life-gallery a { border-radius: 12px; }
@media (max-width: 650px) {
  .life-heading:has(.life-index-actions) { flex-wrap: wrap; }
  .life-index-actions { width: 100%; }
  .life-category-page .life-entry { padding: 18px; border-radius: 20px; margin-bottom: 22px; scroll-margin-top: 140px; }
  .life-category-page .life-caption { font-size: 15px; }
  .life-category-page .life-meta time { font-size: 11px; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .life-category-page .life-entry { background: #fff; border-color: #a9b5c7; }
}
