:root {
  --paper: #f7f5f0;
  --paper-elevated: #fcfbf8;
  --ink: #1c2522;
  --ink-soft: #6b7470;
  --line: rgba(28, 37, 34, .11);
  --line-strong: rgba(28, 37, 34, .23);
  --sea: #2c6a66;
  --sea-bright: #2d8881;
  --coral: #bb6551;
  --lemon: #e4c95f;
  --living-bg: #183c38;
  --living-ink: #f4f1e9;
  --living-soft: #aac5bd;
  --shadow: 0 18px 55px rgba(34, 45, 41, .09);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shell: min(1080px, calc(100vw - 48px));
  --header-height: 72px;
}

html[data-theme="dark"] {
  --paper: #101817;
  --paper-elevated: #17211f;
  --ink: #e9ede8;
  --ink-soft: #a7b0aa;
  --line: rgba(233, 237, 232, .14);
  --line-strong: rgba(233, 237, 232, .32);
  --sea: #72b9ae;
  --sea-bright: #99d2c8;
  --coral: #f37a61;
  --lemon: #dbc86f;
  --living-bg: #dbe5de;
  --living-ink: #17211f;
  --living-soft: #4d6b65;
  --shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sea) 2.5%, var(--paper)), var(--paper) 32rem);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: .018;
  pointer-events: none;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
::selection { color: #fff; background: var(--coral); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-shell { width: var(--shell); margin-inline: auto; }
.site-main { min-height: 65vh; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--sea);
  font-size: .76rem;
  font-weight: 760;
  letter-spacing: .17em;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 1.65rem;
  height: 2px;
  content: "";
  background: currentColor;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 100%;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--sea), var(--coral));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: var(--shell);
  height: 100%;
  margin: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .85rem;
}

.brand-mark,
.footer-mark {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: .74rem;
  font-weight: 780;
  letter-spacing: -.02em;
}

.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 1rem; letter-spacing: -.02em; }
.brand-copy small { margin-top: .2rem; color: var(--ink-soft); font-size: .7rem; letter-spacing: .05em; line-height: 1.3; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 1.7rem; }
.site-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: .03em;
  transition: color .2s ease;
}
.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -.5rem;
  left: 0;
  height: 2px;
  content: "";
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; justify-self: end; align-items: center; gap: .55rem; }
.icon-button, .nav-toggle, .back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-elevated) 78%, transparent);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.icon-button { width: 2.4rem; height: 2.4rem; border-radius: 50%; }
.icon-button:hover, .nav-toggle:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.icon-button svg { width: 1.05rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.search-trigger { width: auto; padding: 0 .72rem; gap: .52rem; border-radius: 999px; }
.search-trigger kbd { color: var(--ink-soft); font-size: .72rem; }
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }
.nav-toggle { display: none; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(3rem, 7vw, 6rem);
  padding-block: clamp(4.5rem, 8vw, 7rem);
}

