/* ==========================================================================
   tongyongtao — notes
   White paper, ink, one cobalt accent used only for real state.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fffafc;
  --ink: #2a2436;
  --ink-2: #4b4358;
  --muted: #7d7288;
  --faint: #a79cb3;
  --rule: #f2e4ee;
  --rule-soft: #fbf0f6;
  --band: #ffeef5;
  --accent: #f0448a;
  --accent-soft: rgba(240, 68, 138, 0.1);
  --sky: #56c8ff;
  --lemon: #ffcf5c;
  --code-bg: #241c33;
  --code-ink: #f3ebff;

  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1240px;
  --gutter: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(240, 68, 138, 0.14);
}

main {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

/* --- skip link / progress ------------------------------------------------ */

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}
#read-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* --- header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.header-in {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.brand {
  font-family: "Archivo", var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
}
.site-nav a {
  position: relative;
  padding: 4px 0;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.12s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.site-nav a:hover {
  color: var(--ink);
}
.site-nav a:hover::after {
  transform: scaleX(1);
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
}
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 8px 0 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.search-btn:hover {
  border-color: #c3ccd6;
  color: var(--ink);
}
.search-key {
  padding-left: 7px;
  border-left: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  padding: clamp(64px, 8vw, 118px) 0 clamp(46px, 5vw, 72px);
}

.hero-title {
  font-size: clamp(33px, 5.1vw, 62px);
  font-weight: 750;
  line-height: 1.16;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.hero-title span {
  padding-left: 1.55em;
}

.hero-sub {
  margin-top: 26px;
  max-width: 34em;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 40px;
  font-size: 14px;
}
.hero-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s ease;
}
.hero-nav a span {
  margin-left: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}
.hero-nav a:hover {
  color: var(--accent);
}
.hero-nav a:hover span {
  color: var(--accent);
}

/* --- index rows ---------------------------------------------------------- */

.index {
  padding-bottom: clamp(56px, 7vw, 96px);
}

.index-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.index-bar h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.index-bar span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.rows {
  display: block;
}

.is-theme .row {
  grid-template-columns: 104px minmax(0, 1fr);
}

.row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 150px;
  gap: 28px;
  align-items: start;
  padding: 22px 14px;
  margin: 0 -14px;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.15s ease;
}
.row:hover {
  background: var(--band);
}

.row-date {
  padding-top: 4px;
  font-size: 13px;
  color: var(--faint);
  letter-spacing: 0.01em;
}

.row-body {
  transition: transform 0.18s ease;
}
.row:hover .row-body {
  transform: translateX(5px);
}

.row-title {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -0.012em;
}
.row-title a {
  text-decoration: none;
  color: var(--ink);
  transition: color 0.12s ease;
}
.row:hover .row-title a {
  color: var(--accent);
}

.row-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  max-width: 46em;
  font-size: 14.2px;
  line-height: 1.72;
  color: var(--muted);
}

.is-theme .row-theme {
  display: none;
}

.row-theme {
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  text-align: right;
  text-decoration: none;
  transition: color 0.12s ease;
}
.row-theme:hover {
  color: var(--accent);
}

/* --- page head ----------------------------------------------------------- */

.page-head {
  padding: clamp(56px, 7vw, 88px) 0 clamp(32px, 4vw, 46px);
}

.crumbs {
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--accent);
}
.crumbs span {
  margin: 0 9px;
  color: #c2cad3;
}

.page-title {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.page-lede {
  margin-top: 20px;
  max-width: 38em;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-2);
}

.page-meta {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.list-body {
  padding-bottom: clamp(64px, 8vw, 104px);
}

.year-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 64px 0 6px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}
.years .year:first-child .year-head {
  margin-top: 40px;
}
.year-head h2 {
  font-family: "Archivo", var(--sans);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.year-head span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* --- post ---------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(40px, 5vw, 72px);
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(64px, 8vw, 104px);
}

.post-aside {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}
.post-aside::-webkit-scrollbar {
  width: 6px;
}
.post-aside::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 3px;
}

.post-theme {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.post-theme:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-2);
}
.post-facts dt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}
.post-facts dd {
  margin: 0;
}

.toc {
  display: flex;
  flex-direction: column;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.toc-item {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 1px solid transparent;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.toc-item--h1 {
  color: var(--ink-2);
  font-weight: 600;
}
.toc-item--h3 {
  padding-left: 20px;
}
.toc-item:hover {
  color: var(--accent);
}
.toc-item.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 78%);
}

.post-head {
  max-width: 44rem;
}

.post-title {
  font-size: clamp(30px, 4.1vw, 45px);
  font-weight: 750;
  line-height: 1.24;
  letter-spacing: -0.026em;
}

.post-lede {
  margin-top: 22px;
  max-width: 32em;
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}
.post-meta a {
  color: var(--muted);
  text-decoration: none;
}
.post-meta a:hover {
  color: var(--accent);
}
.post-meta a + a::before {
  content: "·";
  margin-right: 10px;
  color: #c2cad3;
}

.toc-mobile {
  display: none;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.toc-mobile summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 2px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}
.toc-mobile summary::-webkit-details-marker {
  display: none;
}
.toc-mobile summary span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.toc-mobile nav {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}

/* --- prose --------------------------------------------------------------- */

.prose {
  counter-reset: sec;
  margin-top: 46px;
  max-width: 40rem;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.2em;
}
.prose p,
.prose li,
.prose a {
  overflow-wrap: anywhere;
}

.prose h1 {
  position: relative;
  counter-increment: sec;
  margin: 2.4em 0 0.85em;
  font-size: 26px;
  font-weight: 750;
  line-height: 1.42;
  letter-spacing: -0.02em;
}
.prose h1::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  left: -3.2em;
  top: 0.5em;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.prose h3 {
  margin: 2em 0 0.55em;
  font-size: 19.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.prose h5 {
  margin: 1.8em 0 0.45em;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink-2);
}

.prose strong {
  font-weight: 680;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 68, 138, 0.3);
}
.prose a:hover {
  border-bottom-color: var(--accent);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
}
.prose li {
  margin: 0.38em 0;
}

.prose blockquote {
  margin: 1.9em 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--ink);
  color: var(--ink-2);
}

.prose hr {
  margin: 2.6em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.9em 0;
}

.prose :not(pre) > code {
  padding: 0.14em 0.38em;
  border-radius: 3px;
  background: #f1f4f7;
  font-family: var(--mono);
  font-size: 0.86em;
  color: #24303c;
}

.table-wrap {
  margin: 1.8em 0;
  overflow-x: auto;
}
.prose table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.7;
}
.prose th,
.prose td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
}
.prose th {
  font-weight: 650;
  border-bottom: 1px solid var(--ink);
}

/* --- code ---------------------------------------------------------------- */

.prose figure.code {
  margin: 2em 0;
  border-radius: 16px;
  background: var(--code-bg);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.code-lang {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8593a4;
}
.copy {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #9fadbd;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.copy:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.copy.is-done {
  color: #7ee0a8;
  border-color: rgba(126, 224, 168, 0.5);
}

.prose figure.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.2px;
  line-height: 1.72;
  color: var(--code-ink);
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}
.prose figure.code pre code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  white-space: pre;
}

