/* ==========================================================================
   Editorial layer — 研究者的數位筆記本
   Loaded after every other stylesheet. Remove its <link> in default.html to
   return to the previous look; the old files are in _backup/before-editorial.
   ========================================================================== */
:root {
  --bg: #0a1224;
  --bg-glow: #18264a;
  --surface: #0f1a32;
  --surface-2: #15223f;
  --text: #ede8de;
  --text-soft: #d6d1c6;
  --muted: #a3a8b8;
  --faint: #737a8f;
  --line: #ffffff14;
  --line-strong: #ffffff24;
  --accent: #efc283;
  --accent-soft: #efc28322;
  --teal: #8fc7cc;
  --serif-en: "Fraunces", "Noto Serif TC", Georgia, serif;
  --serif: "Noto Serif TC", "Songti TC", "Fraunces", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Heiti TC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 1080px;
  --read: 40rem;
}

/* ---------- Base ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  background:
    radial-gradient(1100px 520px at 78% -8%, var(--bg-glow) 0%, transparent 62%),
    radial-gradient(800px 480px at -10% 30%, #121d3c 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: .02em;
  line-height: 1.9;
  color: var(--text-soft);
  font-feature-settings: "palt" 0;
}
::selection { background: var(--accent); color: var(--bg); }
:where(h1, h2, h3) { color: var(--text); font-family: var(--serif); font-weight: 500; letter-spacing: .01em; }
.park-grain { opacity: .22; mix-blend-mode: soft-light; }
.park-specks, .park-star { opacity: .25; }

/* ---------- Header ---------- */
.site-header { background: #0a1224cc; border-bottom-color: var(--line); backdrop-filter: blur(18px) saturate(140%); }
.site-title { font-family: var(--serif-en); font-style: italic; font-weight: 400; font-size: 1.2rem; letter-spacing: 0; color: var(--text); font-variation-settings: "opsz" 48; }
.site-title::after { content: "."; color: var(--accent); font-style: normal; }
.site-nav a { position: relative; font-size: .88rem; letter-spacing: .04em; color: var(--muted); border-radius: 0; transition: color .25s var(--ease); }
.site-nav a[aria-current='page'] { background: none; color: var(--text); }
@media (min-width: 48em) {
  .site-nav { gap: 6px; }
  .site-nav a[aria-current='page']::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
}
@media (hover: hover) { .site-nav a:hover { background: none; color: var(--text); } }

/* ---------- Page hero ---------- */
.page-hero { border-bottom-color: var(--line); padding-block: 40px 40px; margin-bottom: 8px; }
.page-hero h1 {
  font-family: var(--serif-en); font-weight: 300; font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(3rem, 8.5vw, 5.75rem); line-height: 1; letter-spacing: -.035em; color: var(--text);
}
.page-hero h1 > span { font-style: italic; color: var(--accent); }
.hero-copy > p { font-family: var(--serif); color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); letter-spacing: .06em; margin-top: 22px; }
.scene-stage { max-width: 470px; }
.park-character image { filter: saturate(.78) brightness(.94) contrast(1.02); }
.park-console-hint { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; color: var(--faint); }
.park-message { background: var(--surface-2); border-color: var(--line-strong); border-radius: 4px; box-shadow: 0 18px 40px #0006; }
.park-message-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; }
.park-message-link { font-family: var(--serif); color: var(--text); }

/* ---------- Small type ---------- */
.post-row time, .post-date, .tag-post-list time, .about-page .about-period, .project-meta, .tag-count, .projects-section-heading > span, .tag-section-header span {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--faint); font-variant-numeric: tabular-nums;
}
.kicker, .about-page .about-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.tag-link { font-family: var(--sans); font-size: .78rem; letter-spacing: .06em; color: var(--muted); min-height: 32px; }
.tag-link::before { content: ""; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: var(--teal); opacity: .7; }
@media (hover: hover) { .tag-link:hover { color: var(--text); text-decoration: none; } }

