/* Tyr.AI Homepage - 中英首页 */
:root {
  --bg-header: #0d0d0d;
  --bg-dark: #0f1624;
  --bg-light: #ffffff;
  --text-light: #ffffff;
  --text-dark: #161a22;
  --text-muted: #596171;
  --text-muted-soft: #667085;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --border-nav: rgba(255,255,255,0.15);
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --weight-title: 500;
  --weight-body: 400;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.55;
  font-weight: var(--weight-body);
  letter-spacing: -0.004em;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-nav);
  padding: 0.75rem 1.5rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-light);
}

/* Language Switcher - 符合当前页面风格 */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-nav);
}

.lang-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}

.lang-btn:hover {
  color: rgba(255,255,255,0.9);
}

.lang-btn.active {
  color: var(--text-light);
  font-weight: 600;
}

.lang-divider {
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
  user-select: none;
}

/* 汉堡按钮 - 仅手机端显示 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  border-radius: 4px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: rgba(255,255,255,0.08);
}

.menu-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 侧滑菜单遮罩 */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* 侧滑菜单抽屉 */
.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 85vw);
  height: 100vh;
  z-index: 200;
  background: var(--bg-header);
  border-left: 1px solid var(--border-nav);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.menu-drawer.is-open {
  transform: translateX(0);
}

.menu-nav {
  display: flex;
  flex-direction: column;
  padding: 4rem 1.5rem 2rem;
  gap: 0.5rem;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 44px;
}

.menu-link:hover {
  color: #fff;
}

.menu-lang {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-nav);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-lang .lang-btn {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.menu-lang .lang-btn.active {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
}

@media (min-width: 769px) {
  .menu-overlay,
  .menu-drawer {
    display: none;
  }
}

/* Hero - 配图文字在右下角 */
.hero {
  position: relative;
  min-height: 85vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.6) 100%);
}

.hero-content {
  position: absolute;
  right: max(1.5rem, 5vw);
  bottom: clamp(2.5rem, 8vw, 5rem);
  z-index: 1;
  text-align: right;
  /* 保证不超出左侧：可用宽度 = 视口 - 左右边距 */
  max-width: min(90%, calc(100vw - 3rem));
}

.hero-brand {
  display: block;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.75rem, 4.5vw, 3.25rem);
  font-weight: 500;
  color: var(--text-light);
  line-height: 1.12;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hero-title {
    white-space: normal;
  }
}

/* Sections */
.section {
  padding: 4rem 1.5rem;
}

.section-light {
  background: var(--bg-light);
  color: var(--text-dark);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.section-title {
  font-size: clamp(1.75rem, 3.8vw, 2.8rem);
  font-weight: var(--weight-title);
  text-align: center;
  margin-bottom: 1.1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.13;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-desc,
.section-subtitle {
  font-size: clamp(0.94rem, 1.05vw, 1.02rem);
  color: var(--text-muted);
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.62;
  letter-spacing: -0.002em;
  text-wrap: pretty;
}

.section-light .section-desc,
.section-light .section-subtitle {
  color: #565f6f;
}

.section-dark .section-desc,
.section-dark .section-subtitle {
  color: rgba(255,255,255,0.8);
}

.section-subtitle {
  margin-bottom: 2.5rem;
}

/* intro 区块：标题与段落收窄、居中，约 50–60% 内容区宽度 */
.intro .section-title {
  max-width: 620px;
  font-weight: 400;
}

.intro .section-desc {
  margin-top: 0.65rem;
  max-width: 760px;
  font-size: clamp(0.82rem, 0.92vw, 0.95rem);
  line-height: 1.52;
  color: #575f6d;
}

/* crises、equality 与 intro 一致：标题与副标题/段落收窄、居中 */
.crises .section-title,
.equality .section-title {
  max-width: 620px;
}

.crises .section-subtitle,
.equality .section-desc {
  max-width: 620px;
}

/* Visual Break */
.visual-break {
  width: 100%;
  line-height: 0;
}

.visual-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 70vh;
}

/* Pillars - 与 intro 一致的标题/副标题宽度，三列窄栏、左对齐 */
.pillars .section-title {
  margin-bottom: 0.5rem;
  max-width: 620px;
}

.pillars .section-subtitle {
  max-width: 620px;
}

.pillar-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 360px));
  justify-content: center;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 2rem auto 0;
}

.pillar-card {
  padding: 1.5rem 1.25rem;
  text-align: left;
}