.hljs-comment,
.hljs-quote,
.hljs-doctag {
  color: #8f7fa6;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-type {
  color: #ff8fc0;
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute {
  color: #a9e6c9;
}
.hljs-number,
.hljs-symbol,
.hljs-bullet {
  color: #ffc97a;
}
.hljs-title,
.hljs-name,
.hljs-function .hljs-title {
  color: #ffe08a;
}
.hljs-built_in,
.hljs-class .hljs-title,
.hljs-params {
  color: #8fd8ff;
}
.hljs-meta,
.hljs-tag {
  color: #b9a9c9;
}
.hljs-deletion {
  color: #ff9aa9;
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-strong {
  font-weight: 700;
}

/* --- post footer --------------------------------------------------------- */

.post-foot {
  margin-top: clamp(56px, 7vw, 76px);
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.pager-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.pager {
  display: block;
  text-decoration: none;
}
.pager--next {
  text-align: right;
}
.pager-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.pager-title {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: color 0.12s ease;
}
.pager:hover .pager-title {
  color: var(--accent);
}

/* --- themes -------------------------------------------------------------- */

.theme-list {
  border-top: 1px solid var(--ink);
}
.theme-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  padding: 30px 0 32px;
  border-bottom: 1px solid var(--rule-soft);
}
.theme-main {
  display: block;
  text-decoration: none;
}
.theme-name {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.theme-main:hover .theme-name {
  color: var(--accent);
}
.theme-desc {
  display: block;
  margin-top: 10px;
  max-width: 38em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}
.theme-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}
.theme-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}
.theme-subs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}
.theme-subs a {
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
}
.theme-subs a:hover {
  color: var(--accent);
}
.theme-subs em {
  margin-left: 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  color: var(--faint);
}

.subtheme-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}
.subtheme-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.subtheme-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.subtheme-links span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

/* --- tags ---------------------------------------------------------------- */

.tag-rows {
  border-top: 1px solid var(--ink);
}
.tag-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
}
.tag-name {
  font-size: 16px;
  color: var(--ink);
  transition: color 0.12s ease;
}
.tag-row:hover .tag-name {
  color: var(--accent);
}
.tag-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* --- reading path -------------------------------------------------------- */

.tracks {
  border-top: 1px solid var(--ink);
}
.track {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  padding: 36px 0 40px;
  border-bottom: 1px solid var(--rule-soft);
}
.track-head h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.track-head h2 a {
  color: var(--ink);
  text-decoration: none;
}
.track-head h2 a:hover {
  color: var(--accent);
}
.track-head p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.track-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.track-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
}
.step-num,
.step-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.step-title {
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.12s ease;
}
.step-title:hover {
  color: var(--accent);
}

/* --- about --------------------------------------------------------------- */

  margin-top: 2.2em;
}

/* --- search -------------------------------------------------------------- */

.search-page {
  max-width: 720px;
  padding-bottom: 120px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-field svg {
  flex: none;
  color: var(--faint);
}
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}
.search-field input::placeholder {
  color: var(--faint);
}
.search-field input[type='search']::-webkit-search-cancel-button,
.search-field input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-field--page {
  padding: 16px 18px;
}

.search-results {
  margin-top: 10px;
}
.res-item {
  display: block;
  padding: 14px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.1s ease;
}
.res-item:hover,
.res-item.is-active {
  background: var(--band);
}
.res-title {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}
.res-theme {
  margin-right: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.res-snip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}
.res-item mark {
  padding: 0 1px;
  background: var(--accent-soft);
  color: var(--accent);
}
.res-empty {
  padding: 20px 12px;
  font-size: 14px;
  color: var(--muted);
}

.search-dialog {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.search-dialog::backdrop {
  background: rgba(42, 36, 54, 0.38);
  backdrop-filter: blur(2px);
}
.search-panel {
  width: min(680px, calc(100vw - 32px));
  margin: 12vh auto 0;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 32px 80px rgba(42, 36, 54, 0.2);
  overflow: hidden;
}
.search-panel .search-field {
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 18px 20px;
}
.search-panel .search-field:focus-within {
  box-shadow: none;
}
.search-close {
  display: inline-flex;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}
.search-close:hover {
  color: var(--ink);
}
.search-panel .search-results {
  max-height: 56vh;
  overflow-y: auto;
  margin: 0;
  padding: 10px 8px;
}
.search-hints {
  display: flex;
  gap: 20px;
  padding: 10px 20px;
  border-top: 1px solid var(--rule-soft);
  font-size: 11.5px;
  color: var(--faint);
}
.search-hints kbd {
  display: inline-block;
  margin-right: 3px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fafbfc;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

/* --- 404 ----------------------------------------------------------------- */

.notfound {
  padding: clamp(96px, 12vw, 150px) 0 clamp(110px, 14vw, 170px);
}
.notfound-code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--faint);
}
.notfound-title {
  margin-top: 16px;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 750;
  letter-spacing: -0.02em;
}
.notfound-lede {
  margin-top: 16px;
  max-width: 30em;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}
.notfound-links {
  display: flex;
  gap: 26px;
  margin-top: 30px;
  font-size: 14px;
}
.notfound-links a,
.notfound-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.notfound-links a:hover,
.notfound-links button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 44px 0 56px;
}
.footer-in {
  display: flex;
  justify-content: space-between;
  gap: 32px;
}
.footer-name {
  font-size: 15px;
  font-weight: 650;
}
.footer-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.footer-right {
  display: flex;
  align-items: baseline;
  gap: 20px;
  font-size: 13px;
}
.footer-right a {
  color: var(--muted);
  text-decoration: none;
}
.footer-right a:hover {
  color: var(--ink);
}
.footer-copy {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #b3bcc6;
}

/* --- liquid glass -------------------------------------------------------- */

:root {
  --field: #edf0f4;
  --glass-top: rgba(255, 255, 255, 0.7);
  --glass-bottom: rgba(255, 240, 248, 0.34);
  --glass-rim: rgba(255, 255, 255, 0.92);
  --glass-blur: 26px;
  --glass-lift: 0 22px 48px -32px rgba(42, 36, 54, 0.55), 0 2px 8px -4px rgba(42, 36, 54, 0.1);
  --spring: cubic-bezier(0.22, 1.02, 0.36, 1);
}

/* the light field the glass refracts */
body {
  background: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(56vw 52vw at 4% -16%, rgba(255, 138, 178, 0.28), rgba(255, 138, 178, 0) 66%),
    radial-gradient(48vw 42vw at 102% -2%, rgba(120, 190, 255, 0.2), rgba(120, 190, 255, 0) 64%),
    radial-gradient(70vw 58vw at 48% 118%, rgba(232, 214, 255, 0.4), rgba(232, 214, 255, 0) 66%),
    linear-gradient(180deg, #ffeef6 0%, #fff7fb 48%, #ffffff 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.5) 82%, rgba(0, 0, 0, 0.25) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.5) 82%, rgba(0, 0, 0, 0.25) 100%);
}

/* film grain over the light field: kills banding on large gradients */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.55'/></svg>");
  background-size: 160px 160px;
  opacity: 0.16;
  mix-blend-mode: multiply;
}