.hero-copy { align-self: center; position: relative; z-index: 2; }
.hero-copy h1 {
  max-width: none;
  margin: 1.1rem 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(2.4rem, calc(2rem + 1.2vw), 3.25rem);
  font-weight: 540;
  letter-spacing: -.055em;
  line-height: 1.05;
  text-wrap: balance;
}
.hero-copy > p { max-width: 31rem; margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 2.7rem;
  padding: .58rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: .875rem;
  font-weight: 680;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.button-primary:hover { background: var(--sea); border-color: var(--sea); }
.button-quiet span { font-family: var(--mono); color: var(--ink-soft); }

.hero-art { position: relative; align-self: center; min-width: 0; }
.hero-art::before {
  position: absolute;
  inset: 14px -12px -12px 14px;
  z-index: 0;
  border: 1px solid color-mix(in srgb, var(--coral) 42%, var(--line));
  border-radius: var(--radius-lg);
  content: "";
}
.art-frame {
  position: relative;
  z-index: 2;
  aspect-ratio: 4 / 4.35;
  width: min(100%, 420px);
  margin-left: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: #b7c6bf;
}
.hero-image { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.82) contrast(.96); }
.hero-image-dark { display: none; }
[data-theme="dark"] .hero-image-light { display: none; }
[data-theme="dark"] .hero-image-dark { display: block; }
.hero-image-daily {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  opacity: 0;
  filter: saturate(.82) contrast(.96) brightness(.95);
  transition: opacity .65s ease;
}
[data-theme="dark"] .hero-image-daily { filter: saturate(.68) contrast(.96) brightness(.72); }
.art-frame.is-daily-ready .hero-image-daily { opacity: 1; }
.art-frame::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgba(12, 24, 22, .04), transparent 48%, rgba(8, 24, 23, .48));
}
.art-caption {
  position: absolute;
  right: 1.3rem;
  bottom: 1.15rem;
  left: 1.3rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: .75rem;
  font-weight: 760;
  letter-spacing: .18em;
}
.art-caption a { display: grid; min-width: 0; max-width: 76%; gap: .25rem; }
.art-caption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-caption small { overflow: hidden; color: rgba(255, 255, 255, .86); font-size: .68rem; font-weight: 560; letter-spacing: .07em; text-overflow: ellipsis; white-space: nowrap; }
.art-caption > b { align-self: end; flex-shrink: 0; }
.frame-refresh {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.5rem;
  padding: .35rem .7rem;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 999px;
  color: #fff;
  background: rgba(13, 25, 23, .34);
  font-size: .8rem;
  font-weight: 680;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.frame-refresh b { font-size: .9rem; font-weight: 400; transition: transform .35s ease; }
.frame-refresh:hover b, .frame-refresh[aria-busy="true"] b { transform: rotate(180deg); }

.hero-stats {
  display: flex;
  gap: 1.5rem;
  width: min(440px, 100%);
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; align-items: baseline; gap: .38rem; }
.hero-stats strong { font-family: var(--serif); font-size: 1rem; font-weight: 560; }
.hero-stats span { color: var(--ink-soft); font-size: .74rem; }

.living-note {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--living-ink) 14%, transparent);
  border-radius: 16px;
  color: var(--living-ink);
  background: var(--living-bg);
  box-shadow: 0 22px 55px color-mix(in srgb, var(--living-bg) 18%, transparent);
}
.living-lines {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(72%, 760px);
  height: 100%;
  opacity: .17;
  pointer-events: none;
  fill: none;
  stroke: var(--living-ink);
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.living-index, .living-quote, .living-actions { position: relative; z-index: 1; }
.living-index {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem;
  border-right: 1px solid color-mix(in srgb, var(--living-ink) 17%, transparent);
}
.living-index span { max-width: 10rem; color: var(--living-soft); font-size: .7rem; font-weight: 760; letter-spacing: .12em; line-height: 1.55; }
.living-index time { font-family: var(--mono); font-size: .74rem; letter-spacing: .05em; }
.living-quote { align-self: center; max-width: 640px; padding: 1.65rem clamp(1.5rem, 4vw, 3.5rem); }
.living-label { color: var(--living-soft); font-size: .74rem; font-weight: 720; letter-spacing: .07em; }
.living-quote blockquote { max-width: 27em; margin: .65rem 0 .5rem; font-family: var(--serif); font-size: clamp(1.16rem, 2vw, 1.5rem); font-weight: 520; letter-spacing: -.02em; line-height: 1.55; text-wrap: balance; }
.living-quote cite { color: var(--living-soft); font-family: var(--serif); font-size: .76rem; font-style: normal; }
.living-actions { display: flex; flex-direction: column; justify-content: center; gap: .5rem; padding: 1.35rem; }
.living-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  width: 8rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid color-mix(in srgb, var(--living-ink) 24%, transparent);
  border-radius: var(--radius-sm);
  color: inherit;
  background: color-mix(in srgb, var(--living-bg) 84%, var(--living-ink));
  font-size: .84rem;
  font-weight: 680;
  line-height: 1.25;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.living-actions button:hover { background: color-mix(in srgb, var(--living-bg) 72%, var(--living-ink)); transform: translateX(2px); }
.living-actions b { color: var(--living-soft); font-size: .85rem; font-weight: 400; }

.reading-history { padding-top: clamp(4rem, 6vw, 5.5rem); }
.reading-history[hidden] { display: none; }
.reading-history > header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.reading-history h2, .related-posts h2 { margin: .65rem 0 0; font-family: var(--serif); font-size: 1.65rem; font-weight: 540; letter-spacing: -.035em; }
.reading-history > header button { padding: .25rem 0; border: 0; color: var(--ink-soft); background: transparent; font-size: .76rem; cursor: pointer; }
.reading-history > header button:hover { color: var(--coral); }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line-strong); }
.history-item { display: grid; grid-template-rows: auto 1fr auto; gap: .75rem; min-height: 142px; padding: 1.1rem 1.25rem; border-right: 1px solid var(--line); transition: background .2s ease; }
.history-item:last-child { border-right: 0; }
.history-item > span { color: var(--coral); font-family: var(--mono); font-size: .72rem; }
.history-item strong { align-self: start; font-family: var(--serif); font-size: 1rem; font-weight: 540; line-height: 1.35; }
.history-item small { color: var(--ink-soft); font-size: .74rem; }
.history-item:hover { background: color-mix(in srgb, var(--sea) 5%, transparent); }