/* ---------- Notes list ---------- */
.post-list { margin-top: 0; }
.post-row { position: relative; gap: 6px; padding: 30px 0; border-bottom-color: var(--line); transition: background .3s var(--ease); }
.post-row .kicker { margin-bottom: 6px; }
.post-title { font-family: var(--serif); font-weight: 500; color: var(--text); font-size: clamp(1.15rem, 2.2vw, 1.42rem); line-height: 1.55; letter-spacing: .02em; transition: color .25s var(--ease); }
.post-title::after { content: "→"; display: inline-block; margin-left: .5em; font-family: var(--sans); color: var(--accent); opacity: 0; transform: translateX(-6px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.post-row p { font-size: .92rem; line-height: 1.85; color: var(--muted); max-width: 38em; }
.post-tags { gap: 0 18px; margin-top: 8px; }
@media (hover: hover) {
  .post-row:hover .post-title { color: var(--text); }
  .post-row:hover .post-title::after { opacity: 1; transform: none; }
}
@media (min-width: 48em) {
  .post-row { grid-template-columns: 132px minmax(0, 1fr); gap: 28px; padding-block: 34px; }
  .post-row time { padding-top: .55em; }
}
.park-picked-note { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); box-shadow: inset 2px 0 var(--accent); }

/* ---------- Pagination ---------- */
.pagination { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; padding-block: 40px 48px; }
.pagination a, .pagination-pages span { border-radius: 0; }
.pagination-pages [aria-current] { background: none; color: var(--accent); box-shadow: inset 0 -1px var(--accent); }
.pagination-disabled { color: var(--faint); }

/* ---------- Article ---------- */
.post { padding-block: 16px 40px; }
.back-link { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
.post-header, .post-header.page-hero { display: block; max-width: var(--read); margin: 24px auto 0; padding: 48px 0 40px; border-bottom: 0; text-align: left; }
.post-header .scene-stage, .post-header .park-scene { display: none !important; }
.post-header .kicker { margin-bottom: 18px; }
.post-header h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.35; letter-spacing: .01em; margin: 0 0 22px; }
.post-header .post-description { font-family: var(--serif); font-size: 1.1rem; color: var(--muted); }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.post-byline .post-date { margin: 0; }
.post-byline .post-tags { margin: 0; }
.post-body { max-width: var(--read); font-size: 1.05rem; line-height: 2; color: var(--text-soft); letter-spacing: .03em; }
.post-body > p:first-of-type { font-size: 1.14rem; color: var(--text); }
.post-body p { margin-bottom: 1.6em; }
.post-body h2 { font-size: 1.5rem; margin: 2.6em 0 .9em; }
.post-body h2::before { content: ""; display: block; width: 28px; height: 1px; margin-bottom: 20px; background: var(--accent); }
.post-body h3 { font-size: 1.18rem; margin: 2em 0 .6em; }
.post-body strong { color: var(--text); font-weight: 500; }
.post-body a, .plain-page a { color: var(--text); text-decoration: underline; text-decoration-color: #efc28366; text-underline-offset: .3em; transition: text-decoration-color .2s; }
.post-body a:hover, .plain-page a:hover { text-decoration-color: var(--accent); }
.post-body blockquote { margin: 2.2em 0; padding: 4px 0 4px 24px; border-left: 1px solid var(--accent); font-family: var(--serif); color: var(--text-soft); }
.post-body li::marker { color: var(--faint); font-family: var(--mono); font-size: .85em; }
.post-body hr { border: 0; text-align: center; margin: 3em 0; }
.post-body hr::after { content: "· · ·"; color: var(--faint); letter-spacing: .6em; }
.post-body img { border-radius: 4px; }
.post-body pre { background: var(--surface); border-color: var(--line); border-radius: 4px; font-family: var(--mono); }
.post-body :not(pre) > code { font-family: var(--mono); font-size: .88em; padding: .1em .4em; background: var(--surface-2); border-radius: 3px; }
.table-scroll { border-color: var(--line); border-radius: 4px; }
.post-body th { background: var(--surface); color: var(--text); font-weight: 500; }
.post-body :where(th, td) { border-bottom-color: var(--line); }
.post-end { font-size: 0; padding: 56px 0 40px; }
.post-end::after { content: "· · ·"; font-size: 1rem; color: var(--faint); letter-spacing: .6em; }
.subscribe-box { max-width: var(--read); padding: 28px 32px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.subscribe-title { font-family: var(--serif-en); font-style: italic; font-size: 1.25rem; color: var(--text); }

/* ---------- Projects & Playground ---------- */
.projects-section-heading { border-bottom-color: var(--line); margin-top: 32px; }
.projects-section-heading h2 { font-size: 1.15rem; letter-spacing: .06em; }
.project-cover { border-radius: 6px; box-shadow: 0 0 0 1px var(--line); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.project-body h3 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.project-body p { color: var(--muted); }
.project-action { border-bottom-color: #efc28355; letter-spacing: .04em; }
@media (hover: hover) {
  .project-card:hover .project-cover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--line-strong), 0 24px 48px -20px #000c; }
}
.playground-cover { background: linear-gradient(160deg, #13253a, #0e1a2c); }
.playground-cover-label { font-family: var(--mono); }
.playground-cover-title { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; }
.playground-cover-credit, .playground-credit { font-family: var(--mono); letter-spacing: .04em; }

/* ---------- Tags / About / Plain ---------- */
.tag-cloud .tag-link { border-bottom: 0; font-size: .86rem; }
.tag-section-header h2 { font-size: 1.3rem; }
.tag-post-list a { font-family: var(--serif); color: var(--text); }
.about-page h2 { font-size: 1.45rem; border-bottom-color: var(--line); }
.about-page .about-position { font-family: var(--serif); font-weight: 500; }
.about-strengths h3::before { font-family: var(--mono); }
.about-page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: 0; }
.about-experience { border-left-color: var(--line-strong); }
.plain-page h1 { font-family: var(--serif-en); font-weight: 300; }

/* ---------- Footer ---------- */
.site-footer { display: grid; gap: 14px; padding-block: 56px 48px; margin-top: 40px; border-top-color: var(--line); }
.footer-sign { font-family: var(--serif-en); font-style: italic; font-weight: 300; font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--text); letter-spacing: -.01em; line-height: 1.2; }
.footer-sign span { color: var(--accent); font-style: normal; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--faint); }
.footer-meta a { text-decoration: none; color: var(--muted); }
.footer-meta a:hover { color: var(--accent); }
@media (min-width: 48em) { .site-footer { grid-template-columns: 1fr auto; align-items: end; } }

/* ---------- Refinements ---------- */
.post-row .kicker, .post-header .kicker { display: flex; width: fit-content; margin: 0 0 8px; color: var(--accent); font-size: .68rem; line-height: 1.6; max-width: none; }
.post-header .kicker { margin-bottom: 18px; }
.nav-toggle { border-color: var(--line-strong); border-radius: 999px; font-size: .8rem; letter-spacing: .06em; }
.about-page .page-hero { margin-bottom: 48px; }
.pagination { padding-bottom: 8px; }
@media (max-width: 47.99em) { .post-row { padding-block: 26px; } }

/* ---------- Playground type: 地球是我的遊樂園 ----------
   Headings use Huninn (粉圓, single weight) for warmth and play; Fraunces runs
   with its SOFT and WONK axes so English display type feels rounded too.
   Quality comes from scale, spacing and restraint around them. */
:root {
  --serif: "Huninn", "jf open 粉圓", "Noto Sans TC", sans-serif;
  --round: var(--serif);
}
:where(h1, h2, h3), .post-title, .post-header h1, .project-body h3, .about-page h1, .about-page .about-position,
.playground-cover-title, .tag-post-list a, .park-message-link, .hero-copy > p, .post-header .post-description, .post-body blockquote {
  font-weight: 400;
}
.page-hero h1, .site-title, .footer-sign, .subscribe-title, .plain-page h1 { font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.page-hero h1 { font-weight: 350; }
.post-header h1 { letter-spacing: .02em; line-height: 1.4; }
.post-title { letter-spacing: .03em; }
.hero-copy > p { letter-spacing: .08em; }
.about-page h1 { letter-spacing: .02em; }
.post-body blockquote { font-family: var(--sans); }