/* one lens material, six surfaces: header, hero dock, article rail, pager, dialog, mobile toc */
.site-header,
.hero-card,
.hero-nav,
.post-aside,
.pager,
.search-panel,
.toc-mobile {
  background-color: rgba(255, 255, 255, 0.18);
  background-image:
    radial-gradient(340px circle at var(--mx, 24%) var(--my, 0%), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 62%),
    linear-gradient(158deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}

.hero-nav,
.hero-card,
.pager,
.search-panel,
.toc-mobile {
  position: relative;
}

.site-header,
.hero-nav,
.hero-card,
.post-aside,
.pager,
.toc-mobile {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -20px 34px -30px rgba(42, 36, 54, 0.35),
    inset 0 0 0 1px var(--glass-rim),
    0 1px 2px rgba(42, 36, 54, 0.05),
    var(--glass-lift);
}

/* refraction rim: a thin gradient that only exists on the edge */
.site-header::after,
.hero-nav::after,
.hero-card::after,
.post-aside::after,
.pager::after,
.search-panel::after,
.toc-mobile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: linear-gradient(
    148deg,
    rgba(255, 255, 255, 0.98),
    rgba(126, 158, 255, 0.5) 26%,
    rgba(255, 255, 255, 0) 52%,
    rgba(120, 213, 199, 0.32) 74%,
    rgba(255, 255, 255, 0.66)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* header: continuous bar, gains a shadow once the page moves */
.site-header {
  border-bottom: 0;
  background-image:
    radial-gradient(460px circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.44));
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  backdrop-filter: blur(26px) saturate(190%);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 0 rgba(42, 36, 54, 0.06);
  transition: box-shadow 0.32s ease;
}
.site-header.is-stuck {
  box-shadow:
    inset 0 -1px 0 rgba(42, 36, 54, 0.06),
    0 18px 40px -34px rgba(42, 36, 54, 0.6);
}
.header-in {
  height: 68px;
}

.search-btn {
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.3s var(--spring);
}
.search-btn:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

/* hero dock: the theme switch rides in the same lens */
.hero-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 38px;
  padding: 6px;
  border-radius: 999px;
  font-size: 14px;
}
.hero-nav a {
  display: inline-flex;
  align-items: baseline;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.3s var(--spring);
}
.hero-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}
.hero-nav a:active {
  transform: translateY(0) scale(0.985);
}

/* article rail */
.post-aside {
  border-radius: 20px;
  padding: 20px 18px 16px;
  top: 86px;
  max-height: calc(100vh - 110px);
}
.post-aside::after {
  border-radius: 20px;
}

/* pager: two lenses at the foot of the article */
.pager {
  border-radius: 16px;
  padding: 18px 20px;
  transition: transform 0.34s var(--spring), box-shadow 0.3s ease;
}
.pager:hover {
  transform: translateY(-2px);
}
.pager:active {
  transform: translateY(0) scale(0.995);
}
.pager--empty {
  background-image: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* dialog */
.search-panel {
  border-radius: 22px;
  background-image:
    radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 64%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52));
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.85),
    0 48px 100px -44px rgba(42, 36, 54, 0.65);
}
.search-panel .search-field {
  background: rgba(255, 255, 255, 0.5);
}
.search-dialog::backdrop {
  background: rgba(226, 231, 238, 0.42);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
}

/* mobile table of contents */
.toc-mobile {
  border: 0;
  border-radius: 16px;
  padding: 0 14px;
  margin-top: 26px;
}
.toc-mobile summary {
  padding: 14px 0;
}
.toc-mobile nav {
  padding-bottom: 12px;
}

/* content stays paper: rows answer the pointer with light, not with a card */
.row:hover {
  background: rgba(255, 255, 255, 0.62);
}
.site-footer {
  border-top: 1px solid rgba(42, 36, 54, 0.08);
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 1040px) {
  :root {
    --gutter: 32px;
  }
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 40px;
  }
  .post-aside {
    display: none;
  }
  .toc-mobile {
    display: block;
  }
  .prose h1::before {
    display: none;
  }
  .theme-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .theme-side {
    align-items: flex-start;
    text-align: left;
  }
  .theme-subs {
    justify-content: flex-start;
  }
  .track {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 20px;
  }
  .header-in {
    flex-wrap: wrap;
    gap: 0 14px;
    height: auto;
    padding-top: 10px;
  }
  .brand {
    font-size: 13px;
    letter-spacing: 0.14em;
  }
  .search-btn {
    margin-left: auto;
    height: 30px;
  }
  .site-nav {
    order: 3;
    flex: 0 0 100%;
    gap: 22px;
    margin-left: 0;
    padding: 8px 0 10px;
  }
  .site-nav a {
    font-size: 13.5px;
  }
  .search-key {
    display: none;
  }
  .hero-title span {
    padding-left: 0;
  }
  .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 18px 12px;
    margin: 0 -12px;
  }
  .row-date {
    font-family: var(--mono);
    font-size: 11.5px;
    padding-top: 0;
  }
  .row-title {
    font-size: 17.5px;
  }
  .row-theme {
    padding-top: 2px;
    text-align: left;
  }
  .pager-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .pager--next {
    text-align: left;
  }
  .footer-in {
    flex-direction: column;
    gap: 22px;
  }
  .footer-right {
    gap: 16px;
    flex-wrap: wrap;
  }
  .year-head h2 {
    font-size: 30px;
  }
}

@media (max-width: 560px) {
  .prose {
    font-size: 16px;
  }
  .prose figure.code {
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
  }
  .prose figure.code pre {
    padding: 14px 18px;
    font-size: 12.6px;
  }
  .code-head {
    padding: 8px 14px 8px 18px;
  }
  .search-panel {
    margin-top: 7vh;
  }
  .search-hints {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* --- live2d companion ---------------------------------------------------- */
#live2d-widget {
  position: fixed;
  right: 24px;
  bottom: 0;
  width: 210px;
  height: 380px;
  z-index: 40;
  pointer-events: none;
}
#live2d-widget canvas {
  display: block;
  width: 210px !important;
  height: 380px !important;
  pointer-events: auto;
  outline: 0;
}
@media (max-width: 900px) {
  #live2d-widget {
    display: none !important;
  }
}
@media print {
  #live2d-widget {
    display: none !important;
  }
}










/* hero: type on the left, one lens card on the right */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: clamp(28px, 4vw, 60px);
  align-items: end;
}
.hero-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 20px;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.34s var(--spring);
}
.hero-card:hover {
  transform: translateY(-3px);
}
.hero-card:active {
  transform: translateY(-1px) scale(0.995);
}
.hero-card-label {
  font-size: 12px;
  color: var(--muted);
}
.hero-card-title {
  font-size: 21px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.012em;
}
.hero-card-sum {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink-2);
}
.hero-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .hero-card {
    max-width: 520px;
  }
}