.post-feed { padding-block: clamp(4.5rem, 7vw, 6.5rem); }
.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}
.section-heading h2, .collection-hero h1, .page-hero h1 {
  margin: .75rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2vw, 2.05rem);
  font-weight: 530;
  letter-spacing: -.055em;
  line-height: 1.04;
}
.section-heading > p { justify-self: end; max-width: 25rem; margin: 0; color: var(--ink-soft); font-size: .85rem; }

.post-list { border-top: 1px solid var(--line-strong); }
.post-card {
  position: relative;
  display: grid;
  grid-template-areas: "index main cover";
  grid-template-columns: 2.25rem minmax(0, 1fr) 190px;
  align-items: center;
  gap: 1.3rem;
  min-height: 176px;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--line);
  transition: background .25s ease, padding-inline .25s ease;
}
.post-card::before { position: absolute; top: 1.35rem; bottom: 1.35rem; left: 0; width: 2px; content: ""; background: var(--coral); opacity: 0; transform: scaleY(.35); transition: opacity .2s ease, transform .25s ease; }
.post-card:hover { padding-inline: .8rem; background: color-mix(in srgb, var(--sea) 3.5%, transparent); }
.post-card:hover::before { opacity: 1; transform: scaleY(1); }
.post-card-index { grid-area: index; align-self: start; padding-top: .18rem; color: var(--coral); font-family: var(--mono); font-size: .78rem; line-height: 1.4; }
.post-card-main { grid-area: main; min-width: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--ink-soft); font-size: .81rem; letter-spacing: .04em; line-height: 1.45; text-transform: uppercase; }
.post-meta a:hover { color: var(--sea); }
.lock-label { margin-left: .35rem; padding: .08rem .45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--coral); font-size: .7rem; }
.post-card h2 { max-width: 34ch; margin: .4rem 0 .38rem; font-family: var(--serif); font-size: clamp(1.28rem, 1.55vw, 1.48rem); font-weight: 550; letter-spacing: -.02em; line-height: 1.3; }
.post-card h2 a { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size .35s ease, color .2s ease; }
.post-card h2 a:hover { color: var(--sea); background-size: 100% 1px; }
.post-card-summary { display: -webkit-box; max-width: 62ch; margin: 0; overflow: hidden; color: var(--ink-soft); font-family: var(--serif); font-size: .86rem; line-height: 1.62; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.post-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .65rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.tag-row a { color: var(--ink-soft); font-size: .81rem; line-height: 1.4; }
.tag-row a:hover { color: var(--sea); }
.read-link { display: inline-flex; flex-shrink: 0; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 720; line-height: 1.4; }
.read-link span { color: var(--coral); transition: transform .2s ease; }
.read-link:hover span { transform: rotate(45deg); }

.post-card-cover,
.article-cover {
  --cover-a: #244f4b;
  --cover-b: #c57a63;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: var(--radius-md);
  background: var(--cover-a);
  isolation: isolate;
}
.post-card-cover { grid-area: cover; aspect-ratio: 3 / 2; width: 100%; }
.post-card-cover img,
.article-cover img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; filter: saturate(.76) contrast(.96); transition: filter .25s ease, transform .4s ease; }
.post-card:hover .post-card-cover img { filter: saturate(.9) contrast(.98); transform: scale(1.025); }
.cover-art { position: absolute; inset: 0; display: block; overflow: hidden; background: radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--cover-b) 82%, white) 0 5%, transparent 5.5%), linear-gradient(145deg, color-mix(in srgb, var(--cover-a) 92%, #000), color-mix(in srgb, var(--cover-b) 75%, var(--cover-a))); }
.cover-art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.08) 25.5%, transparent 26%), radial-gradient(circle at 12% 110%, transparent 0 46%, rgba(255,255,255,.13) 46.5% 47%, transparent 47.5%); }
.cover-art i { position: absolute; right: -14%; left: -14%; height: 48%; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; transform: rotate(-7deg); }
.cover-art i:nth-child(1) { bottom: -22%; }
.cover-art i:nth-child(2) { bottom: -10%; transform: rotate(5deg); }
.cover-art i:nth-child(3) { bottom: 2%; transform: rotate(-2deg); }
.cover-art b { position: absolute; top: .8rem; left: .85rem; z-index: 1; max-width: calc(100% - 1.7rem); overflow: hidden; color: rgba(255,255,255,.82); font-family: var(--mono); font-size: .72rem; font-weight: 650; letter-spacing: .11em; text-overflow: ellipsis; white-space: nowrap; }
.cover-tone-1 { --cover-a: #3e3d5d; --cover-b: #d49974; }
.cover-tone-2 { --cover-a: #263e59; --cover-b: #7f9f8c; }
.cover-tone-3 { --cover-a: #4e3f38; --cover-b: #d2ad6c; }
.cover-tone-4 { --cover-a: #35463a; --cover-b: #aa7e91; }

.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 2.4rem; font-size: .8rem; font-weight: 700; }
.pagination a:last-child { justify-self: end; }
.pagination > span { color: var(--ink-soft); font-family: var(--mono); }
.pagination a:hover { color: var(--sea); }

.collection-hero, .page-hero { padding-block: clamp(4rem, 7vw, 6.5rem) clamp(2.5rem, 4vw, 4rem); border-bottom: 1px solid var(--line-strong); }
.collection-hero h1, .page-hero h1 { max-width: 16ch; }
.collection-hero > p { max-width: 36rem; margin: 1.3rem 0 0; color: var(--ink-soft); }
.compact-feed { padding-top: 0; }

.page-shell { padding-block: clamp(3rem, 6vw, 5.5rem); }
.page-content { max-width: 720px; margin: auto; }
.taxonomy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.taxonomy-card { position: relative; min-height: 155px; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-elevated); transition: color .25s ease, background .25s ease, transform .2s ease; }
.taxonomy-card > span { color: var(--coral); font-family: var(--mono); font-size: .75rem; }
.taxonomy-card h2 { margin: 1.8rem 2rem 0 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 550; line-height: 1.25; }
.taxonomy-card p { margin: .5rem 0 0; color: var(--ink-soft); font-size: .81rem; }
.taxonomy-card b { position: absolute; right: 1.6rem; bottom: 1.5rem; font-weight: 400; }
.taxonomy-card:hover { color: var(--paper); background: var(--ink); transform: translateY(-2px); }
.taxonomy-card:hover p { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.tag-cloud-custom { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem 1.5rem; }
.tag-cloud-custom a { color: var(--ink-soft); font-family: var(--serif); font-size: calc(.95rem + var(--weight) * .09rem); transition: color .2s ease, transform .2s ease; }
.tag-cloud-custom a span { color: var(--coral); font-family: var(--sans); font-size: .7em; }
.tag-cloud-custom a sup { margin-left: .28rem; font-family: var(--mono); font-size: .45em; }
.tag-cloud-custom a:hover { color: var(--sea); transform: translateY(-2px); }

.article-shell { padding-block: clamp(2.8rem, 4.6vw, 4.6rem); }
.article-header { max-width: 860px; margin: 0 auto clamp(3rem, 4.2vw, 4rem); }
.article-kicker { display: flex; gap: .65rem; color: var(--sea); font-size: .78rem; font-weight: 730; letter-spacing: .09em; text-transform: uppercase; }
.article-header h1 { max-width: 21ch; margin: .85rem 0 1.4rem; font-family: var(--serif); font-size: clamp(2.15rem, calc(1.8rem + 1.05vw), 2.9rem); font-weight: 540; letter-spacing: -.028em; line-height: 1.16; text-wrap: balance; }
.article-deck { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line-strong); }
.article-deck > p { max-width: 35rem; margin: 0; color: var(--ink-soft); font-family: var(--serif); font-size: .96rem; line-height: 1.72; }
.article-stats { display: flex; gap: 2rem; margin: 0; }
.article-stats div { display: grid; }
.article-stats dt { color: var(--ink-soft); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.article-stats dd { margin: .18rem 0 0; font-family: var(--serif); font-size: 1.04rem; }
.article-cover { aspect-ratio: 21 / 8; width: 100%; margin-top: 1.6rem; box-shadow: 0 16px 44px rgba(26, 43, 38, .1); }
.article-cover .cover-art b { top: 1.1rem; left: 1.2rem; font-size: .75rem; }
.article-grid { display: grid; grid-template-columns: 200px minmax(0, 720px); justify-content: center; gap: clamp(2rem, 4vw, 4rem); }
.article-rail { min-width: 0; }
.rail-sticky { position: sticky; top: calc(var(--header-height) + 2rem); }
.rail-label { display: block; padding-bottom: .75rem; border-bottom: 1px solid var(--line-strong); color: var(--ink-soft); font-size: .75rem; font-weight: 760; letter-spacing: .13em; line-height: 1.35; }
.article-toc { max-height: 48vh; margin-top: .9rem; overflow: auto; }
.article-toc ol { margin: 0; padding: 0; list-style: none; }
.article-toc ol ol { margin-left: .75rem; }
.article-toc a { display: block; padding: .4rem 0; color: var(--ink-soft); font-size: .84rem; line-height: 1.5; transition: color .15s ease; }
.article-toc a:hover, .article-toc a.is-active { color: var(--sea); }
.toc-empty { color: var(--ink-soft); font-family: var(--serif); font-size: .88rem; font-style: italic; }
.article-tools { display: grid; gap: .4rem; margin-top: 1.7rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.article-tools button, .article-tools a { display: flex; align-items: center; gap: .65rem; min-height: 2.5rem; padding: .42rem 0; border: 0; color: var(--ink-soft); background: none; font-size: .84rem; line-height: 1.4; text-align: left; cursor: pointer; }
.article-tools button:hover, .article-tools a:hover { color: var(--ink); }
.article-tools span { color: var(--coral); }
.article-main { min-width: 0; }

.prose { color: var(--ink); font-family: var(--serif); font-size: 1.0625rem; line-height: 1.85; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table { margin-block: 1.25em; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { position: relative; scroll-margin-top: 110px; color: var(--ink); font-family: var(--sans); line-height: 1.28; }
.prose h1 { font-size: 2rem; }
.prose h2 { margin: 2.75rem 0 .9rem; padding-top: .85rem; border-top: 1px solid var(--line); font-size: 1.625rem; letter-spacing: -.03em; }
.prose h3 { margin: 2.1rem 0 .7rem; font-size: 1.3rem; }
.prose h4 { margin: 2em 0 .7em; font-size: 1.08rem; }
.prose a { color: var(--sea); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--sea) 38%, transparent); text-underline-offset: .22em; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 720; }
.prose blockquote { position: relative; margin-inline: 0; padding: .25rem 0 .25rem 1.6rem; border-left: 3px solid var(--coral); color: var(--ink-soft); font-size: 1.1em; font-style: italic; }
.prose hr { height: 1px; margin: 3rem 0; border: 0; background: var(--line-strong); }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.8rem auto; border-radius: var(--radius-md); box-shadow: 0 10px 35px rgba(0, 0, 0, .1); }
.prose figure { max-width: 100%; margin: 1.8rem 0; }
.prose figcaption { margin-top: .6rem; color: var(--ink-soft); font-family: var(--sans); font-size: .78rem; text-align: center; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-family: var(--sans); font-size: .82rem; }
.prose th, .prose td { padding: .7rem .85rem; border: 1px solid var(--line); text-align: left; }
.prose th { background: color-mix(in srgb, var(--sea) 9%, transparent); }
.prose code { padding: .12rem .35rem; border-radius: 4px; color: var(--coral); background: color-mix(in srgb, var(--coral) 9%, transparent); font-family: var(--mono); font-size: .82em; }

.prose figure.highlight, .prose .highlight-container {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #18201f;
  box-shadow: 0 12px 34px rgba(15, 26, 23, .13);
}
.prose .highlight-container { overflow-x: auto; }
.prose figure.highlight { overflow-x: auto; }
.prose figure.highlight table, .prose .highlight-container table { display: table; width: 100%; margin: 0; border: 0; color: #dfe7e2; background: transparent; }
.prose figure.highlight td, .prose .highlight-container td { border: 0; padding: 1.25rem 0; }
.prose figure.highlight .gutter, .prose .highlight-container .gutter { width: 3rem; color: #73807b; text-align: right; user-select: none; }
.prose figure.highlight .gutter pre, .prose .highlight-container .gutter pre { padding: 0 .85rem; }
.prose figure.highlight .code pre, .prose .highlight-container .code pre { padding: 0 1.2rem; }
.prose pre { margin: 0; font-family: var(--mono); font-size: .76rem; line-height: 1.72; tab-size: 2; }
.prose pre code { padding: 0; color: inherit; background: none; font-size: inherit; }
.copy-code { position: absolute; top: .7rem; right: .7rem; z-index: 4; padding: .35rem .6rem; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; color: #cbd5d0; background: rgba(13, 21, 20, .75); font-family: var(--sans); font-size: .7rem; cursor: pointer; opacity: 0; transition: opacity .2s ease; }
.highlight-container:hover .copy-code, figure.highlight:hover .copy-code, .copy-code:focus { opacity: 1; }

.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 4rem; padding-block: 1.2rem; border-block: 1px solid var(--line); font-family: var(--sans); font-size: .81rem; }
.article-tags > span { margin-right: .5rem; color: var(--ink-soft); }
.article-tags a { color: var(--sea); }
.related-posts { margin-top: 4.5rem; padding-top: 2rem; border-top: 1px solid var(--line-strong); font-family: var(--sans); }
.related-posts > header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.related-posts > header > a { color: var(--ink-soft); font-size: .76rem; font-weight: 680; }
.related-posts > header > a:hover { color: var(--sea); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.related-card { display: grid; grid-template-rows: auto 1fr auto; gap: .8rem; min-height: 168px; padding: 1.1rem; border-right: 1px solid var(--line); transition: color .2s ease, background .2s ease; }
.related-card:last-child { border-right: 0; }
.related-card > span { color: var(--ink-soft); font-family: var(--mono); font-size: .7rem; }
.related-card strong { font-family: var(--serif); font-size: .98rem; font-weight: 540; line-height: 1.42; }
.related-card b { color: var(--coral); font-size: .72rem; font-weight: 680; }
.related-card:hover { color: var(--paper); background: var(--ink); }
.related-card:hover > span { color: color-mix(in srgb, var(--paper) 64%, transparent); }
.heading-anchor { margin-left: .45rem; padding: 0; border: 0; color: var(--coral); background: transparent; font-family: var(--mono); font-size: .55em; cursor: pointer; opacity: 0; transform: translateY(-.08em); transition: opacity .2s ease; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .heading-anchor:focus { opacity: .72; }
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 3rem; background: var(--line); border: 1px solid var(--line); }
.post-navigation > a { display: grid; align-content: center; min-height: 130px; padding: 1.3rem; background: var(--paper); }
.post-navigation a:hover { background: var(--paper-elevated); }
.post-navigation span { color: var(--coral); font-size: .72rem; font-weight: 740; letter-spacing: .09em; }
.post-navigation strong { margin-top: .55rem; font-family: var(--serif); font-size: 1rem; font-weight: 520; line-height: 1.35; }
.post-navigation .next { text-align: right; }

.comments { margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--line-strong); font-family: var(--sans); }
.comments-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.comments-heading h2 { margin: .45rem 0 0; font-family: var(--serif); font-size: 1.75rem; font-weight: 540; }
.comments-heading p { margin: 0; color: var(--ink-soft); font-family: var(--serif); font-size: .9rem; font-style: italic; }
.comment-loading { padding: 2rem; border: 1px dashed var(--line-strong); color: var(--ink-soft); text-align: center; }
.tk-comments-container, .tk-submit { color: var(--ink) !important; }
.tk-content, .tk-nick, .tk-time, .tk-actions { font-family: var(--sans) !important; }
.tk-input .el-textarea__inner, .tk-preview-container, .tk-comment { border-radius: 12px !important; }

.not-found { padding-block: 2rem 5rem; text-align: center; }
.not-found-code { margin: 0; color: var(--coral); font-family: var(--serif); font-size: clamp(5rem, 16vw, 9rem); letter-spacing: -.06em; line-height: .9; }
.not-found .button { margin-top: 1rem; }

.site-footer { margin-top: 3rem; border-top: 1px solid var(--line-strong); }
.footer-inner { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 3rem; width: var(--shell); margin: auto; padding-block: 3rem; }
.footer-inner > div:first-child { display: flex; align-items: center; gap: 1rem; }
.footer-inner p { margin: 0; color: var(--ink-soft); font-family: var(--serif); font-size: .9rem; }
.footer-links { display: grid; align-content: center; gap: .35rem; }
.footer-links a { width: max-content; font-size: .875rem; font-weight: 700; }
.footer-links a:hover { color: var(--sea); }
.footer-meta { align-self: center; text-align: right; }

.search-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 40px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--paper-elevated);
  box-shadow: 0 35px 110px rgba(0, 0, 0, .26);
}
.search-dialog::backdrop { background: rgba(12, 20, 18, .5); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.search-panel { padding: clamp(1.3rem, 4vw, 2.4rem); }
.search-heading { display: flex; justify-content: space-between; align-items: start; }
.search-heading h2 { margin: .55rem 0 0; font-family: var(--serif); font-size: 2rem; font-weight: 520; line-height: 1.18; }
.dialog-close { width: 2.6rem; height: 2.6rem; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.search-field { display: flex; align-items: center; gap: .8rem; margin-top: 1.8rem; padding: .75rem 1rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); }
.search-field svg { width: 1.15rem; fill: none; stroke: var(--ink-soft); stroke-linecap: round; stroke-width: 1.7; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-field kbd { color: var(--ink-soft); font-size: .62rem; }
.search-status { padding: 1.2rem .2rem .8rem; color: var(--ink-soft); font-size: .78rem; }
.search-results { max-height: 410px; overflow-y: auto; }
.search-result { display: grid; grid-template-columns: 4rem 1fr; gap: .8rem; padding: 1rem .2rem; border-top: 1px solid var(--line); }
.search-result > span { color: var(--coral); font-family: var(--mono); font-size: .74rem; }
.search-result h3 { margin: 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 530; }
.search-result p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .8rem; }
.search-result:hover h3 { color: var(--sea); }

.back-to-top { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90; width: 2.8rem; height: 2.8rem; border-radius: 50%; opacity: 0; pointer-events: none; transform: translateY(10px); }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.site-toast { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 130; max-width: min(320px, calc(100vw - 28px)); padding: .65rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--paper); background: var(--ink); box-shadow: var(--shadow); font-size: .78rem; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.site-toast.is-visible { opacity: 1; transform: none; }

.focus-mode .site-header, .focus-mode .site-footer, .focus-mode .article-rail, .focus-mode .back-to-top { display: none; }
.focus-mode .article-grid { display: block; max-width: 760px; margin: auto; }
.focus-mode .article-header { max-width: 760px; }

.reveal { opacity: 1; transform: none; }
.reveal.reveal-pending { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .75, .25, 1); }
.reveal.reveal-pending.is-visible { opacity: 1; transform: none; }

@media (hover: hover) {
  .post-list:has(.post-card:hover) .post-card:not(:hover) { opacity: .52; }
  .post-card { transition: opacity .2s ease, background .25s ease, padding-inline .25s ease; }
}

@media (max-width: 960px) {
  :root { --shell: min(100% - 34px, 760px); }
  .header-inner { grid-template-columns: 1fr auto auto; }
  .nav-toggle { display: inline-flex; flex-direction: column; gap: 5px; width: 2.7rem; height: 2.7rem; margin-right: .55rem; border-radius: 50%; }
  .nav-toggle span:not(.sr-only) { width: 1rem; height: 1px; background: currentColor; transition: transform .2s ease; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }
  .site-nav { position: fixed; top: var(--header-height); right: 0; left: 0; display: grid; gap: 0; padding: 1rem 17px 1.5rem; border-bottom: 1px solid var(--line); background: var(--paper); opacity: 0; pointer-events: none; transform: translateY(-12px); transition: opacity .2s ease, transform .2s ease; }
  .site-nav.is-open { opacity: 1; pointer-events: auto; transform: none; }
  .site-nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.3rem; }
  .site-nav a::after { display: none; }
  .home-hero { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .post-card { grid-template-columns: 2rem minmax(0, 1fr) 170px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-rail { display: none; }
  .article-main { width: 100%; max-width: 760px; margin: auto; }
  .taxonomy-grid { grid-template-columns: repeat(2, 1fr); }
  .living-note { grid-template-columns: 130px minmax(0, 1fr); }
  .living-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; padding-top: 0; border-top: 1px solid color-mix(in srgb, var(--living-ink) 12%, transparent); }
  .living-actions button { width: auto; min-width: 8rem; }
}

@media (max-width: 680px) {
  :root { --shell: calc(100vw - 28px); --header-height: 70px; }
  .brand-mark { width: 2.45rem; height: 2.45rem; }
  .brand-copy small { display: none; }
  .search-trigger kbd { display: none; }
  .search-trigger { width: 2.7rem; padding: 0; }
  .home-hero { display: flex; flex-direction: column; padding-block: 3.5rem 2.5rem; }
  .hero-copy h1 { max-width: none; font-size: clamp(2.3rem, 10vw, 2.8rem); }
  .hero-art { width: 100%; margin: 2.5rem 0 0; }
  .hero-art::before { inset: 10px -7px -7px 10px; }
  .art-frame { aspect-ratio: 4 / 3; border-radius: 14px; }
  .frame-refresh span { display: none; }
  .frame-refresh { width: 2.2rem; justify-content: center; padding: 0; }
  .hero-stats { flex-wrap: wrap; gap: .75rem 1.25rem; }
  .living-note { grid-template-columns: 1fr; min-height: 0; }
  .living-index { flex-direction: row; padding: 1rem; border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--living-ink) 15%, transparent); }
  .living-quote { padding: 1.5rem 1rem; }
  .living-quote blockquote { font-size: 1.15rem; }
  .living-actions { justify-content: flex-start; padding: 0 1rem 1rem; border-top: 0; }
  .living-actions button { flex: 1; min-width: 0; }
  .reading-history > header { align-items: start; }
  .history-list, .related-grid { grid-template-columns: 1fr; }
  .history-item, .related-card { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .history-item:last-child, .related-card:last-child { border-bottom: 0; }
  .section-heading { grid-template-columns: 1fr; align-items: start; }
  .section-heading > p { justify-self: start; }
  .post-card { grid-template-areas: "index cover" ". main"; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .85rem .7rem; min-height: 0; padding-block: 1.35rem; }
  .post-card-index { align-self: start; }
  .post-card-cover { aspect-ratio: 16 / 9; }
  .post-card h2 { font-size: 1.28rem; }
  .post-card-summary { font-size: .84rem; -webkit-line-clamp: 3; }
  .post-card-footer { align-items: flex-end; }
  .tag-row { gap: .45rem; }
  .taxonomy-grid { grid-template-columns: 1fr; }
  .taxonomy-card { min-height: 140px; }
  .article-deck { display: grid; }
  .article-stats { justify-content: space-between; }
  .article-cover { aspect-ratio: 16 / 9; margin-top: 1.3rem; }
  .prose { font-size: 1rem; line-height: 1.82; }
  .prose h2 { font-size: 1.5rem; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-navigation .next { text-align: left; }
  .comments-heading { align-items: start; flex-direction: column; }
  .related-posts > header { align-items: start; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-meta { text-align: left; }
}

@media (hover: none) {
  .copy-code { opacity: .85; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .reveal.reveal-pending { opacity: 1; transform: none; }
}
