/* ==========================================================
   Porphyrian Tree — stylesheet
   Palette: Aegean lapis blue + temple gold
   ========================================================== */

:root,
:root[data-theme="dark"] {
  --bg:        #061127;
  --bg-2:      #0a1a38;
  --surface:   #0d2146;
  --surface-2: #112a57;
  --line:      rgba(212, 175, 90, 0.20);
  --line-soft: rgba(143, 180, 238, 0.10);
  --text:      #e9e3d3;
  --muted:     #9ba8c2;
  --gold:      #d4af5a;
  --gold-2:    #f0d78c;
  --gold-ink:  #1a1204;
  --blue:      #5b8fe0;
  --blue-soft: #8fb4ee;
  --glow:      rgba(212, 175, 90, 0.35);
  --dot:       rgba(143, 180, 238, 0.09);
  --shadow:    0 20px 50px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #f4efe2;
  --bg-2:      #ece4d0;
  --surface:   #fbf8ef;
  --surface-2: #f3ecdb;
  --line:      rgba(18, 48, 94, 0.18);
  --line-soft: rgba(18, 48, 94, 0.08);
  --text:      #13223f;
  --muted:     #56627a;
  --gold:      #9a7222;
  --gold-2:    #7d5a14;
  --gold-ink:  #fffaf0;
  --blue:      #1d4a8f;
  --blue-soft: #2d5da8;
  --glow:      rgba(154, 114, 34, 0.25);
  --dot:       rgba(18, 48, 94, 0.07);
  --shadow:    0 18px 40px -26px rgba(19, 34, 63, 0.35);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::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;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(91, 143, 224, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(212, 175, 90, 0.07), transparent 60%);
  color: var(--text);
  font: 400 1.125rem/1.7 "EB Garamond", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  top: 0 !important; /* neutralise Google Translate offset */
}
:root[data-theme="light"] body {
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(29, 74, 143, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(154, 114, 34, 0.08), transparent 60%);
}
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
main { flex: 1; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
img { max-width: 100%; height: auto; }
::selection { background: var(--gold); color: var(--gold-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
.mono, code, kbd, pre { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.narrow { max-width: 780px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--gold-ink); padding: 6px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue-soft); margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--gold); }
.eyebrow .sep { opacity: 0.5; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--glow); animation: blink 2.4s ease-in-out infinite; }

/* ---------- Greek meander strip ---------- */
.meander {
  height: 14px;
  opacity: 0.55;
  background-color: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 13.2H20M0 .8H20M3 13.2V3.6H17V10.8H7V6.4H13V8.6' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") repeat-x left center / 20px 14px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 13.2H20M0 .8H20M3 13.2V3.6H17V10.8H7V6.4H13V8.6' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") repeat-x left center / 20px 14px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.site-header .meander { height: 8px; background-size: auto; opacity: 0.35; -webkit-mask-size: 14px 8px; mask-size: 14px 8px; }
.header-inner { display: flex; align-items: center; gap: 1rem; height: 68px; }
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--gold); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--gold-2); }
.logo-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: "Cinzel", serif; font-weight: 500; font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }

.nav { display: flex; gap: 0.25rem; }
.nav a {
  font-family: "Cinzel", serif; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 0.5rem 0.75rem; position: relative; white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--gold); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 0.15rem; width: 5px; height: 5px;
  background: var(--gold); transform: translateX(-50%) rotate(45deg);
}
.tools { display: flex; gap: 0.35rem; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 36px; min-width: 36px; padding: 0 0.6rem;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted);
  font: 500 0.72rem "JetBrains Mono", monospace; letter-spacing: 0.06em; cursor: pointer; justify-content: center;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }

/* translate menu */
.lang { position: relative; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 220px; max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: 0.18s ease;
}
.lang.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-note { margin: 4px 8px 6px; font: 0.64rem/1.4 "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lang-menu button {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text);
  font: 1rem "EB Garamond", serif; cursor: pointer; text-align: left;
}
.lang-menu button span { font: 0.66rem "JetBrains Mono", monospace; color: var(--muted); text-transform: uppercase; }
.lang-menu button:hover { background: var(--surface-2); color: var(--gold); }
.lang-menu button[aria-current="true"] { color: var(--gold); }
.lang-menu button[aria-current="true"]::before { content: "◆"; font-size: 0.55rem; margin-right: 6px; }
.lang-menu button[aria-current="true"] { justify-content: flex-start; }
.lang-menu button[aria-current="true"] span { margin-left: auto; }

