@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --color-bg: #f7f3ee;
  --color-bg-elev: #fbf8f3;
  --color-text: #0d0d0d;
  --color-text-strong: #000;
  --color-muted: #5a5247;
  --color-accent: #cc785c;
  --color-accent-soft: #f3e3d8;
  --color-border: #e3dccd;
  --color-nav-bg: rgba(247, 243, 238, 0.78);
  --color-bg-glow-1: rgba(204, 120, 92, 0.06);
  --color-bg-glow-2: rgba(204, 120, 92, 0.04);
  --nav-width: 1180px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", "Iowan Old Style", Georgia, serif;
  --bg: var(--color-bg);
  --surface: var(--color-bg-elev);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --border: var(--color-border);
  --accent: var(--color-accent);
  --accent-soft: var(--color-accent-soft);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-bg: #1a1814;
  --color-bg-elev: #221f1a;
  --color-text: #f0e8d8;
  --color-text-strong: #fff;
  --color-muted: #a39580;
  --color-accent: #e89072;
  --color-accent-soft: #3a2a22;
  --color-border: #3a342c;
  --color-nav-bg: rgba(26, 24, 20, 0.78);
  --color-bg-glow-1: rgba(232, 144, 114, 0.07);
  --color-bg-glow-2: rgba(232, 144, 114, 0.04);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-y: scroll; }

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(at 12% 8%, var(--color-bg-glow-1) 0, transparent 50%),
    radial-gradient(at 92% 4%, var(--color-bg-glow-2) 0, transparent 45%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(204, 120, 92, 0.35);
  transition: border-color 0.15s, color 0.15s;
}

a:hover { border-bottom-color: var(--color-accent); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  z-index: 100;
  background: var(--color-nav-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s ease;
}

.topnav-inner {
  width: min(100%, var(--nav-width));
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.nav-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 19px;
  color: var(--color-text-strong);
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
}

.nav-brand:hover { color: var(--color-accent); border: none; }

.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-links a {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  border-bottom: none;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--color-accent); border-bottom: none; }

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
  transition: background 0.2s, transform 0.4s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: rotate(15deg);
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.page-shell {
  width: min(100% - 40px, 860px);
  margin: 0 auto;
  padding: 126px 0 72px;
}

.blog-intro {
  padding-bottom: 34px;
  border-bottom: 2px solid var(--color-border);
}

.blog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--font-serif), "Noto Serif CJK SC", "Songti SC", serif;
}

h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.blog-heading h1 {
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.post-list { border: 0; }

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 30px 2px;
  border-bottom: 1px solid var(--color-border);
}

