/* Shared public-page refinements. Content and page routes stay in their source files. */
:root {
  color-scheme: dark;
  --bg: #101011;
  --card-bg: #1a1a1c;
  --text: #f2f2f4;
  --text-muted: #b0b0b6;
  --accent: #f0a45d;
  --accent-glow: rgba(240, 164, 93, .10);
  --border: #323236;
}
html { scroll-padding-top: 5.5rem; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}
body, button, a { -webkit-tap-highlight-color: transparent; }
* { letter-spacing: 0; }
::selection { background: #704320; color: #fff; }
a, button { touch-action: manipulation; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
nav {
  height: 4rem;
  padding-inline: max(1.5rem, calc((100% - 1080px) / 2));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(16, 16, 17, .9);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  border-bottom-color: rgba(255, 255, 255, .07);
}
.logo { color: var(--accent); font-size: 1rem; font-weight: 650; letter-spacing: 0; }
.nav-links { gap: .5rem; }
.nav-links a, .back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem .75rem;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: .875rem;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}
.hero { padding: 7.5rem 1.5rem 2.25rem; }
.hero::before { display: none; }
.hero h1, .page-header h1 {
  font-size: 2.75rem;
  line-height: 1.25;
  font-weight: 700;
  background: none;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
  text-wrap: balance;
}
.hero p { font-size: 1.0625rem; margin-top: .875rem; }
.container { width: 100%; max-width: 1128px; padding: 1.5rem 1.5rem 4rem; }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; align-items: stretch; }
.card {
  min-width: 0;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, .07);
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease-out, border-color 180ms ease-out, background-color 180ms ease-out;
}
.card-img { aspect-ratio: 4 / 3; flex-shrink: 0; background: #202023; }
.card-img img { display: block; }
.card-body { padding: 1.375rem 1.5rem 1.5rem; }
.card-body h3 { font-size: 1.125rem; line-height: 1.5; font-weight: 650; margin-bottom: .5rem; overflow-wrap: anywhere; }
.card-body p { font-size: .9375rem; line-height: 1.75; }
.card:active { transform: scale(.99); transition-duration: 80ms; }
section { max-width: 1000px; padding: 4rem 1.5rem; }
.section-title { color: var(--accent); font-size: 1.75rem; line-height: 1.4; margin-bottom: 2rem; }
.section-title::after { display: none; }
.about-content { gap: 2.5rem; }
.about-avatar { width: 112px; height: 112px; background: #202023; }
.about-text { min-width: 0; flex-basis: 300px; }
.about-text h3 { font-size: 1.25rem; }
.about-text p { font-size: 1rem; line-height: 1.9; }
.contact-links { gap: .75rem; }
.contact-btn, .back-bottom {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border-color: var(--border);
  border-radius: 6px;
  transition: background-color 140ms ease-out, transform 140ms ease-out;
}
.contact-btn:active, .back-bottom:active { transform: scale(.97); transition-duration: 80ms; }
.email-popup { max-width: calc(100vw - 2rem); border-radius: 8px !important; }
.email-popup button { min-height: 36px; }
.page-header { padding: 3.5rem 1.5rem 1.5rem; }
.page-header h1 { font-size: 2.25rem; }
body:has(.page-header) .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body:has(.page-header) .card-body h3 { font-size: 1.0625rem; }
body:has(.page-header) .card-body p { font-size: .9375rem; }
.article { max-width: 808px; padding: 3.5rem 1.75rem 4rem; }
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 2.25rem; line-height: 1.4; text-wrap: balance; overflow-wrap: anywhere; }
.article-body { color: #cdccd1; font-size: 1.0625rem; line-height: 1.95; overflow-wrap: anywhere; }
.article-body p { margin-bottom: 1.375rem; }
.article-body h2 { color: var(--accent); font-size: 1.5rem; line-height: 1.5; margin: 2.75rem 0 1rem; }
.article-body h3 { font-size: 1.1875rem; line-height: 1.55; margin: 2rem 0 .75rem; }
.article-body a { color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
.cover { background: #202023; border-radius: 8px; margin-bottom: 2.5rem; }
.article-body img { max-width: 100%; }
.article-body pre { overflow-x: auto; padding: 1rem; background: #1a1a1c; border-radius: 6px; }
.article-body code { font-size: .875em; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.article-body th, .article-body td { padding: .65rem .85rem; border: 1px solid var(--border); text-align: left; }
footer { font-size: .8125rem; line-height: 1.8; padding: 2rem 1.25rem max(2rem, env(safe-area-inset-bottom)); }
footer > span { row-gap: .75rem !important; }
footer a { display: inline-flex; align-items: center; min-height: 32px; }
footer a[href*="beian.mps"] { top: 0 !important; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-2px); border-color: var(--accent); }
  .card:hover .card-body h3 { color: var(--accent); }
  .nav-links a:hover, .back:hover { background: var(--accent-glow); color: var(--accent); }
  .contact-btn:hover, .back-bottom:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
}
@media (max-width: 700px) {
  nav { padding-inline: 1rem; gap: .5rem; }
  .logo { font-size: .9375rem; }
  .nav-links { gap: 0; }
  .nav-links a, .back { padding-inline: .5rem; }
  .hero { padding: 6.25rem 1.25rem 1.25rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: .9375rem; }
  .container { padding: 1.25rem 1rem 2.5rem; }
  .grid, body:has(.page-header) .grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .card-body { padding: 1.125rem 1.25rem 1.25rem; }
  section { padding: 2.75rem 1.25rem; }
  .about-content { gap: 1.5rem; }
  .about-avatar { width: 88px; height: 88px; }
  .about-text { flex-basis: 100%; text-align: center; }
  .article { padding: 2.25rem 1.25rem 3rem; }
  .article-header h1 { font-size: 1.75rem; }
  .article-body { font-size: 1rem; }
  .page-header { padding-top: 2.5rem; }
  .page-header h1 { font-size: 1.875rem; }
  .email-popup { position: fixed !important; left: 50% !important; bottom: max(1.25rem, env(safe-area-inset-bottom)) !important; }
  footer > span > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .card:active, .contact-btn:active, .back-bottom:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --text-muted: #dedee2; --border: #85858a; }
  nav { background: var(--bg); border-bottom-color: var(--border); }
  .card { border-color: var(--border); }
}