@media (max-width: 719px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; row-gap: 4px; }
  .brand-name { font-size: 0.92rem; letter-spacing: 0.1em; }
  .nav { order: 3; width: 100%; justify-content: center; border-top: 1px solid var(--line-soft); padding-top: 2px; }
  .nav a { font-size: 0.74rem; padding: 0.5rem 0.7rem; }
}

/* hide Google Translate chrome */
.goog-te-banner-frame, iframe.skiptranslate, body > .skiptranslate,
#goog-gt-tt, .goog-te-balloon-frame, .VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-yAWNEb-L7lbkb { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
#google_translate_element { position: absolute; left: -9999px; top: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.4rem; border-radius: 2px; text-decoration: none;
  font: 500 0.8rem "Cinzel", serif; letter-spacing: 0.16em; text-transform: uppercase; transition: 0.2s ease;
}
.btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); box-shadow: 0 8px 26px -10px var(--glow); }
:root[data-theme="light"] .btn.gold { background: linear-gradient(180deg, #b58a31, #8d661b); }
.btn.gold:hover { transform: translateY(-1px); color: var(--gold-ink); box-shadow: 0 12px 30px -10px var(--glow); }
.btn.ghost { border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  padding-top: 3.5rem; padding-bottom: 3rem; align-items: center;
}
@media (min-width: 920px) { .hero { grid-template-columns: 1.05fr 0.95fr; padding-top: 5rem; padding-bottom: 4rem; gap: 3rem; } }
.hero-title {
  font-family: "Cinzel", serif; font-weight: 500; text-transform: uppercase;
  font-size: clamp(2.8rem, 9vw, 5.6rem); line-height: 0.98; letter-spacing: 0.06em; margin: 0 0 1.4rem;
  background: linear-gradient(180deg, var(--gold-2) 10%, var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title em {
  font-family: "Cormorant Garamond", serif; font-style: italic; text-transform: none;
  font-weight: 400; letter-spacing: 0.01em; font-size: 1.12em;
}
.hero-lede { font-family: "Cormorant Garamond", serif; font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-style: italic; color: var(--text); margin: 0 0 1rem; line-height: 1.35; }
.hero-body { color: var(--muted); max-width: 34rem; margin: 0 0 2rem; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-figure { position: relative; margin: 0 auto; width: 100%; max-width: 340px; }
@media (min-width: 920px) { .hero-figure { max-width: 460px; } }
.hero-figure::before {
  content: ""; position: absolute; inset: 8% 4%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(91, 143, 224, 0.18), transparent);
  filter: blur(10px);
}
.figcap { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; margin: 0.6rem 0 0; }

/* the tree */
.ptree { width: 100%; height: auto; display: block; overflow: visible; }
.ptree .edge {
  fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.8;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s var(--d, 0s) ease-out forwards;
}
.ptree .edge.neg { stroke: var(--blue-soft); opacity: 0.35; stroke-width: 1; }
.ptree .edge.ai { stroke: var(--gold-2); stroke-dasharray: 0.02 0.02; stroke-dashoffset: 0; opacity: 0; animation: fade 1s var(--d) ease forwards; }
.ptree .node, .ptree .dnode, .ptree .indiv, .ptree .ai-node { opacity: 0; animation: fade 0.8s var(--d, 0s) ease forwards; }
.ptree .node rect { fill: var(--surface); stroke: var(--gold); stroke-width: 1.1; }
.ptree .node text { fill: var(--gold-2); font: 500 12.5px "Cinzel", serif; letter-spacing: 0.16em; text-anchor: middle; }
.ptree .dnode circle { fill: var(--gold); }
.ptree .dnode text { fill: var(--text); font: italic 17px "Cormorant Garamond", serif; }
.ptree .dnode.neg circle { fill: none; stroke: var(--blue-soft); stroke-width: 1; }
.ptree .dnode.neg text { fill: var(--muted); }
.ptree .indiv circle { fill: var(--blue-soft); }
.ptree .indiv text { fill: var(--muted); font: italic 15px "Cormorant Garamond", serif; text-anchor: middle; }
.ptree .ai-node circle { fill: var(--gold-2); animation: pulse 2.2s ease-in-out infinite; transform-origin: 50px 600px; }
.ptree .ai-node text { fill: var(--gold-2); font: 500 12px "JetBrains Mono", monospace; text-anchor: middle; letter-spacing: 0.04em; }
.ptree .ai-node .cursor { fill: var(--gold-2); animation: blink 1.1s steps(1) infinite; }
.ptree .signal { fill: var(--gold-2); }
:root[data-theme="light"] .ptree .node text, :root[data-theme="light"] .ptree .ai-node text { fill: var(--gold); }
:root[data-theme="light"] .ptree .ai-node circle, :root[data-theme="light"] .ptree .ai-node .cursor, :root[data-theme="light"] .ptree .signal { fill: var(--gold); }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.6; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- sections ---------- */
.section { padding-top: 3rem; padding-bottom: 3rem; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0; }
.section-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.more { font-size: 0.78rem; letter-spacing: 0.08em; text-decoration: none; }

/* temple columns */
.columns { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .columns { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.column {
  position: relative; padding: 2.4rem 1.6rem 2.2rem; text-align: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, var(--line-soft) 18px 19px),
    linear-gradient(180deg, var(--surface), var(--bg-2));
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.column .capital, .column .base {
  position: absolute; left: -10px; right: -10px; height: 10px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); opacity: 0.85;
}
.column .capital { top: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 10px 100%); }
.column .base { bottom: 0; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%); }
.numeral { font-family: "Cinzel", serif; font-size: 0.95rem; letter-spacing: 0.3em; color: var(--gold); margin: 0 0 0.4rem; }
.column h3 { font-size: 1.65rem; margin-bottom: 0.6rem; }
.column p:last-of-type { color: var(--muted); margin: 0; font-size: 1.05rem; }

/* cards */
.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards.list { grid-template-columns: 1fr; gap: 0; }
.card {
  position: relative; display: flex; flex-direction: column; padding: 1.6rem 1.5rem 1.4rem;
  background: var(--surface); border: 1px solid var(--line-soft); border-top: 2px solid var(--gold);
  text-decoration: none; color: var(--text); transition: 0.22s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow); color: var(--text); }
.card-meta { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-soft); margin: 0 0 0.8rem; }
.card h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.card:hover h3 { color: var(--gold); }
.card-excerpt { color: var(--muted); font-size: 1.02rem; margin: 0 0 1.2rem; flex: 1; }
.card-go { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--gold); }