@media (max-width: 720px) {
  .hero-card {
    max-width: none;
    border-radius: 18px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset 0 0 0 1px var(--glass-rim),
      0 10px 24px -22px rgba(42, 36, 54, 0.45);
  }
}



/* --- anime layer ---------------------------------------------------------- */
@font-face {
  font-family: "Baloo 2";
  src: url("/assets/fonts/baloo-2-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Baloo 2";
  src: url("/assets/fonts/baloo-2-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.brand,
.row-date,
.post-facts dd,
.tag-count,
.step-meta,
.index-bar span,
.footer-copy {
  font-family: "Baloo 2", var(--sans);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand {
  letter-spacing: 0.12em;
  font-weight: 700;
}

/* petals drifting over the paper */
.petals {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.petal {
  position: absolute;
  top: -6vh;
  width: 11px;
  height: 11px;
  border-radius: 62% 4% 62% 4%;
  background: linear-gradient(145deg, #ffdcec 0%, #ff9dc6 70%);
  opacity: 0.5;
  filter: blur(0.2px);
  animation: petal-fall var(--dur, 16s) linear var(--delay, 0s) infinite;
  will-change: transform;
}
@keyframes petal-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(var(--drift, 24px), 55vh, 0) rotate(220deg);
  }
  100% {
    transform: translate3d(calc(var(--drift, 24px) * -0.4), 112vh, 0) rotate(460deg);
  }
}

/* Paimon's speech bubble */
.l2d-bubble {
  position: absolute;
  right: 26px;
  bottom: 330px;
  width: 184px;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ffd3e4;
  box-shadow: 0 10px 26px -18px rgba(42, 36, 54, 0.45);
  color: #4b4358;
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s var(--spring);
  pointer-events: auto;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.l2d-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid #ffd3e4;
  border-bottom: 1px solid #ffd3e4;
  transform: rotate(-45deg);
}
.l2d-bubble.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#live2d-widget:hover .l2d-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* cuter bits */
.row-title a:hover,
.pager-title:hover,
.tag-row:hover .tag-name {
  color: var(--accent);
}
.tag-row:hover .tag-count,
.row:hover .row-date {
  color: var(--accent);
}
.row-theme:hover {
  color: var(--accent);
}
.search-btn:hover,
.site-nav a:hover {
  color: var(--accent);
}
.hero-card:hover .hero-card-title {
  color: var(--accent);
}
.prose blockquote {
  border-left-color: #ffc2da;
}
.prose a:hover {
  color: var(--accent);
}
::selection {
  background: rgba(240, 68, 138, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .petal {
    display: none;
  }
  .l2d-bubble {
    transition: none;
  }
}
@media (max-width: 720px) {
  .petals {
    display: none;
  }
}



.row-date { font-size: 13px; }
.prose figure.code { box-shadow: 0 18px 40px -30px rgba(88, 42, 70, 0.55); }

/* marker highlight behind the second hero line */


/* pill chips for the theme label on rows */
.row-theme {
  justify-self: end;
  align-self: start;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 214, 232, 0.55);
  border: 1px solid rgba(255, 173, 205, 0.6);
  color: #a83a68;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  transition: background 0.18s ease, color 0.18s ease;
}
.row-theme:hover {
  background: #ffd6e8;
  color: #7d2b50;
  text-decoration: none;
}

/* heading sparkle */
.index-bar h2::after,
.page-title::after {
  content: " ✧";
  color: var(--accent);
  font-weight: 400;
  font-size: 0.62em;
  vertical-align: 0.28em;
}

/* pink active underline */
.site-nav a::after {
  background: linear-gradient(90deg, #ff8fc0, #ffb3d5);
  height: 2.5px;
  border-radius: 2px;
}




/* ===== homepage redesign (reference: yaronluo.com) ===== */
.site-header {
  top: 12px;
  width: min(1240px, calc(100% - 40px));
  margin: 12px auto 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 12px 30px -24px rgba(120, 52, 88, 0.5);
}
.header-in {
  padding: 0 10px 0 22px;
  height: 58px;
}
.site-header.is-stuck {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 18px 40px -30px rgba(120, 52, 88, 0.55);
}

/* paper cards instead of glass outside the header */
.hero-card,
.post-aside,
.pager,
.toc-mobile,
.panel {
  background: #ffffff;
  background-image: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid var(--rule);
  box-shadow: 0 18px 36px -32px rgba(120, 52, 88, 0.55);
}
.hero-card::after,
.post-aside::after,
.pager::after,
.toc-mobile::after {
  display: none;
}

/* hero */
.hero {
  padding: clamp(48px, 7vw, 92px) 0 clamp(28px, 4vw, 48px);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero-hi {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.hero-name {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}
.hero-line {
  margin: 14px 0 0;
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink-2);
}
.hero-line span {
  color: var(--accent);
}
.hero-sub {
  margin: 16px 0 0;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 173, 205, 0.75);
  color: #a83a68;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.hero-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.round-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  box-shadow: 0 10px 22px -20px rgba(120, 52, 88, 0.6);
  transition: transform 0.22s var(--spring), color 0.2s ease, border-color 0.2s ease;
}
.round-link:hover {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: rgba(255, 173, 205, 0.9);
  text-decoration: none;
}
.round-link--wide {
  width: auto;
  padding: 0 18px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.hero-avatar {
  position: relative;
  width: 248px;
  height: 248px;
  border-radius: 50%;
  padding: 10px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ffd9e8 25%, transparent 25% 75%, #ffd9e8 75%),
    linear-gradient(45deg, #ffd9e8 25%, transparent 25% 75%, #ffd9e8 75%);
  background-size: 26px 26px;
  background-position: 0 0, 13px 13px;
  box-shadow: 0 26px 50px -34px rgba(120, 52, 88, 0.6);
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid #fff;
  display: block;
}
.hero-avatar-dot {
  position: absolute;
  right: 18px;
  bottom: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #46d39a;
  border: 4px solid #fff;
}

/* blocks under the hero */
.home-blocks {
  display: grid;
  gap: 18px;
  padding-top: 6px;
}
.latest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 26px 22px;
  border-radius: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--spring), box-shadow 0.3s ease;
}
.latest:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 44px -34px rgba(120, 52, 88, 0.65);
  text-decoration: none;
}
.panel-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 650;
}
.latest-title {
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 750;
  letter-spacing: -0.02em;
}
.latest-sum {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}
.latest-meta {
  display: flex;
  gap: 14px;
  font-family: "Baloo 2", var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}
.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.block {
  padding: 22px 24px 24px;
  border-radius: 24px;
}
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.block-head span {
  font-size: 12px;
  color: var(--faint);
}
.cat-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.cat-bars a {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 4px 11px;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  border-radius: 10px;
}
.cat-bars a:hover {
  background: var(--band);
  text-decoration: none;
}
.cat-count {
  font-family: "Baloo 2", var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.cat-bar {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb3d5, #ffd9e8);
  width: var(--w);
  max-width: calc(100% - 8px);
}
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--band);
  border: 1px solid rgba(255, 173, 205, 0.45);
  color: #a83a68;
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s var(--spring);
}
.tag-chip em {
  font-style: normal;
  font-family: "Baloo 2", var(--mono);
  font-size: 11.5px;
  color: #c2648f;
}
.tag-chip:hover {
  background: #ffd9e8;
  transform: translateY(-1px);
  text-decoration: none;
}

@media (max-width: 1040px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    justify-items: start;
  }
  .hero-avatar {
    width: 190px;
    height: 190px;
    order: -1;
  }
  .home-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .site-header {
    width: calc(100% - 24px);
    margin-top: 10px;
    border-radius: 22px;
  }
  .header-in {
    padding: 8px 12px 10px;
    height: auto;
  }
  .hero-avatar {
    width: 150px;
    height: 150px;
    padding: 7px;
  }
  .hero-avatar-dot {
    right: 8px;
    bottom: 10px;
    width: 16px;
    height: 16px;
    border-width: 3px;
  }
  .latest,
  .block {
    padding: 20px 18px;
    border-radius: 20px;
  }
}

/* keep long tag names inside the panel */
.tag-chip {
  max-width: 100%;
  overflow: hidden;
}
.tag-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* latest panel call to action */
.latest {
  position: relative;
}
.latest-cta {
  position: absolute;
  right: 26px;
  top: 24px;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 0.02em;
}
.latest:hover .latest-cta {
  text-decoration: underline;
}
@media (max-width: 720px) {
  .latest-cta {
    display: none;
  }
}

/* grid items must be allowed to shrink so long chips cannot widen the track */
.home-split > .block,
.tag-chips,
.cat-bars,
.cat-bars li,
.cat-bars a {
  min-width: 0;
}
/* keep category bars short and light */
.cat-bar {
  height: 3px;
  right: auto;
  background: linear-gradient(90deg, #ffa9cf, #ffd9e8);
  opacity: 0.9;
}

/* keep the tag block clear of the companion on wide screens */
@media (min-width: 1200px) {
  .home-split > .block:last-child {
    padding-right: 150px;
  }
}

/* ===== hero panel (reference composition) ===== */
.hero-panel {
  position: relative;
  margin: 16px auto 0;
  padding: clamp(38px, 4.6vw, 62px) clamp(24px, 4vw, 54px) 0;
  border-radius: 34px;
  background:
    radial-gradient(60% 70% at 12% 0%, rgba(255, 214, 232, 0.85), rgba(255, 214, 232, 0) 62%),
    radial-gradient(50% 60% at 96% 6%, rgba(255, 236, 246, 0.9), rgba(255, 236, 246, 0) 60%),
    linear-gradient(158deg, #ffecf5 0%, #fff8fc 52%, #f8f5ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 34px 64px -54px rgba(150, 60, 100, 0.55);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 173, 205, 0.7);
  color: #b04272;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.hero-tag span {
  color: var(--accent);
  font-size: 13px;
}
.hero-greet {
  margin: 0;
  font-size: clamp(19px, 2.1vw, 25px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
}
.hero-name {
  font-size: 1.72em;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--accent);
  vertical-align: -0.04em;
}
.hero-heart {
  margin-left: 6px;
  color: var(--accent);
  font-size: 0.92em;
  vertical-align: 0.06em;
}
.hero-line {
  margin: 14px 0 0;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 650;
  color: var(--ink-2);
}
.hero-line span {
  color: var(--accent);
}
.hero-sub {
  margin: 12px 0 0;
  max-width: 32em;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 173, 205, 0.75);
  color: #a83a68;
  font-size: 12.5px;
}
.chip-ico {
  color: var(--accent);
  font-size: 11px;
}
.hero-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.round-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(255, 173, 205, 0.55);
  color: #8d5a72;
  box-shadow: 0 10px 20px -18px rgba(150, 60, 100, 0.6);
  transition: transform 0.22s var(--spring), color 0.2s ease, border-color 0.2s ease;
}
.round-link:hover {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: rgba(255, 173, 205, 0.95);
  text-decoration: none;
}

/* avatar with frame + tag */
.hero-avatar-wrap {
  position: relative;
  width: 286px;
  height: 286px;
  justify-self: end;
}
.hero-frame {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 160, 198, 0.6);
  transform: rotate(-8deg) scale(0.98);
}
.hero-avatar {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  padding: 0;
  background: none;
  box-shadow: 0 26px 54px -32px rgba(150, 60, 100, 0.65);
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #fff;
  display: block;
}
.hero-avatar-tag {
  position: absolute;
  left: -6px;
  bottom: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(255, 173, 205, 0.7);
  color: #b04272;
  font-size: 11.5px;
  white-space: nowrap;
  box-shadow: 0 12px 24px -20px rgba(150, 60, 100, 0.7);
}
.hero-avatar-dot {
  display: none;
}

