/* ================================================
   先到 / Arrived First — Warm Technical Zine
   Claude palette: cream + terracotta
   ================================================ */

:root {
  --cream:      #F4F3EE;
  --paper:      #FFFFFF;
  --sand:       #FAF9F5;
  --clay:       #EFEDEA;
  --mud:        #E5E2DC;

  --ink:        #1A1918;
  --stone:      #7A7672;
  --mist:       #A8A49F;
  --ghost:      #C8C4BF;

  --terra:      #C15F3C;
  --terra-hot:  #D4704F;
  --terra-wash: rgba(193,95,60,0.10);
  --terra-mist: rgba(193,95,60,0.05);

  --serif:  'Playfair Display', Georgia, 'Noto Serif SC', serif;
  --sans:   'DM Sans', -apple-system, 'PingFang SC', 'Noto Sans SC', sans-serif;
  --mono:   'JetBrains Mono', 'Fira Code', monospace;

  --wide: 980px;
  --narrow: 660px;
  --r: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
::selection { background: rgba(193,95,60,0.18); color: var(--ink) }
html { font-size: 16px; scroll-behavior: smooth }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

a { color: var(--terra); text-decoration: none; transition: color 0.25s ease }
a:hover { color: var(--terra-hot) }
img { display: block; max-width: 100% }

.page { max-width: var(--wide); margin: 0 auto; padding: 0 32px }
.prose { max-width: var(--narrow); margin: 0 auto }

/* ---- Reveal Animation ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px) }
  to   { opacity: 1; transform: translateY(0) }
}
.reveal {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) forwards;
}
.reveal-d1 { animation-delay: 0.08s }
.reveal-d2 { animation-delay: 0.16s }
.reveal-d3 { animation-delay: 0.24s }
.reveal-d4 { animation-delay: 0.32s }
.reveal-d5 { animation-delay: 0.40s }
.reveal-d6 { animation-delay: 0.48s }
.reveal-d7 { animation-delay: 0.56s }

/* ==================== NAV ==================== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1.5px solid var(--mud);
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.brand:hover .brand-logo {
  border-color: var(--terra);
  transform: rotate(-4deg) scale(1.05);
}
.brand-name { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em }
.brand-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--terra) }
.brand-sub { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 0.92rem; color: var(--stone) }
.nav-links { display: flex; align-items: center; gap: 2px }
.nav-link {
  font-size: 0.8rem; color: var(--stone); padding: 6px 16px;
  border-radius: 100px; transition: all 0.25s ease; letter-spacing: 0.01em; position: relative;
}
.nav-link:hover { color: var(--ink); background: var(--terra-mist) }
.nav-link.active { color: var(--terra); font-weight: 500 }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--terra);
}
.nav-rss {
  font-family: var(--mono); font-size: 0.68rem; color: var(--terra);
  padding: 5px 14px; border: 1.5px solid var(--terra); border-radius: 100px;
  margin-left: 8px; transition: all 0.25s ease; letter-spacing: 0.03em;
}
.nav-rss:hover { background: var(--terra); color: var(--paper) }
.nav::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--terra) 0%, var(--mud) 30%, var(--mud) 70%, var(--terra) 100%);
  opacity: 0.5;
}

/* ==================== HERO ==================== */
.hero {
  padding: 72px 0 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.hero-image-col { position: relative }
.hero-image-wrap {
  border-radius: 10px; overflow: hidden; border: 1.5px solid var(--mud);
  position: relative; transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.hero-image-wrap:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(193,95,60,0.08) }
.hero-image { width: 100%; height: auto; display: block }
.hero-image-col::before {
  content: ''; position: absolute; top: -12px; right: -12px;
  width: 60px; height: 60px; border-radius: 8px;
  background: var(--terra-wash); border: 1.5px solid var(--terra);
  opacity: 0.3; transform: rotate(12deg); z-index: -1;
}
.hero-image-col::after {
  content: ''; position: absolute; bottom: -8px; left: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--terra); opacity: 0.15; z-index: -1;
}
.hero-text { display: flex; flex-direction: column; gap: 0 }
.hero-eyebrow {
  font-family: var(--mono); font-size: 0.65rem; color: var(--terra);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before { content: ''; width: 20px; height: 1.5px; background: var(--terra) }
.hero-title {
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.025em;
  color: var(--ink); margin-bottom: 18px;
}
.hero-title .slash { color: var(--terra); font-weight: 400; margin: 0 6px }
.hero-desc { font-size: 0.92rem; color: var(--stone); line-height: 1.75; margin-bottom: 24px }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--terra); padding: 8px 18px; border: 1.5px solid var(--terra);
  border-radius: 100px; transition: all 0.3s var(--ease); width: fit-content;
}
.hero-cta:hover { background: var(--terra); color: var(--paper); transform: translateX(4px) }
.hero-cta svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease) }
.hero-cta:hover svg { transform: translateX(3px) }

/* ==================== AGENT RSS GUIDE ==================== */
.agent-section { margin-bottom: 72px }
.agent-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 32px }
.agent-divider-line { flex: 1; height: 1px; background: var(--mud) }
.agent-divider-diamond { width: 8px; height: 8px; background: var(--terra); transform: rotate(45deg); flex-shrink: 0 }