.cards.list .card {
  display: grid; grid-template-columns: 1fr; gap: 0.2rem 2rem; padding: 1.5rem 0;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft); box-shadow: none; transform: none;
}
@media (min-width: 720px) {
  .cards.list .card { grid-template-columns: 130px 1fr; }
  .cards.list .card .card-meta { grid-row: span 3; padding-top: 0.55rem; }
}
.cards.list .card-excerpt { margin-bottom: 0.4rem; }

/* epigraph */
.epigraph {
  margin: 1rem auto 2rem; max-width: 860px; text-align: center; padding: 3rem 1.5rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative;
}
.epigraph::before, .epigraph::after {
  content: ""; position: absolute; left: 50%; width: 9px; height: 9px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg);
}
.epigraph::before { top: 0; } .epigraph::after { top: 100%; }
.epigraph blockquote { margin: 0 0 1.2rem; font: italic 400 clamp(1.3rem, 2.8vw, 1.75rem)/1.45 "Cormorant Garamond", serif; }
.epigraph figcaption { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }

/* ---------- pages & posts ---------- */
.page { padding-top: 3.5rem; padding-bottom: 4rem; }
.page.center { text-align: center; }
.page.center .eyebrow { justify-content: center; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: 0.4em; }
.lede { font: italic 1.35rem/1.45 "Cormorant Garamond", serif; color: var(--muted); margin: 0 0 1.2rem; }
.rule { display: flex; align-items: center; gap: 12px; margin: 2rem 0 2.4rem; }
.rule::before, .rule::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.rule span { width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); flex: none; }

