@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* =============================================
   CSS 变量 & Reset
   ============================================= */
:root {
  --c-white: #ffffff;
  --c-surface: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-60: rgba(31,31,31,0.6);
  --c-ink-20: rgba(31,31,31,0.12);
  --c-accent: #1f1f1f;
  --c-accent-hover: #3a3a3a;
  --radius-card: 28px;
  --radius-sm: 12px;
  --radius-btn: 8px;
  --shadow-card: 0 4px 16px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Mono', monospace;
  --nav-h: 108px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* =============================================
   导航 Header — 两行布局
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-ink-20);
}

.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 40px;
  text-decoration: none;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon--text {
  background: var(--c-ink);
  color: var(--c-white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-logo,
.brand-logomark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  white-space: nowrap;
}

/* 搜索框 */
.header-search {
  flex: 0 1 340px;
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-ink-20);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-form:focus-within {
  border-color: var(--c-ink);
  box-shadow: 0 0 0 2px rgba(31,31,31,0.1);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--c-ink);
  padding: 0.6rem 0.875rem;
  line-height: 1.5;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--c-ink-60);
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-ink-60);
  padding: 0.6rem 0.875rem;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  min-height: 40px;
  min-width: 40px;
  justify-content: center;
}

.search-btn:hover {
  color: var(--c-ink);
}

/* 导航第二行 — nav > p > a */
.header-nav {
  border-top: 1px solid var(--c-ink-20);
  padding: 0 2rem;
}

.header-nav > p {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
}

.header-nav > p > a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--c-ink-60);
  padding: 0.75rem 1.125rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.header-nav > p > a:hover,
.header-nav > p > a:focus-visible {
  color: var(--c-ink);
  border-bottom-color: var(--c-ink);
}

/* =============================================
   Hero Section
   ============================================= */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  scroll-margin-top: var(--nav-h);
}

.hero-figure {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1f1f1f 0%, #2d2d2d 50%, #1a1a1a 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(0,0,0,0.25) 100%
  );
}

.hero-aside {
  position: relative;
  z-index: 2;
  padding: 5rem 2rem 5rem 4rem;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-small-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  display: block;
}

.hero-eyebrow {
  display: flex;
}

.hero-h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--c-white);
}

.hero-desc {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.72);
  max-width: 480px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-btn);
  min-height: 48px;
  align-self: flex-start;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.hero-cta:hover {
  background: var(--c-surface);
  transform: translateY(-2px);
}

/* =============================================
   主内容区 — Bento Grid
   ============================================= */
.site-main {
  min-height: 60vh;
}

.bento-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* 左侧 Aside */
.bento-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eyebrow-small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--c-ink-60);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

.aside-title {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 0.75rem;
}

.aside-title + nav,
.bento-aside nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aside-nav-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-ink-60);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
}

.aside-nav-link:hover {
  background: var(--c-surface);
  color: var(--c-ink);
  border-left-color: var(--c-ink);
}

/* 正文主体 */
.content-main-area {
  min-width: 0;
}

.page-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* =============================================
   page.content 里各 section 的 Bento 卡片风格
   ============================================= */
.page-content-wrap > section,
.page-content-wrap section {
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
  transition: box-shadow var(--transition), transform var(--transition);
}

.page-content-wrap > section:hover {
  box-shadow: var(--shadow-hover);
}

.page-content-wrap h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  color: var(--c-ink);
}

.page-content-wrap h3 {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.875rem;
  color: var(--c-ink);
}

.page-content-wrap p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-ink);
  margin-bottom: 1rem;
}

.page-content-wrap p:last-child {
  margin-bottom: 0;
}

.page-content-wrap ul,
.page-content-wrap ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-content-wrap li {
  font-size: 1rem;
  line-height: 1.7;
}

.page-content-wrap a {
  color: var(--c-ink);
  border-bottom: 1px solid var(--c-ink-20);
  transition: border-color var(--transition);
}

.page-content-wrap a:hover {
  border-bottom-color: var(--c-ink);
}