.agent-card {
  background: var(--ink); border-radius: 12px; overflow: hidden;
  position: relative; color: var(--cream);
}
.agent-card::before {
  content: ''; position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 120px;
  background: radial-gradient(ellipse, rgba(193,95,60,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.agent-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(244,243,238,0.015) 2px, rgba(244,243,238,0.015) 4px);
}
.agent-top { padding: 24px 28px 0; position: relative; z-index: 1 }
.agent-top-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px }
.agent-status { display: flex; align-items: center; gap: 8px }
.agent-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4ADE80;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,0.4) }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(74,222,128,0) }
}
.agent-status-text {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  color: var(--cream); opacity: 0.9; letter-spacing: 0.06em;
}
.agent-badge {
  font-family: var(--mono); font-size: 0.58rem; color: var(--terra);
  background: rgba(193,95,60,0.15); padding: 3px 10px; border-radius: 100px;
  margin-left: auto; letter-spacing: 0.06em; text-transform: uppercase;
}
.agent-title {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 1.3rem; color: var(--cream); margin-bottom: 8px; line-height: 1.35;
}
.agent-title em { color: var(--terra-hot); font-style: normal }
.agent-intro { font-size: 0.85rem; color: rgba(244,243,238,0.55); line-height: 1.7; margin-bottom: 24px }

.feed-block {
  background: rgba(244,243,238,0.06); border: 1px solid rgba(244,243,238,0.1);
  border-radius: 8px; padding: 16px 20px; margin: 0 28px 24px;
  position: relative; z-index: 1;
}
.feed-block-row { display: flex; align-items: center; gap: 12px }
.feed-label {
  font-family: var(--mono); font-size: 0.6rem; color: rgba(244,243,238,0.35);
  text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
}
.feed-url { font-family: var(--mono); font-size: 0.82rem; color: var(--terra-hot); word-break: break-all; flex: 1 }
.feed-copy {
  font-family: var(--mono); font-size: 0.62rem; color: rgba(244,243,238,0.5);
  background: rgba(244,243,238,0.08); border: 1px solid rgba(244,243,238,0.12);
  border-radius: 4px; padding: 4px 12px; cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap; flex-shrink: 0;
}
.feed-copy:hover { background: var(--terra); color: var(--paper); border-color: var(--terra) }

.agent-steps { list-style: none; padding: 0 28px; margin: 0 0 24px; position: relative; z-index: 1; counter-reset: step }
.agent-steps li {
  counter-increment: step; display: flex; gap: 16px; padding: 12px 0;
  border-bottom: 1px solid rgba(244,243,238,0.06);
  font-size: 0.84rem; color: rgba(244,243,238,0.6); line-height: 1.65;
}
.agent-steps li:last-child { border-bottom: none }
.agent-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.65rem; font-weight: 500;
  color: var(--terra); background: rgba(193,95,60,0.12);
  min-width: 28px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.agent-steps code {
  font-family: var(--mono); font-size: 0.82em;
  background: rgba(244,243,238,0.08); padding: 1px 6px; border-radius: 3px; color: var(--cream);
}
.agent-bottom {
  padding: 16px 28px; border-top: 1px solid rgba(244,243,238,0.06);
  display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1;
}
.agent-bottom-text { font-size: 0.76rem; color: rgba(244,243,238,0.3); font-style: italic }
.agent-bottom-tag { font-family: var(--mono); font-size: 0.58rem; color: rgba(244,243,238,0.25); letter-spacing: 0.08em }

/* ==================== POSTS ==================== */
.posts-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px }
.posts-header-line { flex: 1; height: 1px; background: var(--mud) }
.posts-header-label { font-family: var(--mono); font-size: 0.65rem; color: var(--mist); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap }
.posts-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px }

.post-featured {
  display: block; background: var(--paper); border: 1px solid var(--mud);
  border-radius: var(--r); overflow: hidden;
  transition: all 0.4s var(--ease); position: relative;
}
.post-featured:hover { border-color: var(--terra); box-shadow: 0 4px 24px rgba(193,95,60,0.08); transform: translateY(-2px) }
.post-featured-img {
  width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid var(--mud);
  transition: transform 0.6s var(--ease);
}
.post-featured:hover .post-featured-img { transform: scale(1.02) }
.post-featured-body { padding: 22px 24px }
.post-featured-tag {
  font-family: var(--mono); font-size: 0.6rem; color: var(--terra);
  background: var(--terra-wash); padding: 3px 10px; border-radius: 100px;
  display: inline-block; margin-bottom: 10px; letter-spacing: 0.04em;
}
.post-featured .post-title { font-size: 1.15rem; margin-bottom: 10px }
.post-featured .post-excerpt { -webkit-line-clamp: 3 }

.posts-side { display: flex; flex-direction: column; gap: 18px }
.post-card {
  display: flex; background: var(--paper); border: 1px solid var(--mud);
  border-radius: var(--r); overflow: hidden;
  transition: all 0.35s var(--ease); position: relative;
}
.post-card:hover { border-color: var(--terra); box-shadow: 0 2px 12px rgba(193,95,60,0.06) }
.post-card-img { width: 100px; height: auto; object-fit: cover; flex-shrink: 0; border-right: 1px solid var(--mud) }
.post-card-body { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center }

