/* ========================================
   Even Realities — G2 Landing Page
   Design system from Figma
   ======================================== */

@font-face {
  font-family: 'FK Grotesk Neue';
  src: url('FKGroteskNeue-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FK Grotesk Neue';
  src: url('FKGroteskNeue-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FK Grotesk Neue';
  src: url('FKGroteskNeue-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --er-black: #232323;
  --er-gray-95: #2A2A2A;
  --er-gray-92: #333333;
  --er-gray-80: #4F4F4F;
  --er-gray-50: #919191;
  --er-gray-10: #E9E9E9;
  --er-gray-5: #F4F4F4;
  --er-white: #FFFFFF;

  --font: 'FK Grotesk Neue', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --fw: 300;
  --header-h: 48px;
  --gutter: 16px;
  --max-w: 1888px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font);
  font-weight: var(--fw);
  color: var(--er-black);
  background: var(--er-white);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

::selection {
  background: #fef991;
  color: var(--er-black);
}

::-moz-selection {
  background: #fef991;
  color: var(--er-black);
}

/* ---- Utilities ---- */
.spacer-96 { height: 96px; }
.spacer-16 { height: 16px; }

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

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive image / text switching */
.mobile-only-img { display: none; }
.desktop-only-img { display: block; }
.mobile-only { display: none; }
.desktop-only { display: inline; }

/* ---- Typography ---- */
.heading-46 {
  font-size: 46px;
  line-height: 48px;
  letter-spacing: -2px;
  font-weight: 300;
  color: var(--er-black);
}

.heading-46.dark { color: var(--er-black); }
.heading-46.light { color: var(--er-white); }

.heading-32 {
  font-size: 32px;
  line-height: 34px;
  letter-spacing: -1px;
  font-weight: 300;
  color: var(--er-white);
}

.body-20 {
  font-size: 20px;
  line-height: 22px;
  letter-spacing: -0.6px;
  font-weight: 300;
  color: var(--er-gray-95);
}

.body-20.dark { color: var(--er-black); }
.body-20.light { color: var(--er-white); }

/* ---- Section header row ---- */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 16px;
}

.section-header-row .body-20 {
  max-width: 551px;
  flex-shrink: 0;
}

.section-header-row--top {
  align-items: flex-end;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  border-bottom: 1px solid var(--er-gray-10);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
}

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

/* Nav: positioned to the right area */
.nav {
  display: flex;
  align-items: center;
  gap: 29px;
  margin-right: 20px;
}

.nav-link {
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: var(--er-black);
  padding: 14px 0;
  position: relative;
  font-feature-settings: 'case' 1;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.nav-link:hover { opacity: 0.6; }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--er-black);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.nav-link:hover::after { transform: scaleX(1); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  width: 24px;
  height: 24px;
}

.menu-toggle-line {
  position: absolute;
  left: 4px;
  width: 16px;
  height: 2px;
  background: #232323;
  transform-origin: 50% 50%;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.menu-toggle-line--top {
  top: 7px;
}

.menu-toggle-line--bottom {
  top: 15px;
}

.menu-toggle.is-open .menu-toggle-line--top {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-line--bottom {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav,
.mobile-menu-backdrop {
  display: none;
}

.mobile-nav-link {
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: var(--er-black);
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  width: 100%;
  /* 56.25vw = 图片 16:9 的精确高度，不超过一屏 */
  height: min(calc(100svh - var(--header-h)), 56.25vw);
  margin-top: var(--header-h);
  overflow: hidden;
}

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

.hero-logo {
  position: absolute;
  left: 0;
  top: calc(50% - 32px);
  transform: none;
  z-index: 2;
}

.hero-logo-img {
  width: 76.8px;
  height: 64px;
}

.hero-text {
  position: absolute;
  right: 16px;
  top: calc(50% - 32px);
  transform: none;
  width: 619px;
  z-index: 2;
}

.hero-title {
  font-size: 46px;
  line-height: 48px;
  letter-spacing: -2px;
  font-weight: 300;
  color: var(--er-white);
}

/* Carousel indicator */
.carousel-indicator {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  width: 92px;
  height: 3px;
}

.ci-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.3);
}

.ci-bar.active {
  background: var(--er-white);
}

.card-carousel {
  bottom: 16px;
  left: 31px;
  transform: none;
}

/* ========================================
   HERO IMAGE BLOCK (conversations)
   ======================================== */
.hero-image-block {
  width: 100%;
  aspect-ratio: 1888 / 700;
  overflow: hidden;
}

/* ========================================
   THREE-COL GRID (features)
   ======================================== */
.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.image-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #656565;
}

.image-card-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
}

.feature-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.feature-icon--arrow::before,
.feature-icon--arrow::after,
.feature-icon--plus::before,
.feature-icon--plus::after {
  content: '';
  position: absolute;
  background: var(--er-white);
}

.feature-icon--arrow::before {
  width: 12px;
  height: 2px;
  left: 10px;
  top: 15px;
}

.feature-icon--arrow::after {
  width: 8px;
  height: 8px;
  right: 9px;
  top: 12px;
  border-top: 2px solid var(--er-white);
  border-right: 2px solid var(--er-white);
  background: transparent;
  transform: rotate(45deg);
}

.feature-icon--plus::before {
  width: 14px;
  height: 2px;
  left: 9px;
  top: 15px;
}

.feature-icon--plus::after {
  width: 2px;
  height: 14px;
  left: 15px;
  top: 9px;
}

/* ========================================
   FULL-BLEED CARD (A_2 pattern)
   ======================================== */
.fullbleed-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1888 / 800;
  overflow: hidden;
}

