/* ================================
   Rigpa.AI - Global Styles (v2 - 白底/黑底双主题)
   ================================ */

/* CSS Variables - 默认深色主题（首页 Hero、Vision、Rigpa is building 等 section 会覆写） */
:root {
  --color-bg: #0a0a0f;
  --color-bg-alt: #111118;
  --color-bg-card: #16161e;
  --color-text: #e8e8e8;
  --color-text-muted: #9999a0;
  --color-accent: #4a9eff;
  --color-accent-glow: rgba(74, 158, 255, 0.15);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-gray-20: #cccccc;   /* 20% 灰（合作/首页卡片） */
  --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --nav-height: 70px;
  --transition: 0.3s ease;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #2a7ecf;
}

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

/* ================================
   Navigation (白色背景 + 蓝字)
   ================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8e8ee;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}

.nav-logo-img {
  height: 48px;
  width: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-menu a {
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition);
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #1d65c4;
  font-weight: 600;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ================================
   Hero Section (首页用)
   ================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: #fff;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10,10,15,0.55) 0%, rgba(10,10,15,0.78) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 980px;
  padding: 0 24px;
}

/* 统一 banner h1：全大写、不加粗、48pt（约 64px） 深色 hero 中仍为白字 */
.hero-content h1,
.page-header h1 {
  font-size: clamp(32px, 5vw, 48pt);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: #cfd2dc;
  margin-bottom: 16px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ================================
   Buttons
   ================================ */
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3a8eef;
  color: #fff;
  box-shadow: 0 4px 20px var(--color-accent-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ================================
   Sections
   ================================ */
.section {
  padding: 100px 24px;
  position: relative;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.section-text {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 700px;
  margin-bottom: 16px;
}

/* -------- 白底主题（About/Careers/Partnerships 整页 + 技术/首页部分 section 会用）-------- */
.theme-light {
  --color-bg: #ffffff;
  --color-bg-alt: #f4f5f9;
  --color-bg-card: #f8f9fd;
  --color-text: #111111;
  --color-text-muted: #5a5a66;  /* 90% 深灰 */
  --color-border: #e4e6ef;
}
.theme-light,
.theme-light body { background: #ffffff; color: #111; }

/* section 单独白底 */
.section-white {
  background: #ffffff !important;
  color: #111 !important;
}
.section-white .section-title   { color: #111; font-weight: 400; }
.section-white .section-text    { color: #5a5a66; }
.section-white .section-label   { color: var(--color-accent); }
.section-white .card p          { color: #5a5a66; }
.section-white .card h3         { color: #111; }
.section-white .timeline-title  { color: #111; }
.section-white .timeline-text   { color: #5a5a66; }
.section-white .timeline-item::before { border-color: #ffffff; }
.section-white .btn-outline     { color: #111; border-color: #cfd2dc; }
.section-white .btn-outline:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* 白色背景下：原本是大号白字的 section-title -> 黑色不加粗；小号白字 -> 深灰90% */
.section-white .card,
.section-white { color: #111; }

/* 合作页 5 个区块 & 首页 Vajra/Ecosystem 两区块：20% 灰 + 更圆润边角 */
.card-gray-20 {
  background: var(--color-gray-20) !important;
  border: 1px solid #c2c6cf !important;
  border-radius: 16px !important;
}
.card-gray-20 h3 { color: #111 !important; }
.card-gray-20 p  { color: #3a3a44 !important; }
.card-gray-20 .bullet-list li { color: #2a2a34 !important; }

/* ================================
   Two column layout
   ================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.two-col-image img {
  border-radius: 8px;
  width: 100%;
}

/* ================================
   Bullet list
   ================================ */
.bullet-list {
  list-style: none;
  margin-top: 20px;
}

.bullet-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: var(--color-text-muted);
}

.bullet-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ================================
   Cards
   ================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 36px;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.card p {
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* ================================
   Partner Logos
   ================================ */
.partner-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
}

.partner-logos img {
  max-height: 60px;
  width: auto;
  filter: grayscale(0.3);
  opacity: 0.85;
  transition: all var(--transition);
}

.partner-logos img:hover {
  filter: grayscale(0);
  opacity: 1;
}

/* ================================
   Timeline
   ================================ */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto 0;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  z-index: 1;
}

.timeline-year {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.timeline-text {
  color: var(--color-text-muted);
  font-size: 15px;
}

/* ================================
   Forms
   ================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group .required-mark::after {
  content: ' *';
  color: #e03131;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 15px;
  transition: border var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: #e03131;
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}

/* ================================
   Footer (黑底、白文、蓝色标题)
   ================================ */
.footer {
  background: #0a0a0f;
  color: #e8e8e8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 60px 24px 30px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  align-items: flex-start;
}

.footer-brand {
  margin-bottom: 12px;
}

.footer-logo-img {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-text {
  color: #b3b3bd;
  font-size: 14px;
  max-width: 360px;
  line-height: 1.7;
}

.footer h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent) !important;   /* 蓝色小标题 */
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #b3b3bd;
  font-size: 14px;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer a.mail-link {
  color: #b3b3bd;
  font-size: 14px;
}
.footer a.mail-link:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #7d7d88;
  font-size: 13px;
}

/* ================================
   Scroll Animations
   ================================ */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ================================
   Page Header (内页首屏) - 默认白色背景
   ================================ */
.page-header {
  padding: 160px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  color: #111;
}

.page-header h1 {
  color: #111111;
  font-weight: 400;
}

.page-header p {
  font-size: 18px;
  color: #5a5a66;
  max-width: 760px;
  margin: 0 auto;
}

/* 技术页 Banner 特殊：带背景图，在页面中再覆写 */
.page-header-tech {
  background: #0a0a0f;
  color: #fff;
}
.page-header-tech h1 { color: #fff; }
.page-header-tech p  { color: #d4d6de; }

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid #e8e8ee;
  }

  .nav-menu.open {
    max-height: 440px;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #ececf2;
  }

  .nav-menu a {
    display: block;
    padding: 16px 24px;
  }

  .nav-toggle {
    display: flex;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .section {
    padding: 60px 20px;
  }

  .partner-logos {
    gap: 20px;
  }

  .partner-logos img {
    max-height: 40px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