.tags { list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags a {
  display: inline-block; padding: 0.2rem 0.65rem; border: 1px solid var(--line); border-radius: 999px;
  font: 0.7rem "JetBrains Mono", monospace; letter-spacing: 0.05em; color: var(--blue-soft); text-decoration: none;
}
.tags a:hover { color: var(--gold); border-color: var(--gold); }

/* prose */
.prose { font-size: 1.2rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose > p:first-child::first-letter {
  float: left; font: 500 4.4em/0.82 "Cinzel", serif; color: var(--gold); margin: 0.08em 0.1em 0 0;
}
.prose h2 { font-size: 2rem; margin-top: 2em; position: relative; padding-left: 1.1rem; }
.prose h2::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.prose h3 { font-size: 1.5rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--gold); }
.prose strong { font-weight: 500; color: var(--text); }
.prose blockquote {
  margin-left: 0; margin-right: 0; padding: 0.2em 0 0.2em 1.4em; border-left: 2px solid var(--gold);
  font: italic 1.35rem/1.55 "Cormorant Garamond", serif; color: var(--text);
}
.prose blockquote p + p { margin-top: 0.6em; }
.prose hr { border: 0; text-align: center; margin: 2.5em 0; }
.prose hr::after { content: "◆  ◆  ◆"; color: var(--gold); font-size: 0.65rem; letter-spacing: 0.6em; }
.prose img { display: block; margin: 1.6em auto; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line-soft); text-align: left; }
.prose th { font: 500 0.75rem "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-soft); border-bottom-color: var(--line); }
.prose :not(pre) > code { font-size: 0.82em; padding: 0.1em 0.4em; border-radius: 4px; background: var(--surface-2); color: var(--gold-2); }
:root[data-theme="light"] .prose :not(pre) > code { color: var(--blue); }
.prose pre {
  font-size: 0.85rem; line-height: 1.6; padding: 1.1rem 1.3rem; overflow-x: auto; border-radius: 6px;
  background: #040c1d; color: #d7deec; border: 1px solid var(--line-soft); position: relative;
}
.prose div.highlighter-rouge { position: relative; }
.prose div.highlighter-rouge::before {
  content: attr(data-lang); position: absolute; right: 12px; top: 8px; z-index: 1;
  font: 0.62rem "JetBrains Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #6f7fa0;
}
.prose .footnotes { margin-top: 3em; padding-top: 1.2em; border-top: 1px solid var(--line); font-size: 0.98rem; color: var(--muted); }
.prose .footnotes ol { padding-left: 1.2em; }
.prose sup a.footnote { font-family: "JetBrains Mono", monospace; font-size: 0.7em; text-decoration: none; padding: 0 0.15em; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.4em 0; }
.link-list { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.link-list a { display: inline-block; padding: 0.4rem 0.9rem; border: 1px solid var(--line); font: 0.78rem "JetBrains Mono", monospace; text-decoration: none; }

/* syntax colours (rouge) */
.highlight .c, .highlight .c1, .highlight .cm { color: #6f7fa0; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kc, .highlight .ow { color: #8fb4ee; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd { color: #f0d78c; }
.highlight .mi, .highlight .mf, .highlight .m { color: #e7a86b; }
.highlight .nf, .highlight .fm { color: #d4af5a; }
.highlight .nb, .highlight .bp { color: #9fd3c7; }
.highlight .o, .highlight .p { color: #b9c3d8; }

.post-end .rule { margin-top: 3.5rem; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.post-nav a { display: flex; flex-direction: column; gap: 0.3rem; text-decoration: none; color: var(--text); font: 500 1.2rem/1.3 "Cormorant Garamond", serif; }
.post-nav a .mono { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.post-nav a:hover { color: var(--gold); }
.post-nav .next { text-align: right; grid-column: 2; }

/* blog filters */
.filters { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.search {
  display: flex; align-items: center; gap: 0.6rem; max-width: 420px; padding: 0 0.9rem; height: 44px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface);
}
.search:focus-within { border-color: var(--gold); color: var(--gold); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 1.05rem "EB Garamond", serif; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer;
  font: 0.72rem "JetBrains Mono", monospace; letter-spacing: 0.05em;
}
.chip span { opacity: 0.6; margin-left: 0.2rem; }
.chip:hover { color: var(--gold); border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.year { font-size: 0.8rem; letter-spacing: 0.2em; color: var(--gold); margin: 1.5rem 0 0; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
[hidden] { display: none !important; }

/* ---------- footer ---------- */
.site-footer { margin-top: 4rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.2rem; padding-top: 2rem; padding-bottom: 2.5rem; }
.footer-brand { font: 500 1rem "Cinzel", serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.3rem; }
.footer-motto { margin: 0; color: var(--muted); font-style: italic; }
.footer-meta { display: flex; gap: 1.2rem; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); }
.footer-meta a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .ptree .signal { display: none; }
}

/* 段落间距和行宽 */
.page-content p {
  margin-bottom: 1.2em;
  max-width: 65ch;
}

/* 翻译成中文时显示中文名 */
.name-zh { display: none; }
html.translated-ltr .name-en { display: none; }
html.translated-ltr .name-zh { display: inline; }