.pillar-icon {
  width: 40px;
  height: 40px;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.pillar-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pillar-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.pillar-desc {
  font-size: 0.92rem;
  color: var(--text-muted-soft);
  line-height: 1.66;
}

@media (max-width: 900px) {
  .pillar-cards {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Gateway - 图片 3 全铺背景，高度与 visual-break 图一致 580px，展示风格一致 */
.gateway {
  position: relative;
  min-height: 580px;
  height: 580px;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-image: url('./images/3.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.gateway-inner {
  position: relative;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.gateway-content {
  text-align: right;
  max-width: 520px;
  margin-left: auto;
}

.gateway-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-light);
  letter-spacing: -0.02em;
}

.gateway-desc {
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .gateway-inner {
    justify-content: center;
  }
  .gateway-content {
    text-align: center;
    margin-left: 0;
  }
}

/* Crises */
.crises .section-subtitle {
  margin-bottom: 0;
}

/* Shield Section - 图片 4 全铺背景，高度 580px 与 gateway 一致，文字在左、左对齐 */
.shield-section {
  position: relative;
  min-height: 580px;
  height: 580px;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-image: url('./images/4.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.shield-section .shield-inner {
  position: relative;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.shield-section .shield-content {
  text-align: left;
  max-width: 520px;
  margin-right: auto;
}

.shield-content .shield-title,
.trust-content .trust-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-light);
  letter-spacing: -0.02em;
}

.shield-desc,
.trust-desc {
  font-size: 0.98rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
}

/* Trust Section - 图片 5 全铺背景，高度 580px 与 gateway 一致，文字在右、右对齐 */
.trust-section {
  position: relative;
  min-height: 580px;
  height: 580px;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-image: url('./images/5.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.trust-section .trust-inner {
  position: relative;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.trust-section .trust-content {
  text-align: right;
  max-width: 520px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .shield-section .shield-inner {
    justify-content: center;
  }
  .shield-section .shield-content {
    text-align: center;
    margin-right: 0;
  }
  .trust-section .trust-inner {
    justify-content: center;
  }
  .trust-section .trust-content {
    text-align: center;
    margin-left: 0;
  }
}

/* Equality - 标题与正文上下间距 40px，文字与下方图片间距 128px */
.equality .section-title {
  margin-bottom: 40px;
}

.equality .section-desc {
  margin-top: 0;
}

.equality {
  margin-top: 128px;
  margin-bottom: 128px;
  padding: 0 1.5rem;
}

/* Footer - 左品牌 + 右 Get Started，底栏居中版权 */
.footer {
  background: #000;
  color: var(--text-light);
  padding: 3rem 1.5rem 2rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.footer-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  margin: 0;
  padding-left: 3.25rem;
}

.footer-cta {
  text-align: right;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.95);
  margin-bottom: 0.75rem;
}

.footer-heading.js-coming-soon {
  cursor: pointer;
}

/* Toast - 敬请期待 / Coming Soon */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  z-index: 9999;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.95);
  background: var(--bg-header);
  border: 1px solid var(--border-nav);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  color: rgba(255,255,255,0.95);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-social a:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.9);
}

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.5rem;
  }
  .footer-cta {
    text-align: left;
  }
  .footer-desc {
    padding-left: 0;
  }
  .footer-bottom {
    padding-top: 1rem;
  }
}

/* ========== 手机端兼容 ========== */
@media (max-width: 768px) {
  .header {
    padding: 0.5rem 1rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  .nav {
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.35rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .lang-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.35rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero {
    min-height: 60vh;
  }

  .hero-content {
    right: 1rem;
    bottom: 1.5rem;
    max-width: calc(100vw - 2rem);
    padding: 0;
  }

  .hero-brand {
    font-size: 0.8rem;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.5vw, 2rem);
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .equality {
    padding: 0 1rem;
  }

  .section-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    margin-bottom: 0.75rem;
  }

  .section-desc,
  .section-subtitle {
    font-size: 0.88rem;
    line-height: 1.58;
  }

  .intro .section-desc {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .intro .section-title,
  .intro .section-desc,
  .crises .section-title,
  .equality .section-title,
  .equality .section-desc,
  .pillars .section-title,
  .pillars .section-subtitle {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .pillar-cards {
    gap: 1.5rem;
    margin-top: 1.5rem;
  }

  .pillar-card {
    padding: 1.25rem 1rem;
  }

  .pillar-title {
    font-size: 1.1rem;
  }

  .pillar-desc {
    font-size: 0.85rem;
  }

  .gateway,
  .shield-section,
  .trust-section {
    min-height: 380px;
    height: 380px;
    background-position: center;
  }

  .gateway-inner,
  .shield-section .shield-inner,
  .trust-section .trust-inner {
    padding: 0 1rem;
  }

  .gateway-content,
  .shield-section .shield-content,
  .trust-section .trust-content {
    max-width: 100%;
  }

  .gateway-title,
  .shield-content .shield-title,
  .trust-content .trust-title {
    font-size: clamp(1.25rem, 4.5vw, 1.75rem);
    margin-bottom: 0.75rem;
  }

  .gateway-desc,
  .shield-desc,
  .trust-desc {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .visual-img {
    max-height: 50vh;
    object-fit: cover;
  }

  .footer {
    padding: 2rem 1rem 1rem;
  }

  .footer-inner {
    gap: 1.5rem;
    margin-bottom: 1rem;
  }

  .footer-logo {
    font-size: 1.35rem;
  }

  .footer-desc {
    font-size: 0.85rem;
  }

  .footer-social a {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .nav {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .hero {
    min-height: 55vh;
  }

  .section {
    padding: 2rem 0.75rem;
  }

  .equality {
    padding: 0 0.75rem;
  }

  .gateway,
  .shield-section,
  .trust-section {
    min-height: 320px;
    height: 320px;
  }

  .footer-bottom {
    gap: 0.5rem;
  }
}

/* ========== 滚动进入动画（模仿 reference 页面） ========== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  transition-delay: calc(var(--delay, 0) * 0.1s);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* 从左/右进入，用于左右分栏区块 */
.reveal-from-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--delay, 0) * 0.1s);
}

.reveal-from-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.reveal-from-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--delay, 0) * 0.1s);
}

.reveal-from-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* 视觉分隔图：轻微缩放 + 淡入 */
.reveal-scale {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}
