/* The restrained Dylan Arc reading theme. Keep styles.css as the base. */
@font-face {
  font-family: "Instrument Sans";
  src: url("./assets/fonts/instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("./assets/fonts/newsreader.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Solstice Serif SC";
  src: url("./assets/fonts/noto-serif-sc.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070910;
  --bg-elev: #0e111a;
  --ink: #f6f7fa;
  --ink-soft: #c6cad4;
  --muted: #a4aab9;
  --rule: #343945;
  --rule-soft: #242936;
  --seal: #f6f7fa;
  --accent: #f6f7fa;
  --sans: "Instrument Sans", "PingFang SC", "PingFang TC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Newsreader", "Solstice Serif SC", "Songti SC", "STSong", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --base-size: 17px;
  --gutter: clamp(24px, 5vw, 56px);
  --tracking-hd: 0.01em;
  --tracking-cap: 0.015em;
  --row-gap: 26px;
}

html { scroll-padding-top: 110px; }
body { font-family: var(--sans); font-optical-sizing: auto; font-synthesis: none; transition: none; }
body::before { display: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a:hover { color: #fff; }
::selection { background: #74434c; color: #fff; }
:focus-visible {
  outline: 2px solid #f6f7fa;
  outline-offset: 5px;
}

.blog-view { position: relative; isolation: isolate; min-height: 100vh; }
.blog-view::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 820px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 9, 16, 0.38), rgba(7, 9, 16, 0.6) 42%, #070910 94%), url("./arc/night-grain.webp") center top / cover no-repeat;
}
.view-article::before {
  height: 340px;
  opacity: 0.25;
  background-position: center, center 48%;
}
.view-archive::before,
.view-about::before { height: 480px; opacity: 0.4; }
.shell { max-width: 1040px; }

.topbar {
  background: rgba(7, 9, 16, 0.82);
  border-bottom-color: rgba(164, 170, 185, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar-inner {
  max-width: 1280px;
  padding: 22px var(--gutter);
  gap: 24px;
}
.brand {
  align-items: center;
  gap: 11px;
  background: none;
  padding: 0;
  border: 0;
  color: #fff;
  text-align: left;
  flex-shrink: 0;
}
.brand-mark { font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: 0.06em; }
.brand-sub { font-size: 12px; letter-spacing: 0.015em; margin-left: 3px; text-transform: none; }
.nav { margin-left: auto; align-items: center; gap: 22px; font-size: 14px; font-weight: 400; }
.nav button { white-space: nowrap; }
.nav button:hover,
.nav button.active { color: #fff; }
.locale-toggle { border: 0; padding: 0; gap: 3px; }
.locale-toggle button { padding: 5px 2px; }
.locale-toggle button.on { color: #fff; font-weight: 400; }
.portal-link { color: var(--ink-soft); white-space: nowrap; font-size: 13px; letter-spacing: 0.01em; }
.portal-link:hover { text-decoration: underline; text-underline-offset: 5px; }

.hero { padding: 132px 0 94px; border-bottom: none; }
.hero-eyebrow { color: var(--ink-soft); margin-bottom: 26px; font-size: 13px; }
.hero-title { font-family: var(--serif); font-size: clamp(44px, 5.1vw, 64px); letter-spacing: 0.025em; font-weight: 400; margin-bottom: 28px; }
.hero-lead { font-family: var(--serif); font-size: 25px; font-weight: 400; margin-bottom: 14px; }
.hero-sub { color: var(--ink-soft); font-size: 17px; line-height: 1.9; max-width: 33em; margin-bottom: 30px; }
.hero-meta { font-size: 12px; color: var(--muted); }
.cat-strip { margin: 0 0 54px; padding: 17px 0; border-color: var(--rule); gap: 7px 20px; }
.cat-chip { border: 0; padding: 4px 0; margin: 0; color: var(--muted); }
.cat-chip.active { font-weight: 400; }
.cat-chip.active::after { content: ""; display: block; height: 1px; background: currentColor; margin-top: 4px; }
.cat-chip .count { color: var(--muted); font-size: 11px; vertical-align: baseline; margin-left: 7px; }
.section-head { margin: 52px 0 18px; gap: 16px; }
.section-title { font-size: 13px; }
.section-aside { font-size: 12px; text-align: right; }
.pinned { gap: 30px; padding: 30px 0 38px; }
.pin-date .y { opacity: 1; margin-bottom: 5px; }
.pin-cat { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.pin-title { font-family: var(--serif); font-size: 30px; line-height: 1.6; letter-spacing: 0.01em; margin-bottom: 16px; font-weight: 400; }
.pin-excerpt { color: var(--ink-soft); line-height: 1.9; font-size: 16px; }
.article-row { gap: 30px; transition: none; }
.article-row:hover { padding-left: 0; }
.pinned:hover .pin-title,
.article-row:hover .row-title { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.row-title { font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: 0.01em; line-height: 1.7; overflow-wrap: anywhere; }
.row-cat { font-size: 12px; letter-spacing: 0.015em; margin-bottom: 6px; }
.row-date, .row-read { font-size: 12px; font-variant-numeric: tabular-nums; }
.list-more { font-size: 13px; letter-spacing: 0.015em; }

.article { max-width: 680px; padding-top: 88px; }
.article-eyebrow { color: var(--muted); margin-bottom: 24px; }
.article-title { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 44px); line-height: 1.6; letter-spacing: 0.015em; font-weight: 400; overflow-wrap: anywhere; }
.article-meta { flex-wrap: wrap; gap: 10px 20px; padding-bottom: 32px; margin-bottom: 48px; }
.prose { font-family: var(--serif); font-weight: 400; letter-spacing: 0.012em; color: #e1e4eb; font-size: 18px; line-height: 1.95; overflow-wrap: anywhere; }
.prose p.lead { color: var(--ink-soft); font-size: 19px; }
.prose h2 { font-family: var(--serif); padding-left: 0; font-size: 26px; font-weight: 500; line-height: 1.7; }
.prose h2::before { display: none; }
.prose h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.7; }
.prose ul li::before { color: var(--muted); }
.prose blockquote { border-left-color: var(--rule); color: var(--ink-soft); font-style: normal; }
.prose a { color: var(--ink); border-bottom-color: var(--muted); }
.prose a:hover { border-bottom-color: #fff; }
.prose code { background: #151a26; padding: 2px 6px; }
.prose pre { max-width: 100%; overflow-x: auto; background: #10141e; padding: 20px; }
.prose pre code { padding: 0; background: none; overflow-wrap: normal; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.prose td, .prose th { padding: 10px 14px; border: 1px solid var(--rule); }
.prose iframe, .prose video { max-width: 100%; }
.prose hr { border-top: 1px solid var(--rule); }
.prose hr::after { content: none; }
.prose img { border-radius: 0; }
.art-figure { background: var(--bg-elev); border-style: solid; }
.article-foot { margin-top: 80px; }
.article-nav { gap: 32px; }
.article-nav .nav-title { font-size: 18px; font-weight: 400; line-height: 1.7; }
.article-nav a { cursor: pointer; }
.toc { right: max(24px, calc((100vw - 1040px) / 2 - 176px)); width: 168px; top: 132px; font-size: 12px; max-height: calc(100vh - 160px); overflow-y: auto; }
.toc a { padding: 5px 0; overflow-wrap: anywhere; }
.progress { background: #c7cddd; }

.about { max-width: 840px; padding: 88px var(--gutter) 0; }
.about-title, .archive-title { font-family: var(--serif); font-weight: 400; letter-spacing: 0.015em; }
.about-prose { font-family: var(--serif); font-weight: 400; letter-spacing: 0.01em; color: #e1e4eb; line-height: 1.95; }
.about-prose p.lead { font-size: 23px; }
.about-list { margin-top: 40px; }
.about-list li { gap: 28px; }
.about-list a { text-decoration: underline; text-underline-offset: 5px; }
.wechat-card { background: none; border: 0; border-top: 1px solid var(--rule); margin-top: 64px; }
.wechat-card::before,
.wechat-text .wc-eyebrow::before,
.wc-meta span::before,
.qr-frame::before,
.qr-frame::after,
.qr-frame > .c1,
.qr-frame > .c2 { display: none; }
.wechat-inner { gap: 44px; padding: 36px 0; }
.wechat-text .wc-eyebrow { color: var(--muted); }
.wechat-text h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.6; }
.wc-meta a { text-decoration: underline; text-underline-offset: 5px; }
.qr-frame { border: 0; background: #fff; padding: 12px; }
[data-theme="dark"] .qr-frame { background: #fff; }
.qr-caption { letter-spacing: 0.04em; }
.archive-head { padding-top: 88px; padding-bottom: 38px; }
.year-tabs { margin-top: 20px; }
.year-tab { border-right: 0; margin-right: 20px; padding-right: 0; }
.year-tab.active { font-weight: 400; }
.year-tab.active .yt-count { color: var(--muted); }
.year-num { font-family: var(--serif); font-size: 48px; font-weight: 400; }
.year-meta { letter-spacing: 0.04em; }

.search-overlay { background: rgba(7, 9, 16, 0.86); padding: 12vh 24px 24px; overflow-y: auto; backdrop-filter: blur(16px); }
.search-box { background: #0c0f18; width: min(680px, 100%); padding: 28px 32px; border-color: var(--rule); }
.search-input { font-family: var(--sans); font-size: 22px; border-bottom-color: var(--muted); border-radius: 0; }
.search-input:focus-visible { outline-offset: 7px; }
.search-results { max-height: 52vh; }
.search-result { display: block; padding: 18px 0; }
.sr-cat { letter-spacing: 0.04em; }
.sr-title { font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.7; overflow-wrap: anywhere; }
.empty { font-style: normal; }
.en-loading { background: #f6f7fa; color: #070910; }
.footer { max-width: 928px; margin-top: 112px; padding: 32px 0 44px; letter-spacing: 0.02em; }
.footer .links button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.footer .links button:hover { color: #fff; }

.hero-eyebrow, .section-title, .pin-cat, .row-cat, .article-eyebrow,
.toc-label, .about-list .k, .wc-eyebrow, .sr-cat, .year-meta {
  text-transform: none;
  letter-spacing: 0.015em;
  font-weight: 400;
}
.article-foot > div { text-transform: none !important; letter-spacing: 0.015em !important; font-size: 13px !important; }
.about-list .k, .wc-meta, .qr-caption, .sr-cat { font-size: 12px; }

@media (max-width: 1020px) {
  .brand-sub { display: none; }
  .topbar-inner { gap: 20px; }
  .nav { gap: 18px; }
  .footer { margin-right: var(--gutter); margin-left: var(--gutter); }
}

@media (max-width: 720px) {
  :root { --gutter: 24px; }
  html { scroll-padding-top: 140px; }
  .blog-view::before { height: 730px; background-position: center, 47% top; }
  .view-article::before { height: 300px; }
  .topbar-inner { gap: 20px 12px; padding: 20px var(--gutter) 15px; }
  .brand-mark { font-size: 19px; letter-spacing: 0.045em; }
  .portal-link { margin-left: auto; font-size: 12px; }
  .nav { order: 3; flex: 1 1 100%; margin: 0; padding-top: 0; gap: 22px; flex-wrap: wrap; overflow: visible; font-size: 13px; }
  .locale-toggle { margin-left: auto; padding: 0 !important; }
  .hero { padding: 94px 0 74px; }
  .hero-eyebrow { font-size: 12px; line-height: 1.8; margin-bottom: 24px; }
  .hero-title { font-size: 44px; margin-bottom: 26px; }
  .hero-lead { font-size: 24px; line-height: 1.7; }
  .hero-sub { font-size: 16px; line-height: 1.95; margin-top: 12px; }
  .hero-meta { font-size: 11px; }
  .cat-strip { margin: 0 0 36px; padding: 16px 0; flex-wrap: wrap; overflow: visible; gap: 10px 20px; }
  .cat-chip { padding: 4px 0; margin: 0; font-size: 12px; }
  .section-head { margin-top: 40px; align-items: flex-start; }
  .section-title, .section-aside { font-size: 12px; }
  .pinned { gap: 14px; padding-top: 24px; }
  .pin-date .y { margin-bottom: 0; }
  .pin-title { font-size: 24px; }
  .pin-excerpt { font-size: 15px; }
  .article-row { gap: 8px 12px; padding: 22px 0; }
  .row-title { font-size: 19px; line-height: 1.7; }
  .row-cat { margin-bottom: 5px; }
  .article { padding-top: 56px; }
  .article-title { font-size: 30px; line-height: 1.5; }
  .article-meta { font-size: 11px; line-height: 1.8; gap: 6px 16px; margin-bottom: 36px; }
  .prose { font-size: 18px; line-height: 1.9; }
  .prose p.lead { font-size: 18px; }
  .prose h2 { padding-left: 0; font-size: 23px; }
  .prose h3 { font-size: 20px; }
  .prose blockquote { font-size: 17px; }
  .article-nav { gap: 8px; }
  .about { padding: 56px var(--gutter) 0; }
  .about-title { font-size: 36px; }
  .about-prose { font-size: 18px; }
  .about-prose p.lead { font-size: 23px; }
  .about-list li { gap: 6px; overflow-wrap: anywhere; }
  .wechat-inner { padding: 32px 0; gap: 28px; text-align: left; }
  .wechat-text .wc-eyebrow, .wc-meta { justify-content: flex-start; }
  .wechat-text p { margin-left: 0; }
  .qr-wrap { align-items: flex-start; }
  .qr-caption { width: 156px; }
  .archive-head { padding-top: 56px; }
  .year-tabs { gap: 2px 18px; }
  .year-tab { margin-right: 0; }
  .year-head { gap: 18px; }
  .year-num { font-size: 36px; }
  .year-meta { text-align: right; }
  .search-overlay { padding: 7vh 20px 20px; }
  .search-box { padding: 24px 20px; }
  .search-input { font-size: 18px; }
  .footer { margin-top: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