.fullbleed-card .cover-img {
  position: absolute;
  inset: 0;
}

.fullbleed-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  z-index: 2;
}

.fullbleed-top .heading-46 { max-width: 603px; }
.fullbleed-bottom .body-20 { max-width: 443px; }

.fullbleed-card-overlay-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.2) 0%, rgba(13,13,13,0) 27.3%),
    linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(13,13,13,0) 53.8%);
}

.fullbleed-card--tall {
  aspect-ratio: 1888 / 912;
}

.fullbleed-card--team {
  aspect-ratio: 1888 / 936;
}

.fullbleed-card--team .fullbleed-card-content,
.fullbleed-card--tall .fullbleed-card-content {
  z-index: 2;
}

.r1-card {
  background: #ffffff;
}

.r1-desktop-img {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  object-fit: cover;
  object-position: center 40%;
}

.r1-mobile-img,
.tech-mobile-img {
  object-position: center center;
}

/* ---- Button ---- */
.btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 31px;
  background: var(--er-white);
  color: var(--er-black);
  font-size: 20px;
  line-height: 22px;
  letter-spacing: -0.6px;
  font-weight: 300;
  font-family: var(--font);
  transition: opacity 0.2s;
}

.btn-main:hover { opacity: 0.8; }

/* ========================================
   TWO-COL GRID (styles)
   ======================================== */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.style-card-img {
  position: relative;
  aspect-ratio: 936 / 618;
  overflow: hidden;
  background: var(--er-gray-5);
}

.style-label {
  position: absolute;
  bottom: 22px;
  left: 16px;
  font-size: 20px;
  line-height: 22px;
  letter-spacing: -0.6px;
  color: var(--er-gray-80);
}

/* ========================================
   PAGINATION BUTTONS (testimonials)
   ======================================== */
.pagination-btns {
  display: flex;
  flex-shrink: 0;
  gap: 0;
}

.pagination-btn {
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 0;
}

.pagination-btn:hover:not(:disabled) {
  background: #fef991;
  color: var(--er-black);
}

.pagination-btn svg {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.pagination-btn--flip {
  transform: none;
}

.pagination-btn:disabled {
  opacity: 1;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.1);
  cursor: default;
}

/* ========================================
   TESTIMONIALS
   ======================================== */
.testimonials-section .section-header-row {
  padding-bottom: 0;
  align-items: flex-start;
}

.testimonials-section .pagination-btns {
  width: 112px;
  margin-top: 40px;
}

