/* Final layout overrides are loaded after the historical stylesheet. */
:root { --body-leading: 1.82; }
.home-editorial.home-tools {
  width: min(1280px, calc(100% - 3rem));
  grid-template-columns: minmax(270px, .76fr) minmax(360px, 1.24fr) minmax(340px, 1fr);
  grid-auto-rows: 1fr;
  align-items: stretch;
  margin: 3rem auto 5rem;
}
.home-editorial.home-tools > .home-sidebar,
.home-editorial.home-tools > .home-notes-column,
.home-editorial.home-tools > .home-media-column {
  height: 100% !important;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: clamp(.8rem, 1.5vw, 1.2rem);
}
.home-notes-column .latest-notes { min-height: 0; flex: 1 1 auto; }
.home-notes-column .latest-short-notes { flex: 0 0 auto; }
.home-notes-column .latest-notes__list { flex: none; }
.home-media-column .latest-albums { min-height: 0; flex: 1 1 auto; }
.home-media-column .latest-albums__grid { grid-template-columns: 1fr; grid-template-rows: none; }
.home-media-column .clock-card { min-height: 158px; flex: 0 0 auto; padding: .85rem; }
.home-media-column .clock-card .clock-card__film { min-height: 140px; padding: 1rem; }
.home-media-column .clock-card strong { font-size: clamp(2.65rem, 4vw, 4rem); }
.home-sidebar .calendar-card { min-height: 0; flex: 0 0 auto; padding: 1rem; }
.home-sidebar .calendar-card header { align-items: flex-start; gap: .5rem; }
.home-sidebar .calendar-card header > div:first-child { min-width: 0; display: block; }
.home-sidebar .calendar-jump { gap: .25rem; margin-top: .4rem; }
.home-sidebar .calendar-picker > button { min-width: 0; height: 2rem; padding: 0 .48rem; font-size: .72rem; }
.home-sidebar .calendar-arrows { padding-top: 1.45rem; }
.home-sidebar .calendar-arrows button { width: 2rem; height: 2rem; }
.home-sidebar .calendar-week { margin-top: .65rem; font-size: .66rem; }
.home-sidebar .calendar-day { min-height: 1.72rem; font-size: .72rem; }
.home-sidebar .calendar-day i { bottom: .08rem; }
.home-sidebar .recent-update { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; padding: 1.15rem; }
.home-sidebar .recent-update > .section-kicker { margin-bottom: .55rem; }
.home-sidebar .recent-update > a { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: .45rem; padding: .15rem; border-radius: .75rem; transition: color .24s ease, background .24s ease, transform .24s ease; }
.home-sidebar .recent-update > a:hover,
.home-sidebar .recent-update > a:focus-visible { color: var(--blue-deep); background: rgba(131,172,199,.08); transform: translateY(-1px); }
.home-sidebar .recent-update a > span { color: var(--muted); font-size: .72rem; }
.home-sidebar .recent-update h2 { margin: 0; font: 600 clamp(1.2rem, 1.55vw, 1.5rem)/1.4 var(--serif); }
.home-sidebar .recent-update a > p { margin: .1rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.72; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.home-sidebar .recent-update b { display: inline-flex; align-items: center; gap: .3rem; margin-top: auto; padding-top: .4rem; color: var(--blue-deep); font-size: .76rem; }
.home-sidebar .recent-update b svg { width: .9rem; height: .9rem; }

.notes-page { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1rem, 2.2vw, 2rem); align-items: start; }
.notes-page .long-notes-board { margin-top: 0; }
.short-note-timeline { --note-time-width: 3.8rem; --note-dot-width: 1.15rem; --note-gap: .35rem; --note-pad: .55rem; }
.short-note-timeline::before { left: calc(var(--note-pad) + var(--note-time-width) + var(--note-gap) + var(--note-dot-width) / 2); }
.short-note-item { grid-template-columns: var(--note-time-width) var(--note-dot-width) minmax(0, 1fr); gap: var(--note-gap); padding-inline: var(--note-pad); }
.short-note-item time { align-items: flex-start; }
.short-note-item__dot { width: .82rem; height: .82rem; justify-self: center; transition: background .24s ease, box-shadow .24s ease, transform .28s cubic-bezier(.2,.8,.2,1); }
.short-note-item:hover .short-note-item__dot { background: #5386a5; box-shadow: 0 0 0 5px rgba(93,145,176,.2); transform: scale(1.18); }
.short-note-item__content { padding-left: .15rem; font-size: .9rem; }
.short-note-item__content p { margin: .18rem 0; }
.short-note-tag { gap: .28rem; }
.short-note-tag--image { color: #4d7995; border-color: rgba(85,135,166,.2); background: rgba(216,234,244,.72); }
[data-theme="dark"] .short-note-tag--image { color: #acd6eb; border-color: rgba(127,190,223,.28); background: rgba(27,66,87,.72); }
.short-note-tag svg {
  width: .88rem;
  height: .88rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.development-log-pagination { grid-column: 1 / -1; margin-top: 1.4rem; }
.development-log-card {
  margin-top: 0;
  background: rgba(251,253,254,.78);
  color: var(--ink);
  border-color: rgba(102,141,165,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.development-log-card:hover,
.development-log-card:focus-visible {
  background: rgba(245,250,253,.94);
  border-color: rgba(102,153,185,.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 5px 16px rgba(38,66,83,.07);
  transform: translateY(-1px);
}
.development-log-card:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 3px; }
[data-theme="dark"] .development-log-card {
  background: rgba(13,31,45,.94);
  border-color: rgba(148,181,202,.16);
  box-shadow: inset 0 1px 0 rgba(202,222,235,.05);
}
[data-theme="dark"] .development-log-card:hover,
[data-theme="dark"] .development-log-card:focus-visible {
  background: rgba(18,40,56,.98);
  border-color: rgba(137,190,222,.32);
  box-shadow: inset 0 1px 0 rgba(202,222,235,.08), 0 5px 16px rgba(0,8,15,.14);
}
.development-log-card h2 { color: var(--ink); }
.development-log-card p { color: var(--muted); line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .development-log-card { transition: none; }.development-log-card:hover { transform: none; } }

.article-body,
.about-body,
.about-content-section,
.short-note-item__content { line-height: var(--body-leading); }
.article-body p,
.article-body li,
.article-body blockquote p,
.about-content-section p,
.short-note-item__content p { line-height: var(--body-leading); }
.article-reading-inner .article-body p { text-align: justify; text-justify: inter-ideograph; }

.article-hero--editorial { width: calc(100% - clamp(1rem, 5vw, 6rem)); max-width: none; }
.article-reading-layout { width: min(1380px, calc(100% - 2rem)); margin: -4.5rem auto 0; grid-template-columns: minmax(0, 1fr) minmax(290px, 330px); overflow: visible !important; }
.article-reading-layout .article-reading-cloth { margin: 0; border-radius: 1.9rem; box-shadow: 0 26px 70px rgba(43,61,71,.12), inset 0 1px 0 rgba(255,255,255,.94); }
.article-reading-inner { padding: clamp(1.4rem, 3vw, 2.6rem); }
.article-reading-inner .article-header { width: 100%; max-width: none; }
.article-reading-inner .article-header h1 { width: 100%; max-width: none; font-size: clamp(2rem, 3.2vw, 3.35rem); line-height: 1.18; text-wrap: pretty; }
.article-reading-inner .article-body { width: 100%; max-width: none; }
.article-inline-return {
  width: max-content;
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  margin-bottom: 1rem;
  padding: .62rem .85rem;
  color: var(--ink);
  background: rgba(247,246,242,.76);
}
.article-inline-return svg { width: 1rem; fill: none; stroke: currentColor; }
.article-detail { overflow: visible; }
.article-side-column { position: sticky !important; top: 6.5rem; align-self: start; height: max-content; margin-top: 5.2rem; }
.article-side-column--toc-only { margin-top: 5.2rem; }

@media (max-width: 1120px) {
  .home-editorial.home-tools { grid-template-columns: minmax(250px, .82fr) minmax(0, 1.35fr); grid-auto-rows: auto; }
  .home-editorial.home-tools > .home-media-column { grid-column: 1 / -1; height: auto !important; }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .article-reading-layout { width: calc(100% - 1.5rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 310px); align-items: start; }
  .article-reading-layout .article-reading-cloth { width: 100%; margin: 0; }
  .article-side-column { position: sticky !important; top: 6.5rem; display: grid; }
  .article-author-card { display: block; }
  .article-side-column .article-toc { position: relative; top: auto; width: 100%; height: auto; max-height: none; padding: 1.35rem; opacity: 1; transform: none; pointer-events: auto; }
  .article-toc-toggle { display: none; }
}

@media (max-width: 900px) {
  .notes-page { grid-template-columns: 1fr; }
  .notes-page .long-notes-board { margin-top: 0; }
  .article-reading-layout { width: 100%; margin-top: -2rem; display: block; }
  .article-reading-layout .article-reading-cloth { width: calc(100% - 1rem); margin: 0 auto; }
  .article-side-column,
  .article-side-column--toc-only { position: static !important; margin-top: 0; }
}

@media (max-width: 760px) {
  .home-editorial.home-tools { width: min(100% - 1rem, 560px); grid-template-columns: 1fr; margin: 1rem auto 3rem; }
  .home-editorial.home-tools > .home-sidebar,
  .home-editorial.home-tools > .home-notes-column,
  .home-editorial.home-tools > .home-media-column { height: auto !important; display: flex; }
  .home-sidebar .calendar-card { flex: none; }
  .short-note-timeline { --note-time-width: 2.9rem; --note-dot-width: .95rem; --note-gap: .28rem; --note-pad: .25rem; }
  .home-media-column .clock-card { min-height: 150px; }
  .article-hero--editorial { width: 100%; }
}

/* Mobile layout safety pass: keep every reading surface inside one shared frame. */
.article-detail {
  --article-frame-width: min(1380px, calc(100% - clamp(1rem, 5vw, 6rem)));
}
.article-detail .article-hero--editorial,
.article-detail .article-reading-layout {
  width: var(--article-frame-width);
  max-width: var(--article-frame-width);
}
.article-reading-layout > *,
.article-reading-cloth,
.article-reading-inner,
.article-header,
.article-body,
.article-side-column { min-width: 0; }
.article-header h1,
.article-body,
.article-body * { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .article-detail { --article-frame-width: calc(100% - 1rem); }
  .article-detail .article-hero--editorial,
  .article-detail .article-reading-layout,
  .article-reading-layout .article-reading-cloth {
    width: var(--article-frame-width) !important;
    max-width: var(--article-frame-width) !important;
    margin-inline: auto !important;
  }
  .article-detail .article-reading-layout {
    margin-top: -1.5rem;
    overflow: visible !important;
  }
  .article-reading-inner { width: 100%; padding: 1.2rem; overflow: hidden; }
  .article-reading-inner .article-header h1 {
    max-width: 100%;
    font-size: clamp(1.65rem, 7.4vw, 2.2rem);
    line-height: 1.2;
    word-break: break-all;
    text-wrap: wrap;
  }
  .article-header__meta { max-width: 100%; flex-wrap: wrap; gap: .55rem .8rem; }
  .reading-size { max-width: 100%; flex-wrap: wrap; }
  .article-reading-inner .article-body img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    transform: none;
  }
  .article-side-column,
  .article-side-column--toc-only {
    position: static !important;
    width: 0;
    height: 0;
    margin: 0;
  }
  .article-author-card { display: none; }
  .article-side-column .article-toc {
    position: fixed !important;
    z-index: 101;
    top: 0;
    right: 0;
    display: block;
    width: min(22rem, calc(100vw - 1rem));
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 5.25rem 1.15rem 1.5rem;
    overflow-y: auto;
    border-radius: 1.2rem 0 0 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(105%, 0, 0);
    transition: opacity .25s ease, visibility .25s ease, transform .38s cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
  }
  .article-side-column .article-toc.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }
  .article-side-column .article-toc header button { display: grid; }
  .article-toc-toggle {
    position: fixed;
    z-index: 99;
    right: .75rem;
    bottom: 4.75rem;
    display: grid;
  }
}

@media (max-width: 760px) {
  .site-header,
  .site-header.is-scrolled {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
  }
  .site-header .glass-nav,
  .site-header.is-scrolled .glass-nav {
    display: grid !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    overflow: hidden;
  }
  .site-header .glass-nav a,
  .site-header.is-scrolled .glass-nav a {
    width: 100%;
    min-width: 0 !important;
    padding-inline: .08rem;
    font-size: .72rem;
  }
  .site-header .header-search,
  .site-header.is-scrolled .header-search {
    position: absolute;
    z-index: 4;
    top: .3rem;
    right: .3rem;
    display: grid;
  }
  /* The globe remains first-class on phones; only its drawing detail is reduced in JS. */
  .footprints { width: calc(100% - 1rem); padding: .85rem; overflow: hidden; }
  .footprints__layout {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem;
    min-height: 0;
    padding: .55rem;
  }
  .globe-shell {
    order: 1;
    display: block !important;
    width: 100%;
    min-width: 0;
    height: min(82vw, 360px);
    min-height: 290px;
    visibility: visible !important;
  }
  .globe-shell canvas,
  .globe-point-layer { display: block !important; visibility: visible !important; }
  .footprint-list { order: 2; width: 100%; min-width: 0; }
  .footprint-list__body { width: 100%; max-height: 290px; overflow: auto; }

  /* Notes use a single, bounded column on narrow screens. */
  .notes-page {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: .65rem;
    overflow: hidden;
  }
  .short-notes-board,
  .long-notes-board { width: 100%; min-width: 0; padding: 1rem; overflow: hidden; }
  .short-note-periods { width: 100%; max-width: 100%; }
  .long-notes-board > .glass-filter {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0 1.25rem;
    overflow-x: auto;
  }
  .long-notes-board > .glass-filter a { flex: 0 0 auto; }
  .short-note-timeline {
    --note-time-width: 2.75rem;
    --note-dot-width: .9rem;
    --note-gap: .22rem;
    --note-pad: 0rem;
    width: 100%;
  }
  .short-note-item {
    width: 100%;
    min-width: 0;
    grid-template-columns: var(--note-time-width) var(--note-dot-width) minmax(0, 1fr);
    padding-block: .85rem;
    overflow: hidden;
  }
  .short-note-item time strong { font-size: .88rem; }
  .short-note-item__content { min-width: 0; padding-left: .05rem; font-size: .86rem; }
  .short-note-item__content p,
  .short-note-item__content a { max-width: 100%; overflow-wrap: anywhere; }
  .short-note-tags { max-width: 100%; }
  .notes-list,
  .note-row,
  .note-row__content { min-width: 0; max-width: 100%; }

  /* About content follows the markdown order in one clean mobile column. */
  .about-page { width: calc(100% - 1rem); max-width: calc(100% - 1rem); padding: 1rem; overflow: hidden; }
  .about-me-layout { width: 100%; display: flex; flex-direction: column; gap: 1rem; }
  .about-body { display: contents; }
  .about-avatar-card { order: 1; width: 100%; min-height: 0; padding: .35rem; }
  .about-content-section { order: 2; width: 100%; min-width: 0; grid-column: auto; padding: 1rem; }
  .about-content-section--blog { order: 3; }
  .about-me-layout > .about-portrait { order: 4; position: static; width: min(100%, 330px); margin: 0 auto; }
  .about-content-section--wide { order: 5; width: 100%; grid-column: auto; }
  .about-content-section p,
  .about-content-section li,
  .about-content-section a { max-width: 100%; overflow-wrap: anywhere; }
  .about-contact ul { width: 100%; display: flex; flex-wrap: wrap; overflow: visible; }
  .about-contact li { min-width: 0; }
}

/* Theme control and a complete blue-black reading palette. */
.header-search,
.theme-toggle {
  position: relative;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 2.8rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #f5f9fb;
  cursor: pointer;
  pointer-events: auto;
  transition: color .35s ease, background .35s ease, border-color .35s ease, transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}
.header-search:hover,
.theme-toggle:hover { color: var(--ink); background: rgba(255,255,255,.82); transform: translateY(-1px); }
.header-search:active,
.theme-toggle:active { transform: translateY(0) scale(.9); }
.theme-toggle { margin-left: .45rem; }
.theme-toggle svg { position: absolute; width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; transition: opacity .38s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.theme-toggle__sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle__moon { opacity: 0; transform: rotate(-50deg) scale(.45); }
[data-theme="dark"] .theme-toggle__sun { opacity: 0; transform: rotate(70deg) scale(.45); }
[data-theme="dark"] .theme-toggle__moon { opacity: 1; transform: rotate(0) scale(1); }
.site-header.is-scrolled .header-search,
.site-header.is-scrolled .theme-toggle {
  color: var(--ink);
  border-color: rgba(255,255,255,.76);
  background: linear-gradient(135deg, rgba(247,251,252,.82), rgba(210,228,239,.68));
  box-shadow: inset 0 1px 0 white, 0 10px 26px rgba(21,42,55,.14);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
.theme-is-switching *, .theme-is-switching *::before, .theme-is-switching *::after { transition-duration: .45s !important; }

.about-body > p { margin-block: .25rem; line-height: 1.45; }
.clock-card { transition: transform .42s cubic-bezier(.2,.8,.2,1), box-shadow .42s ease; }
.clock-card__film { transition: none; }
.clock-card:hover { transform: translateY(-4px); box-shadow: 0 26px 55px rgba(28,48,61,.16); }

.article-toc-backdrop { display: none; }

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #071521;
  --paper-bright: #0b1c2a;
  --ink: #e9f2f7;
  --muted: #9cb0bd;
  --blue: #7bc8f1;
  --blue-deep: #69bce9;
  --line: rgba(126,183,216,.2);
  --shadow-cloth: 0 24px 70px rgba(0,6,13,.38), inset 0 1px 0 rgba(177,222,246,.13);
}
[data-theme="dark"] body { color: var(--ink); background: radial-gradient(circle at 50% 0, #102b3f 0, #071723 32rem, #050f18 100%); }
[data-theme="dark"] body::before { opacity: .24; filter: invert(1); }
[data-theme="dark"] .content-cloth,
[data-theme="dark"] .page-content,
[data-theme="dark"] .short-notes-board,
[data-theme="dark"] .long-notes-board,
[data-theme="dark"] .article-reading-cloth,
[data-theme="dark"] .about-content-section,
[data-theme="dark"] .article-author-card,
[data-theme="dark"] .friend-card,
[data-theme="dark"] .album-card {
  color: var(--ink);
  border-color: rgba(117,185,222,.28);
  background: linear-gradient(145deg, rgba(13,34,50,.94), rgba(6,22,34,.96));
  box-shadow: var(--shadow-cloth);
}
[data-theme="dark"] .site-footer { color: #91a8b7; background: #040d15; border-color: rgba(113,174,208,.16); }
[data-theme="dark"] .glass-panel,
[data-theme="dark"] .glass-control,
[data-theme="dark"] .glass-nav,
[data-theme="dark"] .glass-filter { border-color: rgba(133,203,239,.35); background: linear-gradient(135deg, rgba(22,57,80,.68), rgba(7,25,39,.58)); box-shadow: inset 0 1px 0 rgba(193,231,250,.2), 0 14px 36px rgba(0,5,12,.34); }
[data-theme="dark"] .site-header.is-scrolled .brand,
[data-theme="dark"] .site-header.is-scrolled .glass-nav,
[data-theme="dark"] .site-header.is-scrolled .header-search,
[data-theme="dark"] .site-header.is-scrolled .theme-toggle { border-color: rgba(129,200,238,.38); background: rgba(8,29,45,.78); box-shadow: inset 0 1px 0 rgba(186,227,249,.18), 0 12px 30px rgba(0,5,12,.36); }
[data-theme="dark"] .site-header.is-scrolled .brand,
[data-theme="dark"] .site-header.is-scrolled .glass-nav a,
[data-theme="dark"] .site-header.is-scrolled .header-search { color: var(--ink); }
[data-theme="dark"] .glass-nav::before,
[data-theme="dark"] .glass-filter::before { border-color: rgba(124,207,250,.6); background: linear-gradient(145deg, rgba(90,174,220,.38), rgba(26,87,122,.42)); box-shadow: inset 0 1px 0 rgba(219,242,253,.35), 0 0 24px rgba(63,175,232,.32); }
[data-theme="dark"] .glass-nav a:hover,
[data-theme="dark"] .glass-nav a.is-active { color: #f5fbff; background: rgba(91,176,222,.18); }
[data-theme="dark"] .glass-nav a.is-active::before { background: #8bd6ff; box-shadow: 0 0 10px #60c6ff; }
[data-theme="dark"] .section-kicker,
[data-theme="dark"] a:hover,
[data-theme="dark"] .article-row__meta a,
[data-theme="dark"] .photo-index-heading p:first-child { color: var(--blue); }
[data-theme="dark"] p,
[data-theme="dark"] time,
[data-theme="dark"] .article-row__body > p,
[data-theme="dark"] .album-card__body p { color: var(--muted); }
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] strong,
[data-theme="dark"] .article-body { color: var(--ink); }
[data-theme="dark"] .article-row,
[data-theme="dark"] .short-note-preview,
[data-theme="dark"] .short-note-item,
[data-theme="dark"] .note-row { border-color: rgba(122,181,214,.18); }
[data-theme="dark"] .default-cover { background: linear-gradient(135deg, #173b53, #0a2133); }
[data-theme="dark"] .search-overlay__backdrop { background: rgba(2,9,15,.72); }
[data-theme="dark"] .search-dialog,
[data-theme="dark"] .calendar-popover { color: var(--ink); border-color: rgba(126,195,232,.3); background: rgba(7,24,37,.96); }
[data-theme="dark"] .search-field,
[data-theme="dark"] .search-result,
[data-theme="dark"] .calendar-picker__menu,
[data-theme="dark"] .reading-size { color: var(--ink); border-color: rgba(128,190,223,.22); background: rgba(11,35,52,.82); }
[data-theme="dark"] .search-field input { color: var(--ink); }
[data-theme="dark"] .calendar-day.has-content { color: #dff5ff; background: rgba(71,151,195,.24); }
[data-theme="dark"] .short-note-tag { border-color: rgba(123,191,226,.28); background: rgba(36,103,139,.18); }
[data-theme="dark"] .article-body blockquote { color: #b8d1df; border-color: #61b9e7; background: rgba(58,137,179,.12); }
[data-theme="dark"] .article-body code { color: #b9e7ff; background: rgba(71,150,193,.18); }
[data-theme="dark"] .article-adjacent a { border-color: rgba(124,189,224,.24); background: rgba(10,34,51,.72); }

@media (max-width: 760px) {
  .site-header,
  .site-header.is-scrolled { grid-template-columns: 2.45rem minmax(0, 1fr) 2.45rem !important; }
  .site-header .brand,
  .site-header.is-scrolled .brand { grid-column: 2; grid-row: 1; justify-self: center; max-width: calc(100vw - 8rem); }
  .site-header .header-search,
  .site-header.is-scrolled .header-search { position: static; grid-column: 1; grid-row: 1; width: 2.45rem; height: 2.45rem; }
  .site-header .theme-toggle,
  .site-header.is-scrolled .theme-toggle { position: static; grid-column: 3; grid-row: 1; width: 2.45rem; height: 2.45rem; margin: 0; }
  .site-header .glass-nav,
  .site-header.is-scrolled .glass-nav { grid-column: 1 / -1; grid-row: 2; }
  .about-page > .about-tabs.glass-filter {
    width: 100%;
    max-width: 22rem;
    margin: 0 auto 1rem;
  }

  /* Full-screen viewing uses a compact brand, not the two-row page navigation. */
  body:has(.gallery) .site-header,
  body:has(.gallery) .site-header.is-scrolled {
    top: env(safe-area-inset-top, 0px);
    width: 100%;
    height: 3.45rem;
    padding: 0;
    pointer-events: none;
  }
  body:has(.gallery) .site-header .glass-nav,
  body:has(.gallery) .site-header .header-search,
  body:has(.gallery) .site-header .theme-toggle { display: none !important; }
  body:has(.gallery) .site-header .brand {
    position: absolute;
    top: .8rem;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 8rem);
    margin: 0;
    padding: 0;
    border: 0;
    color: white;
    background: transparent;
    box-shadow: none;
    transform: translateX(-50%);
    pointer-events: auto;
  }
  .gallery-back,
  .gallery-music {
    top: calc(env(safe-area-inset-top, 0px) + .45rem);
    width: 2.75rem;
    height: 2.75rem;
  }
  .gallery-back { left: .55rem; }
  .gallery-music { right: .55rem; }
}

@media (max-width: 900px) {
  .article-toc-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: block;
    border: 0;
    opacity: 0;
    visibility: hidden;
    background: rgba(8,19,27,.35);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity .28s ease, visibility .28s ease;
  }
  .article-toc-backdrop.is-open { opacity: 1; visibility: visible; }
  .article-side-column .article-toc {
    top: auto !important;
    right: 1rem !important;
    bottom: 1rem;
    width: min(19rem, calc(100vw - 2rem)) !important;
    height: auto !important;
    max-height: min(70dvh, 34rem) !important;
    padding: 1rem !important;
    border-radius: 1.25rem !important;
    transform: translate3d(0, 1rem, 0) scale(.96) !important;
    transform-origin: right bottom;
  }
  .article-side-column .article-toc.is-open { transform: translate3d(0, 0, 0) scale(1) !important; }
  .article-side-column .article-toc header { position: sticky; top: 0; z-index: 2; padding-bottom: .7rem; background: inherit; }
  .article-side-column .article-toc header button { width: 2.35rem; height: 2.35rem; border-radius: 50%; }
  .article-side-column .article-toc nav { max-height: calc(70dvh - 5rem); overflow-y: auto; }
}

/* Release channels share one card system; six entries per page across both groups. */
.development-logs { display: flex; flex-direction: column; gap: 1.5rem; }
.development-log-group-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .85rem; font: 600 1.2rem/1.4 var(--serif); }
.development-log-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.development-log-grid > .empty-state { grid-column: 1 / -1; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 1.25rem; color: var(--muted); }
.development-log-grid .development-log-card { margin: 0; min-width: 0; }
.release-label { display: inline-flex; align-items: center; gap: .35rem; white-space: normal; }
.development-log-group-title svg, .release-label svg { flex: none; width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.release-label[data-channel="stable"] { color: var(--blue-deep); }
.release-label[data-channel="snapshot"] { color: var(--muted); }
@media (max-width: 1000px) { .development-log-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .development-log-grid { grid-template-columns: minmax(0, 1fr); } }

/* Real, selectable text: calligraphic forms with translucent glass highlights. */
.home-hero .home-glass-motto {
  max-width: 100%;
  opacity: 1;
  font-family: "KaiTi", "STKaiti", "LXGW WenKai", "Noto Serif SC", var(--serif);
  font-size: clamp(2.5rem, 4.2vw, 4.2rem);
  font-weight: 500;
  line-height: 1.23;
  letter-spacing: .055em;
  color: #f3f8fc;
  text-shadow: 0 3px 12px rgba(5,19,31,.36);
  transform: skewX(-3deg);
  transform-origin: left bottom;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .home-glass-motto > span {
    display: inline-block;
    background: radial-gradient(ellipse at var(--motto-x,50%) var(--motto-y,50%),rgba(255,255,255,var(--motto-sheen,0)),transparent 48%),linear-gradient(118deg,rgba(255,255,255,.86) 4%,rgba(216,237,250,.34) 26%,rgba(255,255,255,.76) 44%,rgba(193,221,241,.22) 67%,rgba(240,250,255,.64) 92%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: .65px rgba(245,251,255,.66);
    text-shadow: none;
    filter: drop-shadow(0 -1px 0 rgba(255,255,255,.2)) drop-shadow(0 2px 3px rgba(5,19,31,.28));
    transition: filter 180ms ease;
  }
  .home-glass-motto > span:hover { filter: drop-shadow(0 -1px 0 rgba(255,255,255,.3)) drop-shadow(0 2px 3px rgba(5,19,31,.28)); }
}
@media (max-width: 700px) { .home-hero .home-glass-motto { font-size: clamp(2.15rem, 7.9vw, 3.25rem); letter-spacing: .045em; } }
@media (prefers-reduced-motion: reduce) { .home-glass-motto > span { transition: none; } }

/* Shared dark control materials: retain geometry and interaction, replace light paint. */
[data-theme="dark"] {
  --control-bg: rgba(20,47,65,.86);
  --control-hover: rgba(37,74,97,.94);
  --control-selected: rgba(54,103,133,.9);
  --control-border: rgba(133,188,219,.3);
  --control-shadow: inset 0 1px 0 rgba(191,225,244,.12), 0 5px 14px rgba(0,7,15,.2);
}
[data-theme="dark"] :is(.profile-link,.pagination,.pagination .glass-control,.short-note-pagination .glass-control,.short-note-periods a,.calendar-card .calendar-picker > button,.calendar-arrows button,.calendar-jump select,.back-link,.article-toc-toggle,[data-scroll-top]) {
  color: var(--ink);
  border-color: var(--control-border);
  background: var(--control-bg);
  box-shadow: var(--control-shadow);
}
[data-theme="dark"] :is(.profile-link,.pagination a,.short-note-pagination a,.short-note-periods a,.calendar-card .calendar-picker > button,.calendar-arrows button,.back-link,.article-toc-toggle,[data-scroll-top]):is(:hover,:focus-visible):not(.is-disabled):not(:disabled) {
  color: #e9f6ff;
  border-color: rgba(151,207,237,.55);
  background: var(--control-hover);
  box-shadow: inset 0 1px 0 rgba(191,225,244,.18), 0 7px 18px rgba(0,7,15,.28);
}
[data-theme="dark"] :is(.profile-link,.pagination a,.short-note-pagination a,.short-note-periods a,.calendar-card button,.back-link):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
[data-theme="dark"] :is(.pagination .is-disabled,.short-note-pagination .is-disabled,.calendar-arrows button:disabled) {
  color: var(--muted);
  background: rgba(13,32,46,.72);
  box-shadow: inset 0 1px 0 rgba(191,225,244,.07);
  cursor: default;
}
[data-theme="dark"] :is(.short-note-periods a.is-active,.calendar-card .calendar-picker.is-open > button,.calendar-card .calendar-picker__menu button[aria-selected="true"]) {
  color: #f3faff;
  border-color: rgba(139,207,244,.5);
  background: var(--control-selected);
  box-shadow: var(--control-shadow);
}
[data-theme="dark"] .calendar-picker__menu { box-shadow: inset 0 1px 0 rgba(191,225,244,.12), 0 12px 30px rgba(0,7,15,.4); }
[data-theme="dark"] .calendar-card .calendar-picker__menu button:hover { color: var(--ink); background: var(--control-hover); }
[data-theme="dark"] .calendar-day { color: var(--muted); }
[data-theme="dark"] .calendar-day.has-content:hover { color: #f3faff; background: var(--control-selected); }
[data-theme="dark"] .reading-size__options::before { background: var(--control-selected); box-shadow: var(--control-shadow); }
[data-theme="dark"] .reading-size button[aria-pressed="true"] { color: var(--ink); background: transparent; box-shadow: none; }
[data-theme="dark"] :is(.profile-avatar-frame,.profile-avatar-frame img,.about-avatar-card img,.about-avatar-card .avatar-fallback,.about-me-layout .about-portrait__frame) { border-color: var(--control-border); background: rgba(16,41,59,.82); box-shadow: inset 0 1px 0 rgba(191,225,244,.12); }
[data-theme="dark"] .short-note-tag--mood { color: #e3bdcf; background: rgba(109,60,86,.25); border-color: rgba(201,145,174,.3); }
[data-theme="dark"] .photo-wall-card.is-location-match::before { color: var(--ink); background: var(--control-bg); border-color: var(--control-border); }
[data-theme="dark"] .gallery-info { color: var(--ink); background: rgba(10,30,45,.92); border-color: var(--control-border); box-shadow: var(--control-shadow); }
[data-theme="dark"] .gallery-info__back { color: var(--ink); }
[data-theme="dark"] .latest-short-notes .section-heading > a { color: var(--ink); background: var(--control-bg); border-color: var(--control-border); box-shadow: var(--control-shadow); }
[data-theme="dark"] .latest-short-notes .section-heading > a:is(:hover,:focus-visible) { background: var(--control-hover); border-color: rgba(151,207,237,.55); }
[data-theme="dark"] .pin { color: #c8e5f6; background: rgba(54,103,133,.3); border-color: var(--control-border); }
[data-theme="dark"] .article-row__cover { background: #173448; }
[data-theme="dark"] .photo-stack { background: #173448; box-shadow: 0 18px 34px rgba(0,7,15,.25); }
[data-theme="dark"] .photo-stack::before,[data-theme="dark"] .photo-stack::after { background: #102b3f; border-color: var(--control-border); box-shadow: 0 12px 24px rgba(0,7,15,.22); }
[data-theme="dark"] * { scrollbar-color: rgba(119,168,199,.65) rgba(9,27,41,.7); }
[data-theme="dark"] *::-webkit-scrollbar-track { background: rgba(9,27,41,.7); }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#638ca7,#3e6681) padding-box; }
[data-theme="dark"] *::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg,#80aecb,#527e9b) padding-box; }

/* Clock theme images must apply in the current media column, not only the old tools row. */
.clock-card { background: #536f80 var(--clock-weather-image) center/cover no-repeat; }
.clock-card::before { display: block; opacity: 1; background: linear-gradient(105deg,rgba(11,27,38,.45),rgba(22,47,62,.12)); }
.clock-card :is(.section-kicker,strong,span) { color: #f4f9fc; }
[data-theme="dark"] .clock-card { background: #071b2b var(--clock-night-image,var(--clock-weather-image)) center/cover no-repeat; }
[data-theme="dark"] .clock-card::before { background: linear-gradient(105deg,rgba(3,13,23,.5),rgba(5,22,36,.16)); }
[data-theme="dark"] .clock-card__film { border-color: rgba(153,204,234,.32); background: rgba(6,23,37,.2); box-shadow: inset 0 1px 0 rgba(191,225,244,.14); }
[data-theme="dark"] .clock-card :is(.section-kicker,strong,span) { color: #f4f9fc; }

/* V1.1 brand: keep the existing navigation geometry and link semantics. */
.site-header .brand { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-width: 0; }
.brand__mark { display: block; flex: 0 0 auto; width: 3rem; height: 2.5rem; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(5,20,32,.25)); }
.brand__name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="light"] .site-header.is-scrolled .brand__mark { filter: brightness(0) saturate(100%) invert(15%) sepia(24%) saturate(1120%) hue-rotate(160deg) brightness(94%) contrast(91%); }
@media (max-width: 700px) {
  .site-header .brand,
  .site-header.is-scrolled .brand { gap: .28rem; padding-inline: .3rem; }
  .brand__mark { width: 1.9rem; height: 1.9rem; }
}
.site-footer__identity { display: grid; gap: .35rem; min-width: 0; }

/* Hallmark · genre: atmospheric · macrostructure: Photographic / Long Document
 * design-system: design.md · designed-as-app · homepage opening is preserved. */
html,body { overflow-x: clip; }
.theme-is-switching *, .theme-is-switching *::before, .theme-is-switching *::after {
  transition-property: background-color,border-color,color !important;
}
.section-heading small,.photo-index-heading small,.photo-wall-card__copy small,
.article-mini small,.album-mini small,.note-card time,.site-footer small {
  font-size: var(--text-xs); line-height: 1.65;
}
.about-information-grid :is(.privacy-panel,.site-statistics) h2,
.about-content-section h2 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }
.development-logs>header h1 { font-size: var(--text-2xl); }
.notes-page.page-content { border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.notes-page :is(.short-notes-board,.long-notes-board) { border-color: var(--color-rule); box-shadow: var(--shadow-card); }
.short-notes-board .note-card { border: 0; border-bottom: 1px solid var(--color-rule); border-radius: 0; box-shadow: none; background: transparent; }
.short-note-item__content>p { font-size: var(--text-base); }
.article-side-column .interaction-compose { border: 0; background: transparent; padding-inline: 0; }
.interaction-overlay .interaction-drawer .interaction-verify button[type="submit"],.feedback-center .feedback-compose button[type="submit"] {
  background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent);
}
.interaction-comment-head time,.interaction-compose small,.interaction-verify small { font-size: var(--text-xs); color: var(--color-muted); }
.interaction-verify :is(input,button),.feedback-compose :is(input,button) { min-height: 44px; }
.album-film[data-motion-paused="true"] :is(.film-contour-tail,.film-contour-light),
.album-film[data-motion-paused="true"] .album-film-info::after { animation-play-state: paused; }
@media(hover:hover) and (pointer:fine) {
  .interaction-overlay .interaction-drawer .interaction-verify button[type="submit"]:hover,.feedback-center .feedback-compose button[type="submit"]:hover {
    background: var(--color-accent); color: var(--color-accent-ink); opacity: .9;
  }
}
@media(max-width:700px) {
  /* The home hero and its opening remain untouched; only destination headers shrink. */
  .page-intro { min-height: clamp(340px,52svh,460px); padding: 9rem var(--space-sm) var(--space-lg); }
  .page-intro h1 { font-size: clamp(36px,9vw,44px); overflow-wrap: anywhere; min-width: 0; }
  .page-intro p:last-child { font-size: var(--text-sm); letter-spacing: .03em; max-width: 28em; }
  .section-heading { align-items: flex-start; }
  .interaction-comment :is(button,a),.article-side-column select { min-height: 44px; }
  .development-logs>header h1 { font-size: var(--text-xl); }
}
@media(prefers-reduced-motion:reduce) {
  .theme-is-switching *, .theme-is-switching *::before, .theme-is-switching *::after { transition-duration: 0s !important; }
}
.hero-route-mask{position:absolute;top:0;left:0;width:100%;z-index:0;pointer-events:none;overflow:hidden;transform-origin:center top;will-change:transform}
.hero-route-stage{position:absolute;inset:0;isolation:isolate}
.hero-route-shade{position:absolute;inset:0;pointer-events:none}
.hero-route-image{position:absolute;inset:0;pointer-events:none;background-position:center;background-size:cover;background-repeat:no-repeat;transform-origin:center top;will-change:transform,opacity}
.hero-route-flow{display:flow-root;transform-origin:center top;will-change:transform}
.home-hero[data-hero-motion],.page-intro[data-hero-motion]{overflow-anchor:none}
[data-hero-motion]::before,[data-hero-motion]::after,[data-hero-motion] .home-hero__veil{visibility:hidden!important}
[data-hero-motion]{background-image:none!important}
[data-hero-motion] .hero-full-image{opacity:0!important}
@media(max-width:700px){#search-overlay>.search-dialog{display:flex;flex-direction:column;box-sizing:border-box;height:var(--search-panel-height,min(440px,calc(100svh - 1rem)));max-height:none;margin-top:.5rem;overflow-anchor:none}#search-overlay .search-dialog>header,#search-overlay .search-field{flex:none}#search-overlay .search-results{flex:1;min-height:0;max-height:none;overscroll-behavior:contain}#search-overlay input{font-size:16px;scroll-margin:0}}