.post-title {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 0.92rem; line-height: 1.4; color: var(--ink);
  margin-bottom: 6px; transition: color 0.25s ease;
}
.post-featured:hover .post-title, .post-card:hover .post-title { color: var(--terra) }
.post-excerpt {
  font-size: 0.8rem; color: var(--stone); line-height: 1.55; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta { font-size: 0.66rem; color: var(--mist); display: flex; align-items: center; gap: 6px }
.post-meta .sep { opacity: 0.4 }
.post-tag { font-family: var(--mono); font-size: 0.6rem; color: var(--terra) }

/* ==================== ARTICLE PAGE ==================== */
.article-header { padding: 48px 0 28px; text-align: center }
.article-title {
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem); line-height: 1.35;
  color: var(--ink); margin-bottom: 16px;
}
.article-meta {
  font-size: 0.82rem; color: var(--stone);
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.article-content { padding: 16px 0 56px; line-height: 1.9 }
.article-content h2 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.4rem; margin-top: 40px; margin-bottom: 14px }
.article-content h3 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.15rem; margin-top: 28px; margin-bottom: 10px }
.article-content p { margin-bottom: 20px }
.article-content a { border-bottom: 1px solid rgba(193,95,60,0.3); transition: border-color 0.2s }
.article-content a:hover { border-bottom-color: var(--terra) }
.article-content ul, .article-content ol { margin-bottom: 20px; padding-left: 24px }
.article-content li { margin-bottom: 4px }
.article-content blockquote { border-left: 3px solid var(--terra); padding: 4px 0 4px 20px; margin: 28px 0; color: var(--stone); font-style: italic }
.article-content code { font-family: var(--mono); font-size: 0.88em; background: var(--clay); padding: 2px 5px; border-radius: 3px; color: var(--terra) }
.article-content pre { background: var(--ink); padding: 20px; border-radius: var(--r); border-left: 3px solid var(--terra); overflow-x: auto; margin-bottom: 20px }
.article-content pre code { background: none; padding: 0; color: var(--cream) }

.article-nav { padding: 28px 0; border-top: 1px solid var(--mud); display: flex; justify-content: space-between; gap: 20px }
.article-nav-link { display: flex; flex-direction: column; max-width: 45%; color: var(--stone) }
.article-nav-link:hover { color: var(--terra) }
.article-nav-link.next { align-items: flex-end; text-align: right }
.article-nav-label { font-size: 0.7rem; color: var(--mist); margin-bottom: 4px }
.article-nav-title { font-size: 0.95rem; color: var(--ink) }
.article-nav-link:hover .article-nav-title { color: var(--terra) }

.rss-hint {
  padding: 16px; background: var(--sand); border-radius: var(--r);
  text-align: center; margin-bottom: 40px; border: 1px solid var(--mud);
}
.rss-hint p { font-size: 0.85rem; color: var(--stone); margin: 0 }

/* ==================== ABOUT ==================== */
.about-section { padding: 48px 0 }
.about-intro { font-size: 1.05rem; line-height: 1.9; color: var(--ink); margin-bottom: 36px }

/* ==================== FOOTER ==================== */
.footer { margin-top: 80px; padding: 24px 0; border-top: 1px solid var(--mud) }
.footer-inner { display: flex; justify-content: space-between; align-items: center }
.footer-left { display: flex; align-items: center; gap: 16px }
.footer-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--mud) }
.footer-tagline { font-family: var(--serif); font-style: italic; font-size: 0.85rem; color: var(--stone) }
.footer-mid { font-family: var(--mono); font-size: 0.56rem; color: var(--ghost); letter-spacing: 0.06em }
.footer-links { display: flex; gap: 2px }
.footer-link { font-size: 0.76rem; color: var(--mist); padding: 5px 12px; border-radius: 100px; transition: all 0.25s ease }
.footer-link:hover { color: var(--terra); background: var(--terra-mist) }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .page { padding: 0 18px }
  .hero { grid-template-columns: 1fr; padding: 48px 0 40px; gap: 24px }
  .hero-image-col { order: -1 }
  .hero-image-col::before, .hero-image-col::after { display: none }
  .posts-layout { grid-template-columns: 1fr; gap: 14px }
  .post-featured-img { height: 160px }
  .post-card { flex-direction: column }
  .post-card-img { width: 100%; height: 100px; border-right: none; border-bottom: 1px solid var(--mud) }
  .agent-top { padding: 20px 18px 0 }
  .feed-block { margin: 0 18px 20px }
  .agent-steps { padding: 0 18px }
  .agent-bottom { padding: 14px 18px }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center }
  .footer-left { flex-direction: column; gap: 8px }
  .article-nav { flex-direction: column }
  .article-nav-link { max-width: 100% }
  .article-nav-link.next { align-items: flex-start; text-align: left }
}
@media print { .nav, .footer { display: none } body { background: white; color: black } }