.page-content-wrap figure {
  margin: 1.5rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-content-wrap figcaption {
  font-size: 0.875rem;
  color: var(--c-ink-60);
  padding: 0.5rem 0;
}

.page-content-wrap aside {
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 3px solid var(--c-ink-20);
}

/* small + h2/h3 眉题样式 */
small + h2,
small + h3 {
  margin-top: 0.35rem;
}

.page-content-wrap small {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-ink-60);
  text-transform: uppercase;
  display: block;
}

/* =============================================
   图片卡片网格（bento 变种）
   ============================================= */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 1rem;
}

.bento-card {
  background: var(--c-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.bento-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.bento-card--2x1 { grid-column: span 2; }
.bento-card--2x2 { grid-column: span 2; grid-row: span 2; }
.bento-card--1x1 { grid-column: span 1; }

/* =============================================
   Footer
   ============================================= */
.site-footer {
  background: var(--c-ink);
  color: var(--c-white);
  padding: 0;
}

.footer-cta-block {
  padding: 4rem 2rem 3rem;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.footer-cta-block .eyebrow-small {
  color: rgba(255,255,255,0.45);
}

.footer-cta-title {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--c-white);
  line-height: 1.2;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-btn);
  min-height: 48px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.footer-cta-btn:hover {
  background: var(--c-surface);
  transform: translateY(-2px);
}

.site-footer > p,
.site-footer > small {
  display: block;
  text-align: center;
  padding: 0.5rem 2rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-brand-desc {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem !important;
  margin-top: 0;
  font-size: 0.9375rem !important;
  color: rgba(255,255,255,0.6) !important;
}

.footer-contact {
  font-size: 0.875rem !important;
  color: rgba(255,255,255,0.45) !important;
}

.footer-copy {
  display: block;
  text-align: center;
  padding: 1.25rem 2rem 2rem !important;
  color: rgba(255,255,255,0.3) !important;
  font-family: var(--font-mono);
  font-size: 0.75rem !important;
  letter-spacing: 0.02em;
}

/* =============================================
   Parallax / Stagger 动效
   ============================================= */
@media (prefers-reduced-motion: no-preference) {
  .hero-figure {
    will-change: transform;
  }

  .stagger-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

  .stagger-item.is-visible {
    opacity: 1;
    transform: none;
  }

  .stagger-item:nth-child(2) { transition-delay: 0.08s; }
  .stagger-item:nth-child(3) { transition-delay: 0.16s; }
  .stagger-item:nth-child(4) { transition-delay: 0.24s; }
  .stagger-item:nth-child(5) { transition-delay: 0.32s; }
  .stagger-item:nth-child(6) { transition-delay: 0.40s; }
  .stagger-item:nth-child(7) { transition-delay: 0.48s; }
}

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

/* =============================================
   响应式断点
   ============================================= */
@media (max-width: 1024px) {
  .bento-section {
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }

  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 92px;
  }

  .header-brand-row {
    padding: 0.625rem 1rem;
    flex-wrap: wrap;
  }

  .header-search {
    flex: 1 1 100%;
    order: 3;
  }

  .header-nav {
    padding: 0 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header-nav > p {
    flex-wrap: nowrap;
    width: max-content;
  }

  .header-nav > p > a {
    padding: 0.75rem 0.875rem;
    font-size: 0.75rem;
  }

  .bento-section {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .bento-aside {
    position: static;
  }

  .bento-aside nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .aside-nav-link {
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .hero-aside {
    padding: 3rem 1.25rem 3.5rem;
  }

  .hero-h1 {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
  }

  .page-content-wrap > section {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
  }

  .footer-cta-block {
    padding: 3rem 1.25rem 2rem;
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }

  .bento-card--2x2 {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 0.875rem;
  }

  .hero-section {
    min-height: 85vw;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .bento-card--2x1,
  .bento-card--2x2 {
    grid-column: span 1;
    grid-row: span 1;
  }

  .page-content-wrap > section {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }
}

/* =============================================
   Focus 可访问性
   ============================================= */
:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
}