/* floating decorations */
.deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  color: rgba(240, 68, 138, 0.28);
  font-size: 15px;
}
.deco--note {
  left: 46%;
  top: 18%;
  font-size: 19px;
  color: rgba(240, 68, 138, 0.35);
}
.deco--spark1 {
  left: 30%;
  bottom: 26%;
  font-size: 13px;
}
.deco--spark2 {
  right: 30%;
  top: 12%;
  font-size: 11px;
  color: rgba(255, 179, 213, 0.85);
}
.deco--heart {
  right: 4%;
  bottom: 18%;
  font-size: 13px;
  color: rgba(255, 150, 190, 0.5);
}

/* quote strip */
.hero-quote {
  margin: clamp(26px, 3vw, 40px) 0 0;
  padding: 18px 0 22px;
  border-top: 1px dashed rgba(240, 68, 138, 0.28);
  text-align: center;
  font-size: 13.5px;
  color: #8d6478;
}
.hero-quote em {
  font-style: normal;
  color: #b590a2;
  margin-left: 4px;
}

@media (max-width: 1040px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
  .hero-avatar-wrap {
    order: -1;
    width: 210px;
    height: 210px;
    justify-self: start;
  }
  .hero-avatar-tag {
    left: 0;
  }
}
@media (max-width: 720px) {
  .hero-panel {
    margin-top: 12px;
    border-radius: 26px;
    padding: 30px 20px 0;
  }
  .hero-avatar-wrap {
    width: 160px;
    height: 160px;
  }
  .hero-avatar {
    inset: 12px;
  }
  .hero-name {
    font-size: 1.6em;
  }
  .hero-quote {
    font-size: 12.5px;
    padding: 14px 0 18px;
  }
}


/* visually hidden but available to screen readers */
.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;
}

/* avatar tap: a little wobble plus a heart */
.hero-avatar {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hero-avatar.is-shaking {
  animation: avatar-wobble 0.52s var(--spring);
}
@keyframes avatar-wobble {
  0% { transform: rotate(0deg) scale(1); }
  18% { transform: rotate(-6deg) scale(1.05); }
  36% { transform: rotate(5deg) scale(1.03); }
  52% { transform: rotate(-3.5deg) scale(1.02); }
  70% { transform: rotate(2deg) scale(1.01); }
  86% { transform: rotate(-1deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}
.hero-avatar .avatar-heart {
  position: absolute;
  left: 50%;
  top: 34%;
  color: var(--accent);
  font-size: 16px;
  pointer-events: none;
  animation: heart-float 1.05s ease-out forwards;
}
@keyframes heart-float {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 6px)), -58px) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-avatar.is-shaking { animation: none; }
  .hero-avatar .avatar-heart { display: none; }
}