.testimonials-carousel {
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.testimonials-track {
  display: flex;
  gap: 16px;
  width: 100%;
  transition: transform 0.35s ease;
  will-change: transform;
  align-items: flex-start;
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 32px) / 3);
  min-width: 0;
  height: auto;
}

.testimonial-photo {
  aspect-ratio: auto;
  height: 500px;
  overflow: hidden;
  background: #ddd;
}

.testimonial-body {
  background: var(--er-gray-5);
  padding: 16px;
  min-height: 0;
  height: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
}

.testimonial-name {
  font-size: 20px;
  line-height: 22px;
  letter-spacing: -0.6px;
  font-weight: 300;
  color: var(--er-black);
}

.testimonial-text {
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.5px;
  font-weight: 300;
  color: var(--er-black);
  opacity: 0.9;
  font-feature-settings: 'case' 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.testimonial-mobile-copy {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.testimonials-progress {
  position: relative;
  width: 96px;
  height: 4px;
  margin: 16px auto 0;
  background: #b8b8b8;
}

.testimonials-progress-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 4px;
  background: var(--er-black);
  transform: translateX(0);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: var(--er-gray-92);
  height: 56px;
}

/* Desktop footer */
.footer-inner {
  max-width: 1920px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.footer-text {
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: var(--er-gray-50);
  font-feature-settings: 'case' 1;
  white-space: nowrap;
}

/* Mobile footer: hidden on desktop */
.footer-inner-mobile {
  display: none;
}

/* Mobile footer link styles */
.footer-mob-copyright,
.footer-mob-tagline {
  font-size: 14px;
  line-height: 16px;
  letter-spacing: -0.3px;
  color: var(--er-gray-50);
  font-weight: 300;
  white-space: nowrap;
}

/* ========================================
   RESPONSIVE — Tablet & Mobile (< 1024px)
   ======================================== */
@media (max-width: 1023px) {
  .spacer-96 { height: 64px; }
  .spacer-mobile-16 { height: 16px; }
  .spacer-mobile-24 { height: 24px; }
  .spacer-mobile-64 { height: 64px; }
  .spacer-mobile-0 { height: 0; }
  .spacer-mobile-56 { height: 56px; }

  /* Header */
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .menu-toggle {
    z-index: 102;
  }

  .mobile-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--er-white);
    border-bottom: 1px solid var(--er-gray-10);
    z-index: 101;
    display: flex;
    flex-direction: column;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.26s ease, opacity 0.22s ease, transform 0.22s ease;
  }
  .mobile-nav.is-open {
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile-nav-link {
    width: 100%;
    padding: 14px 16px;
    border-top: none;
  }
  .mobile-nav-link:first-child { border-top: none; }

  .mobile-menu-backdrop {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    z-index: 100;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .mobile-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Mobile logo smaller */
  .logo-img { height: 12px; }

  /* Hero */
  .hero {
    height: 852px;
    min-height: 852px;
    background-image: url('assets/images/hero-mobile-figma.jpg');
  }
  .hero::before {
    display: none;
  }
  .hero-logo {
    display: flex;
    left: 0;
    top: calc(50% - 24px);
    transform: none;
  }
  .hero-logo-img {
    width: 57.6px;
    height: 48px;
  }
  .hero-text {
    right: 16px;
    left: auto;
    width: 240px;
    top: calc(50% - 24px);
    bottom: auto;
    transform: none;
  }
  .hero-title {
    font-size: 30px;
    line-height: 32px;
    letter-spacing: -1.5px;
  }
  .carousel-indicator {
    bottom: 16px;
  }

  /* Responsive image/text switching */
  .mobile-only-img { display: block; }
  .desktop-only-img { display: none; }
  .mobile-only { display: inline; }
  .desktop-only { display: none !important; }

  /* Mobile typography */
  /* Card headings in fullbleed cards: 30px */
  .heading-46 {
    font-size: 30px;
    line-height: 32px;
    letter-spacing: -1.5px;
  }
  /* Section headings (outside fullbleed cards): 32px */
  .section-header-row .heading-46,
  .section-inner > .heading-46 {
    font-size: 32px;
    line-height: 34px;
    letter-spacing: -1px;
  }
  .body-20 {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.3px;
  }
  .mob-body-14 {
    font-size: 14px;
    line-height: 16px;
    letter-spacing: -0.3px;
  }
  /* Feature card labels */
  .heading-32 {
    font-size: 22px;
    line-height: 24px;
    letter-spacing: -0.8px;
  }

  /* Section headers */
  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .section-header-row .body-20 { max-width: 100%; }

  /* Hero image */
  .hero-image-block { aspect-ratio: 361 / 569; }

  /* Features */
  .three-col-grid { grid-template-columns: 1fr; }
  .three-col-grid { margin-bottom: 16px; }
  .image-card { aspect-ratio: 361 / 427; }
  .feature-icon.mobile-only { display: none; }

  /* Full-bleed cards: mobile ratio */
  .fullbleed-card { aspect-ratio: 361 / 700; }
  .fullbleed-top .heading-46 { max-width: 100%; }
  .fullbleed-bottom .body-20 { max-width: 100%; }

  /* Technology & R1: dark text on mobile */
  .fullbleed-card .fullbleed-top .heading-46.dark,
  .fullbleed-card .fullbleed-bottom .body-20.dark {
    color: var(--er-black);
  }

  /* Hide carousel indicators on fullbleed cards in mobile */
  .fullbleed-card .carousel-indicator.card-carousel {
    display: none;
  }

  /* Styles */
  .styles-section {
    padding: 0;
  }
  .two-col-grid { grid-template-columns: 1fr; }
  .style-card-img {
    aspect-ratio: 361 / 370;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px 56px;
  }
  .style-card-img .mobile-only-img {
    position: relative;
    inset: auto;
    width: 118%;
    max-width: none;
    height: auto;
    max-height: calc(100% - 4px);
    object-fit: contain;
    object-position: center;
    transform: translateY(18px);
  }
  .style-label {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.5px;
    font-feature-settings: 'case' 1;
    color: var(--er-black);
    left: 16px;
    bottom: 16px;
  }

  /* Testimonials: single card on mobile */
  .section-header-row--top { flex-direction: column; gap: 16px; }
  .testimonials-section .section-inner {
    padding: 0 16px;
  }
  .testimonials-section .heading-46 {
    font-size: 30px;
    line-height: 32px;
    letter-spacing: -1.5px;
  }
  .testimonials-track {
    gap: 0;
    transition: none;
    will-change: auto;
  }
  .testimonial-card {
    flex: 0 0 100%;
    display: block;
    scroll-snap-align: start;
  }
  .testimonial-photo {
    aspect-ratio: 1 / 1;
    height: auto;
  }
  .testimonials-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
  }
  .testimonials-carousel::-webkit-scrollbar {
    display: none;
  }
  .testimonials-progress {
    position: relative;
    left: auto;
    top: auto;
    margin: 12px auto 0;
    transform: none;
    z-index: auto;
  }
  .testimonial-card .testimonial-body {
    display: none;
  }
  .testimonial-mobile-copy {
    display: flex;
    margin-top: 16px;
  }
  .testimonial-body {
    min-height: auto;
    height: auto;
    background: transparent;
    padding: 0;
    margin-top: 24px;
    gap: 8px;
    overflow: visible;
  }
  .testimonial-name,
  .testimonial-text {
    padding: 0 0;
  }
  .testimonial-name {
    font-size: 14px;
    line-height: 16px;
    letter-spacing: -0.3px;
  }
  .testimonial-text {
    font-size: 14px;
    line-height: 16px;
    letter-spacing: -0.3px;
    color: #7B7B7B;
  }

  /* Team card: body text lighter on mobile */
  .fullbleed-card--team .fullbleed-bottom .body-20 {
    color: var(--er-gray-5);
  }

  /* Footer: switch to mobile layout */
  .footer {
    background: var(--er-gray-92);
    height: 48px;
  }
  .footer-inner { display: none; }
  .footer-inner-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
  }
}