.post-card h2 {
  margin: 0;
  color: var(--color-text-strong);
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.post-card-link {
  color: var(--color-text-strong);
  text-decoration: none;
  border-bottom: none;
}

.post-card-link:hover { color: var(--color-text-strong); border-bottom: none; }

.post-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card:hover h2 { color: var(--color-text-strong); }

.post-summary {
  min-height: 1.7em;
  margin: 9px 0 10px;
  color: var(--color-muted);
  font-family: var(--font-serif), "Noto Serif CJK SC", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.7;
}

.post-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.language-tag,
.type-tag {
  display: inline;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.article-shell {
  width: min(100% - 40px, 740px);
  margin: 0 auto;
  padding: 120px 0 84px;
}

.back-link {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.back-link:hover,
.back-link:focus-visible { color: var(--accent); }
.article-footer .back-link { margin-bottom: 0; color: var(--muted); }
.article-footer .back-link:hover,
.article-footer .back-link:focus-visible { color: var(--accent); }

.article-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.article-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.article-title-row h1 { min-width: 0; }

.article-header h1 {
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.article-header .article-meta { margin-top: 18px; }

.share-control {
  position: relative;
  flex: 0 0 auto;
}

.share-trigger {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.share-trigger:hover {
  transform: scale(1.08);
}

.share-trigger svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  width: 144px;
  padding: 6px;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(40, 31, 23, 0.12);
}

:root[data-theme="dark"] .share-menu {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.share-menu[hidden] { display: none; }

.share-menu-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: 500 14px/1.25 var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.share-menu-item:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom: 0;
}

.share-menu-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-icon {
  fill: currentColor;
  stroke: none;
}

.share-menu-item .brand-icon {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
  fill: currentColor;
  stroke: none;
}

.share-menu-item .brand-icon-x { color: #000; }
:root[data-theme="dark"] .share-menu-item .brand-icon-x { color: #fff; }
.share-menu-item .brand-icon-linkedin { color: #0a66c2; }
.share-menu-item .brand-icon-linkedin .linkedin-lettering { fill: #fff; }

.article-platform-share {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.article-share-label {
  margin-right: 8px;
  color: var(--muted);
  font: 500 14px/1 var(--font-sans);
  letter-spacing: 0.01em;
}

.article-like { margin-right: auto; position: relative; }
.article-like[hidden] { display: none; }
.article-like-top { margin-top: 14px; }
.article-body figure { margin: 36px 0; }
.article-body > figure:first-child { margin-top: -14px; }
.article-body figure img { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.article-body figcaption,
.article-body .source-caption { margin-top: 10px; color: var(--muted); font: 400 13px/1.8 var(--font-sans); text-align: center; }
.article-body blockquote { margin: 24px 0; padding-left: 20px; border-left: 2px solid var(--color-border); }
.article-body .opening-quote {
  margin: 32px 0;
  padding: 14px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted);
}
.article-body .opening-quote p { margin: 0; }
.article-body .opening-quote p + p { margin-top: 12px; }
.article-body .article-opening-image { border: 0; }
.post-like-count { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--muted); position: relative; z-index: 1; cursor: default; }
.post-like-count[hidden] { display: none; }
.post-like-count svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.like-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 14px/1 var(--font-sans);
  cursor: pointer;
}
.like-button svg {
  width: 24px; height: 24px;
  fill: transparent; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.2s, fill 0.2s;
}
.like-button:hover svg { transform: scale(1.1); }
.like-button[aria-pressed="true"] { color: var(--accent); }
.like-button[aria-pressed="true"] svg { fill: currentColor; }
.like-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.like-button:disabled { cursor: wait; }
.like-status { position: absolute; left: 0; top: 100%; width: 230px; color: var(--muted); font: 400 12px/1.5 var(--font-sans); }
@media (prefers-reduced-motion: reduce) { .like-button svg { transition: none; } }

.article-platform-share a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  transition: transform 0.2s;
}

.article-platform-share a:hover {
  border: 0;
  background: transparent;
  transform: translateY(-1px) scale(1.06);
}

.article-platform-share .brand-icon {
  width: 25px;
  height: 25px;
}

.article-platform-share .brand-icon-x { color: #000; }
:root[data-theme="dark"] .article-platform-share .brand-icon-x { color: #fff; }
.article-platform-share .brand-icon-linkedin { color: #0a66c2; }
.article-platform-share .brand-icon-linkedin .linkedin-lettering { fill: #fff; }

.article-body {
  padding-top: 38px;
  font-family: var(--font-serif), "Noto Serif CJK SC", "Songti SC", serif;
  font-size: clamp(18px, 2.5vw, 20px);
  line-height: 1.95;
  letter-spacing: 0.015em;
}

.article-body p { margin: 0 0 1.5em; }
.article-body strong,
.article-body b {
  font-weight: 800;
  color: var(--color-text-strong);
  -webkit-text-stroke: 0.2px currentColor;
}

.article-body h2 {
  margin: 2.8em 0 1em;
  color: var(--accent);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.article-footer,
.site-footer {
  color: var(--muted);
}

.article-footer {
  margin-top: 58px;
  padding-top: 24px;
  border: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
}

.article-footer a,
.site-footer a { color: var(--accent); }

.site-footer {
  margin-top: 76px;
  padding-top: 22px;
  border: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 640px) {
  .topnav-inner { padding: 0 14px; gap: 10px; }
  .topnav .nav-brand { font-size: 15px; }
  .topnav .nav-links { gap: 11px; }
  .topnav .nav-links a { font-size: 13.5px; }
  .topnav .theme-toggle { width: 34px; height: 34px; font-size: 15px; }
  .theme-toggle { width: 30px; height: 30px; font-size: 13px; }
  .page-shell { padding-top: 112px; }
  .post-card { gap: 14px; }
  .article-shell { padding-top: 108px; }
  .back-link { margin-bottom: 34px; }
  .article-title-row { gap: 16px; }
  .article-footer,
  .site-footer { flex-direction: column; }
}

@media (max-width: 500px) {
  .topnav .nav-brand { display: none; }
  .topnav-inner { justify-content: space-between; }
  .topnav .nav-links { gap: 12px; }
}

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