/* tighter hero once the headline is gone */
.hero-panel {
  padding: clamp(26px, 3.2vw, 42px) clamp(24px, 4vw, 54px) 0;
}
.hero-inner {
  align-items: center;
  min-height: 0;
}
.hero-tag {
  margin-bottom: 16px;
}
.hero-quote {
  margin-top: clamp(18px, 2.2vw, 26px);
  padding: 15px 0 18px;
}
.hero-avatar-wrap {
  width: 262px;
  height: 262px;
}

/* greeting line: english sans, pink name */
.hero-greet {
  margin: 0;
  font-family: "Archivo", var(--sans);
  font-size: clamp(24px, 2.9vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.hero-name {
  font-size: 1.16em;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.hero-heart {
  margin-left: 7px;
  color: var(--accent);
  font-size: 0.7em;
  vertical-align: 0.12em;
}
.hero-line {
  margin: 14px 0 0;
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.hero-line span {
  color: inherit;
}

/* responsive avatar sizing must win over the desktop override above */
@media (max-width: 1040px) {
  .hero-avatar-wrap {
    width: 200px;
    height: 200px;
    justify-self: start;
  }
  .hero-avatar {
    inset: 14px;
  }
  .hero-frame {
    display: none;
  }
}
@media (max-width: 720px) {
  .hero-avatar-wrap {
    width: 150px;
    height: 150px;
  }
  .hero-avatar {
    inset: 10px;
  }
  .hero-avatar-tag {
    left: 0;
    bottom: -2px;
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* hero fills the first screen: posts start below the fold */
.hero-panel {
  min-height: calc(100dvh - 108px);
  display: flex;
  align-items: center;
  padding-bottom: clamp(32px, 4.6vw, 56px);
}
.hero-panel .hero-inner {
  width: 100%;
}
.hero-quote {
  display: none;
}
@media (max-width: 1040px) {
  .hero-panel {
    min-height: calc(100dvh - 150px);
  }
}
@media (max-width: 720px) {
  .hero-panel {
    min-height: calc(100dvh - 160px);
  }
}


/* bigger hero type, blue name */
.hero-greet {
  font-size: clamp(28px, 3.6vw, 46px);
  letter-spacing: -0.025em;
}
.hero-name {
  color: #3d8bff;
  font-size: 1.14em;
}
.hero-heart {
  font-size: 0.62em;
  margin-left: 8px;
  vertical-align: 0.16em;
}
.hero-line {
  margin-top: 16px;
  font-size: clamp(16px, 1.75vw, 21px);
  font-weight: 600;
  color: var(--ink-2);
}
.hero-tag {
  font-size: 12.5px;
  padding: 6px 14px;
}
.chip {
  font-size: 13px;
  padding: 6px 15px;
}
.chip-ico {
  font-size: 12px;
}
.round-link {
  width: 42px;
  height: 42px;
}
.hero-links {
  gap: 12px;
  margin-top: 26px;
}
.hero-avatar-wrap {
  width: 320px;
  height: 320px;
}
.hero-avatar {
  inset: 18px;
}
.hero-avatar img {
  border-width: 7px;
}
.hero-avatar-tag {
  font-size: 12px;
  padding: 6px 13px;
  bottom: 10px;
}

/* tap: ripple ring + sparkle bits */
.hero-avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(61, 139, 255, 0.45);
  opacity: 0;
  pointer-events: none;
}
.hero-avatar.is-tapping::after {
  animation: ring-pulse 0.75s ease-out;
}
@keyframes ring-pulse {
  0% { opacity: 0.85; transform: scale(0.96); }
  70% { opacity: 0.25; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(1.18); }
}
.avatar-bit {
  position: absolute;
  left: 50%;
  top: 46%;
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
  transform: translate(-50%, -50%);
  animation: bit-fly 0.95s cubic-bezier(0.22, 0.9, 0.3, 1) forwards;
}
@keyframes bit-fly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.05) rotate(24deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-avatar::after,
  .avatar-bit { display: none; }
}
@media (max-width: 1040px) {
  .hero-avatar-wrap {
    width: 230px;
    height: 230px;
  }
  .hero-avatar {
    inset: 14px;
  }
}
@media (max-width: 720px) {
  .hero-avatar-wrap {
    width: 178px;
    height: 178px;
  }
  .hero-avatar {
    inset: 10px;
  }
  .hero-greet {
    font-size: clamp(26px, 7.4vw, 32px);
  }
}

/* a touch larger still, and more visible tap sparkles */
.hero-greet {
  font-size: clamp(30px, 3.9vw, 50px);
}
.hero-line {
  font-size: clamp(17px, 1.9vw, 23px);
}
.hero-avatar-wrap {
  width: 340px;
  height: 340px;
}
.avatar-bit {
  font-size: 20px;
  text-shadow: 0 2px 6px rgba(240, 68, 138, 0.25);
}
@media (max-width: 1040px) {
  .hero-avatar-wrap {
    width: 240px;
    height: 240px;
  }
}
@media (max-width: 720px) {
  .hero-avatar-wrap {
    width: 186px;
    height: 186px;
  }
}

/* brand avatar */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px -4px rgba(150, 60, 100, 0.5);
}
@media (max-width: 720px) {
  .brand-avatar {
    width: 22px;
    height: 22px;
  }
}

/* brand avatar legibility */
.brand-avatar {
  width: 28px;
  height: 28px;
}
.brand {
  gap: 9px;
}
@media (max-width: 720px) {
  .brand-avatar {
    width: 24px;
    height: 24px;
  }
}

/* ===== stats strip (new home module) ===== */
.stats-strip {
  margin: 26px auto 0;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 20px 4px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 22px 44px -40px rgba(150, 60, 100, 0.55);
}
.stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 2px 22px;
  border-left: 1px dashed rgba(240, 68, 138, 0.22);
}
.stat:first-child {
  border-left: 0;
}
.stat dt {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.stat dd {
  margin: 6px 0 0;
  font-family: "Baloo 2", var(--sans);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.stat--wide dd {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  padding-top: 6px;
}
.stat dd em {
  font-style: normal;
  color: var(--accent);
}
@media (max-width: 1040px) {
  .stats {
    flex-wrap: wrap;
    gap: 16px 0;
  }
  .stat {
    flex: 1 1 30%;
  }
}
@media (max-width: 720px) {
  .stats {
    padding: 16px 2px;
    border-radius: 20px;
  }
  .stat {
    flex: 1 1 50%;
    padding: 2px 16px;
    border-left: 0;
  }
  .stat dd {
    font-size: 19px;
  }
  .stat--wide dd {
    font-size: 12.5px;
  }
}

/* latest panel removed from the home page */
.home-blocks {
  margin-top: 26px;
}
.home-blocks .home-split {
  margin-top: 0;
}

/* blue heart: bigger, glowing, beating */
.hero-heart {
  display: inline-block;
  position: relative;
  color: #3d8bff;
  font-size: 0.86em;
  margin-left: 10px;
  vertical-align: 0.1em;
  transform-origin: 50% 55%;
  filter: drop-shadow(0 2px 10px rgba(61, 139, 255, 0.55));
  animation: heart-beat 2.2s ease-in-out infinite;
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.16); }
  24% { transform: scale(0.99); }
  36% { transform: scale(1.1); }
  52% { transform: scale(1); }
}
.hero-heart::after {
  content: "✧";
  position: absolute;
  top: -0.5em;
  right: -0.42em;
  font-size: 0.4em;
  color: #7fb4ff;
  animation: twinkle 2.8s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6) rotate(0deg); }
  40% { opacity: 1; transform: scale(1) rotate(24deg); }
  70% { opacity: 0.3; transform: scale(0.8) rotate(40deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-heart,
  .hero-heart::after {
    animation: none;
  }
}
@media (max-width: 720px) {
  .hero-heart {
    font-size: 0.9em;
    margin-left: 8px;
  }
}

/* breathing room between the stats strip and the list */
.stats-strip {
  margin-bottom: 34px;
}
@media (max-width: 720px) {
  .stats-strip {
    margin-bottom: 22px;
  }
}

/* live status next to the greeting */
.hero-status {
  display: inline-block;
  margin-left: 6px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #b3678a;
  vertical-align: 0.28em;
  animation: status-breathe 3.2s ease-in-out infinite;
}
@keyframes status-breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-status { animation: none; opacity: 0.9; }
}
@media (max-width: 720px) {
  .hero-status {
    font-size: 12px;
    vertical-align: 0.2em;
    margin-left: 2px;
  }
}

/* mobile: status drops to its own line without the leading bar */
.hero-status-bar {
  color: #d9a8bd;
}
@media (max-width: 720px) {
  .hero-status {
    display: block;
    margin: 8px 0 0;
    font-size: 12.5px;
    letter-spacing: 0.02em;
  }
  .hero-status-bar {
    display: none;
  }
}

/* scroll-down cue at the bottom of the hero */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 173, 205, 0.8);
  color: #c2527f;
  box-shadow: 0 12px 26px -18px rgba(150, 60, 100, 0.7);
  cursor: pointer;
  animation: cue-bob 2.4s ease-in-out infinite;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.hero-scroll:hover {
  color: var(--accent);
  border-color: rgba(240, 68, 138, 0.9);
  background: #fff;
}
@keyframes cue-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll { animation: none; }
}
@media (max-width: 720px) {
  .hero-scroll {
    bottom: 14px;
    width: 38px;
    height: 38px;
  }
}

