/* JXPX — editorial soft-content hub
   System fonts only. Cool slate + ink teal. */

:root {
  --bg: #e9eef2;
  --bg-elevated: #f7f9fb;
  --ink: #10161c;
  --ink-soft: #3d4a57;
  --muted: #6b7885;
  --line: rgba(16, 22, 28, 0.1);
  --accent: #0f5c56;
  --accent-bright: #148078;
  --warm: #c46b2a;
  --hero-deep: #0a2e2b;
  --hero-mid: #0f4a45;
  --radius: 0;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 1120px;
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 24px 60px rgba(10, 46, 43, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(20, 128, 120, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 107, 42, 0.06), transparent 50%),
    linear-gradient(180deg, #eef3f6 0%, var(--bg) 40%, #e4eaef 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.25s var(--ease);
}

a:hover {
  color: var(--warm);
}

a:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(233, 238, 242, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand-tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2em;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f3f7f6;
  background:
    linear-gradient(115deg, rgba(10, 46, 43, 0.94) 0%, rgba(15, 74, 69, 0.78) 48%, rgba(10, 46, 43, 0.55) 100%),
    radial-gradient(circle at 78% 35%, rgba(196, 107, 42, 0.35), transparent 42%),
    radial-gradient(circle at 20% 80%, rgba(20, 128, 120, 0.4), transparent 45%),
    linear-gradient(160deg, var(--hero-deep), var(--hero-mid));
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
  animation: grid-drift 28s linear infinite;
}

.hero::after {
  content: "";
  position: absolute;
  width: min(52vw, 520px);
  aspect-ratio: 1;
  right: -8%;
  top: 8%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
  animation: orbit-pulse 8s var(--ease) infinite;
}

@keyframes grid-drift {
  from { transform: translateY(0); }
  to { transform: translateY(64px); }
}

@keyframes orbit-pulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 0.9; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 8rem) var(--space) clamp(3rem, 8vh, 5rem);
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 0.92;
  margin: 0 0 1.25rem;
  opacity: 0;
  animation: rise-in 0.9s var(--ease) 0.1s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 400;
  line-height: 1.35;
  max-width: 18em;
  margin: 0 0 0.85rem;
  opacity: 0;
  animation: rise-in 0.9s var(--ease) 0.25s forwards;
}

.hero-lead {
  margin: 0 0 2rem;
  max-width: 32em;
  color: rgba(243, 247, 246, 0.78);
  font-size: 1.05rem;
  opacity: 0;
  animation: rise-in 0.9s var(--ease) 0.4s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  opacity: 0;
  animation: rise-in 0.9s var(--ease) 0.55s forwards;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: #f3f7f6;
  color: var(--hero-deep);
  text-decoration: none;
}

.btn-primary:hover {
  background: #fff;
  color: var(--hero-deep);
}

.btn-ghost {
  background: transparent;
  color: #f3f7f6;
  border-color: rgba(243, 247, 246, 0.35);
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: #f3f7f6;
  color: #fff;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* —— Layout —— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space);
}

.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  max-width: 28em;
  font-size: 0.95rem;
}

/* —— Filters —— */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.2rem 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* —— Article stream (not card grid) —— */
.stream {
  display: flex;
  flex-direction: column;
}

.stream-item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.6fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.stream-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stream-item:hover .stream-title {
  color: var(--accent);
}

.stream-item:hover .stream-visual {
  transform: scale(1.02);
}

.stream-item.is-hidden {
  display: none;
}

.stream-visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--hero-deep);
  transition: transform 0.6s var(--ease);
}

.stream-visual-inner {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(15, 92, 86, 0.85), rgba(10, 46, 43, 0.5)),
    repeating-linear-gradient(
      -28deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.04) 10px,
      rgba(255, 255, 255, 0.04) 11px
    );
}

.stream-item:nth-child(2) .stream-visual-inner {
  background:
    linear-gradient(145deg, rgba(196, 107, 42, 0.55), rgba(15, 74, 69, 0.75)),
    repeating-linear-gradient(
      35deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.04) 12px,
      rgba(255, 255, 255, 0.04) 13px
    );
}

.stream-item:nth-child(3) .stream-visual-inner {
  background:
    linear-gradient(160deg, rgba(16, 22, 28, 0.75), rgba(20, 128, 120, 0.65)),
    radial-gradient(circle at 70% 30%, rgba(243, 247, 246, 0.15), transparent 50%);
}

.stream-item:nth-child(4) .stream-visual-inner {
  background:
    linear-gradient(120deg, rgba(15, 92, 86, 0.7), rgba(61, 74, 87, 0.8)),
    linear-gradient(0deg, transparent 60%, rgba(196, 107, 42, 0.25));
}

.stream-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.stream-cat {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.stream-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.65rem;
  transition: color 0.3s var(--ease);
}

.stream-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 38em;
}

.stream-read {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--accent);
}

/* —— Topics band —— */
.topics {
  background: var(--ink);
  color: #e8eef2;
  margin: 0;
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.topics .section-eyebrow {
  color: rgba(20, 128, 120, 0.95);
}

.topics .section-title {
  color: #f3f7f6;
}

.topics .section-head {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
}

.topic-list a {
  display: block;
  padding: 1.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: #f3f7f6;
  font-family: var(--font-display);
  font-size: 1.25rem;
  transition: padding-left 0.35s var(--ease), color 0.25s var(--ease);
}

.topic-list a:hover {
  padding-left: 0.75rem;
  color: #7dd3c8;
}

.topic-list span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(232, 238, 242, 0.55);
}

/* —— About strip —— */
.about-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.about-strip h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0;
  line-height: 1.25;
}

.about-strip p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.about-strip p:last-child {
  margin-bottom: 0;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* —— Article page —— */
.article-hero {
  padding: clamp(4rem, 10vh, 6.5rem) 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.article-hero .wrap {
  max-width: 720px;
}

.crumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--accent);
}

.article-cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.article-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  font-weight: 600;
}

.article-lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.75rem var(--space) 4rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 2.4rem 0 0.85rem;
  line-height: 1.35;
}

.article-body p {
  margin: 0 0 1.15rem;
  color: var(--ink-soft);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.5;
}

.article-body blockquote p {
  color: var(--ink);
  margin: 0;
}

.article-body figure {
  margin: 1.75rem 0;
}

.article-body figure img {
  width: 100%;
  height: auto;
  display: block;
  background: rgba(16, 22, 28, 0.04);
}

.article-body figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.article-body figure {
  margin: 1.75rem 0;
}

.article-body figure img {
  width: 100%;
  height: auto;
  display: block;
  background: rgba(16, 22, 28, 0.04);
}

.article-body figcaption {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.article-cta {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.article-cta p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.related {
  background: rgba(16, 22, 28, 0.03);
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.related-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.related-list a {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.related-list a:hover {
  color: var(--accent);
}

.related-list span {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--muted);
}

/* —— 404 —— */
.page-empty {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space);
}

.page-empty h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
}

.page-empty p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* —— Reveal utility —— */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Responsive —— */
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--space) 1rem;
    background: rgba(247, 249, 251, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav a::after {
    display: none;
  }

  .stream-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about-strip {
    grid-template-columns: 1fr;
  }

  .hero::after {
    width: 70vw;
    top: -5%;
    right: -20%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-brand,
  .hero-title,
  .hero-lead,
  .hero-actions,
  .stream-item,
  .reveal {
    opacity: 1;
    transform: none;
  }
}