/* final sizing pass: bigger hero avatar */
.hero-avatar-wrap {
  width: 400px;
  height: 400px;
}
@media (max-width: 1240px) {
  .hero-avatar-wrap {
    width: 340px;
    height: 340px;
  }
}
@media (max-width: 1040px) {
  .hero-avatar-wrap {
    width: 280px;
    height: 280px;
  }
}
@media (max-width: 720px) {
  .hero-avatar-wrap {
    width: 210px;
    height: 210px;
  }
}

/* avatar box must fill its ring, not stay at the old fixed 248px */
.hero-avatar {
  position: absolute;
  inset: 18px;
  width: auto;
  height: auto;
}
@media (max-width: 1040px) {
  .hero-avatar {
    inset: 14px;
  }
}
@media (max-width: 720px) {
  .hero-avatar {
    inset: 10px;
  }
}

/* glass heart: static pendant, artistic animation on click */
.hero-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.94em;
  height: 0.94em;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  vertical-align: -0.06em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: none;
  filter: drop-shadow(0 6px 14px rgba(240, 68, 138, 0.28));
  transition: transform 0.25s cubic-bezier(0.22, 1.02, 0.36, 1);
}
.hero-heart:hover { transform: scale(1.06); }
.hero-heart:active { transform: scale(0.97); }
.hero-heart:focus-visible { outline: 2px solid rgba(240, 68, 138, 0.55); outline-offset: 4px; border-radius: 50%; }
.heart-svg { width: 100%; height: 100%; overflow: visible; }

.heart-body {
  fill: url(#hg);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.3;
  transform-origin: 16px 16px;
}
.heart-shine {
  fill: url(#hs);
  opacity: 0.75;
  mix-blend-mode: screen;
  pointer-events: none;
}
.heart-sweep { opacity: 0; }
.heart-ring {
  fill: none;
  stroke: rgba(255, 154, 199, 0.85);
  stroke-width: 1.1;
  opacity: 0;
  transform-origin: 16px 16px;
}
.heart-sparks circle {
  fill: #ffffff;
  opacity: 0;
}

.hero-heart.is-pop .heart-body {
  animation: heart-thump 0.95s cubic-bezier(0.22, 1.02, 0.36, 1);
}
.hero-heart.is-pop .heart-sweep {
  animation: heart-glint 0.85s ease-out 0.05s;
}
.hero-heart.is-pop .heart-ring {
  animation: heart-ripple 1s ease-out;
}
.hero-heart.is-pop .heart-sparks circle {
  animation: heart-spark 0.95s ease-out;
}
.hero-heart.is-pop .heart-sparks circle:nth-child(2) { animation-delay: 0.08s; }
.hero-heart.is-pop .heart-sparks circle:nth-child(3) { animation-delay: 0.16s; }
.hero-heart.is-pop .heart-sparks circle:nth-child(4) { animation-delay: 0.12s; }

@keyframes heart-thump {
  0% { transform: scale(1); }
  18% { transform: scale(1.22) rotate(-5deg); }
  36% { transform: scale(0.96) rotate(3deg); }
  54% { transform: scale(1.12) rotate(-2deg); }
  76% { transform: scale(0.99); }
  100% { transform: scale(1); }
}
@keyframes heart-glint {
  0% { opacity: 0; transform: translateX(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateX(74px); }
}
@keyframes heart-ripple {
  0% { opacity: 0.85; transform: scale(0.72); }
  70% { opacity: 0.28; }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes heart-spark {
  0% { opacity: 0; transform: translateY(2px) scale(0.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-7px) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-heart,
  .hero-heart.is-pop .heart-body,
  .hero-heart.is-pop .heart-sweep,
  .hero-heart.is-pop .heart-ring,
  .hero-heart.is-pop .heart-sparks circle { animation: none !important; }
}

/* softer glint so the glass does not wash out mid-sweep */
.hero-heart.is-pop .heart-sweep {
  animation: heart-glint 0.9s ease-out 0.04s;
}
@keyframes heart-glint {
  0% { opacity: 0; transform: translateX(0); }
  18% { opacity: 0.62; }
  100% { opacity: 0; transform: translateX(86px); }
}

/* --- hero serif display type (self-hosted, subset to the hero glyphs) --- */
@font-face {
  font-family: "Hero Serif EN";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/hero-serif-en.woff2") format("woff2");
}
@font-face {
  font-family: "Hero Serif SC";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/assets/fonts/hero-serif-sc.woff2") format("woff2");
  unicode-range: U+4e2d, U+4eec, U+4f1a, U+4f60, U+518d, U+5416, U+5728, U+5929, U+597d, U+5e38, U+613f, U+6211, U+653e, U+65e5, U+660e, U+6e05, U+7684, U+9001, U+9192, U+ff5c;
}

.hero-greet {
  font-family: "Hero Serif EN", "Hero Serif SC", var(--sans);
  font-size: clamp(32px, 4.2vw, 54px);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.22;
}
.hero-name {
  font-family: "Hero Serif EN", var(--sans);
  font-size: 1.06em;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #3d8bff;
}
.hero-line {
  font-family: "Hero Serif SC", "Songti SC", var(--sans);
  font-size: clamp(19px, 2.05vw, 25px);
  font-weight: 500;
  letter-spacing: 0.18em;
  margin-top: 18px;
  color: #5d5068;
}
.hero-status {
  font-family: "Hero Serif SC", var(--sans);
  letter-spacing: 0.18em;
  font-weight: 500;
}
.hero-heart {
  vertical-align: -0.1em;
}
@media (max-width: 720px) {
  .hero-greet {
    font-size: clamp(27px, 7.4vw, 34px);
  }
  .hero-line {
    font-size: 16px;
    letter-spacing: 0.12em;
    margin-top: 12px;
  }
  .hero-status {
    letter-spacing: 0.1em;
  }
}

/* keep the dashed ring at every width, and pull the stacked hero closer */
.hero-frame {
  display: block;
}
@media (max-width: 1040px) {
  .hero-frame {
    display: block;
    inset: 2px;
  }
  .hero-inner {
    gap: 14px;
  }
  .hero-main {
    margin-top: 6px;
  }
  .hero-avatar-tag {
    bottom: -6px;
  }
}
@media (max-width: 720px) {
  .hero-inner {
    gap: 10px;
  }
  .hero-avatar-tag {
    bottom: -4px;
  }
}

/* avatar is a 250px source: keep the painted size near 1:1 so it stays crisp */
.hero-avatar-wrap {
  width: 290px;
  height: 290px;
}
@media (max-width: 1240px) {
  .hero-avatar-wrap {
    width: 270px;
    height: 270px;
  }
}
@media (max-width: 1040px) {
  .hero-avatar-wrap {
    width: 250px;
    height: 250px;
  }
}
@media (max-width: 720px) {
  .hero-avatar-wrap {
    width: 190px;
    height: 190px;
  }
}

/* --- blue music notes trailing the pointer --- */
.notes-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  overflow: hidden;
}
.note-spark {
  position: absolute;
  left: 0;
  top: 0;
  font-family: "Segoe UI Symbol", "Apple Symbols", serif;
  line-height: 1;
  color: #3d8bff;
  text-shadow: 0 0 10px rgba(61, 139, 255, 0.45), 0 0 22px rgba(61, 139, 255, 0.2);
  will-change: transform, opacity;
  animation: note-drift 1.15s cubic-bezier(0.18, 0.62, 0.34, 1) forwards;
}
@keyframes note-drift {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.55) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, -70px), 0) scale(1.08) rotate(var(--rot, 18deg));
  }
}
@media (prefers-reduced-motion: reduce) {
  .notes-layer { display: none; }
}

/* remove the white hairline frame so the hero blends into the page */
.hero-panel {
  border: 0;
  box-shadow: none;
}

/* hero should sit directly on the page field, no card edge at all */
.hero-panel {
  background: transparent;
  border-radius: 0;
}

/* avatar sits right next to the text block on wide screens */
@media (min-width: 1041px) {
  .hero-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(28px, 3vw, 48px);
  }
  .hero-main {
    flex: 0 1 auto;
    min-width: 0;
  }
  .hero-avatar-wrap {
    flex: 0 0 auto;
  }
}

/* status label: thin sans with wide tracking */
.hero-status {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: #bb84a0;
  vertical-align: 0.34em;
}
@media (max-width: 720px) {
  .hero-status {
    font-size: 11.5px;
    letter-spacing: 0.22em;
  }
}

/* hero v2: top-aligned split, never centred vertically (layout-v4 §3) */
@media (min-width: 1041px) {
  .hero-panel {
    display: block;
  }
  .hero-inner {
    align-items: flex-start;
  }
  .hero-avatar-wrap {
    align-self: flex-start;
    margin-top: 6px;
  }
}
@media (max-width: 1040px) {
  .hero-panel {
    display: block;
    padding-top: 44px;
  }
  .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
  }
  .hero-avatar-wrap {
    order: 2;
    align-self: flex-start;
    margin-top: 0;
  }
  .hero-main {
    order: 1;
    width: 100%;
  }
}
@media (max-width: 720px) {
  .hero-panel {
    padding-top: 26px;
  }
  .hero-inner {
    gap: 20px;
  }
}

/* hero v2 sizing: bigger portrait + larger headline so the first screen reads filled */
@media (min-width: 1200px) {
  .hero-avatar-wrap {
    width: 440px;
    height: 440px;
  }
  .hero-avatar {
    inset: 20px;
  }
  .hero-greet {
    font-size: clamp(40px, 4.2vw, 62px);
  }
  .hero-line {
    font-size: clamp(20px, 1.9vw, 26px);
  }
}
@media (min-width: 1041px) and (max-width: 1199px) {
  .hero-avatar-wrap {
    width: 360px;
    height: 360px;
  }
}

/* split kicks in at 881px (layout-v4 collapses around 820), stack below */
@media (min-width: 881px) {
  .hero-panel {
    display: block;
  }
  .hero-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(28px, 3vw, 48px);
  }
  .hero-main {
    order: 0;
    width: auto;
  }
  .hero-avatar-wrap {
    order: 0;
    align-self: flex-start;
  }
}
@media (min-width: 881px) and (max-width: 1199px) {
  .hero-avatar-wrap {
    width: 320px;
    height: 320px;
  }
  .hero-avatar {
    inset: 16px;
  }
}
@media (max-width: 880px) {
  .hero-panel {
    display: block;
    padding-top: 40px;
  }
  .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
  }
  .hero-main {
    order: 1;
    width: 100%;
  }
  .hero-avatar-wrap {
    order: 2;
    align-self: flex-start;
  }
}

/* below 1200 the hero hugs its content instead of forcing a full screen */
@media (max-width: 1199px) {
  .hero-panel {
    min-height: 0;
    padding-bottom: 64px;
  }
  .hero-scroll {
    bottom: 14px;
  }
}

/* the scroll cue only makes sense on the full-height hero */
@media (max-width: 1199px) {
  .hero-scroll {
    display: none;
  }
}

/* user asked for the pair to sit vertically centred inside the full-height hero */
@media (min-width: 1200px) {
  .hero-panel {
    display: flex;
    align-items: center;
  }
  .hero-inner {
    width: 100%;
    align-items: center;
  }
  .hero-avatar-wrap {
    align-self: center;
    margin-top: 0;
  }
}
