/* ==========================================================================
 *  Magic Data — About Us page stylesheet
 *
 *  Loaded only from page-about.php. Mirrors the design-system tokens
 *  from magicdata-home.css (--mdh-*) so both surfaces feel visually
 *  coherent. Uses --mda-* prefix for about-specific additions.
 *
 *  Sections (top → bottom):
 *    1. Hero          — headline + description + team photo + nebula
 *    2. CEO Quote     — portrait + pull-quote + credentials
 *    3. Stats + Langs — 1M+ / 100+ stat cards + language grid
 *    4. Clients       — logo wall + 50+ / 10+ metric cards
 * ======================================================================== */

/* ============================  Fonts  ============================ */
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ubuntu/ubuntu-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ubuntu/ubuntu-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/nunito-sans/nunito-sans-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/nunito-sans/nunito-sans-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/nunito-sans/nunito-sans-700.ttf') format('truetype');
}

/* ============================  Tokens  ============================ */
:root {
  --mda-bg: #000000;
  --mda-text: #f4f1f7;
  --mda-muted: rgba(244, 241, 247, 0.72);
  --mda-muted-2: rgba(244, 241, 247, 0.42);
  --mda-border: rgba(255, 255, 255, 0.14);
  --mda-border-soft: rgba(255, 255, 255, 0.08);

  --mda-accent: #c4b5fd;
  --mda-accent-strong: #a78bfa;
  --mda-accent-rgb: 196, 181, 253;

  --mda-fire: rgb(255, 131, 127);
  --mda-fire-rgb: 255, 131, 127;

  --mda-radius-card: 20px;
  --mda-radius-lg: 24px;

  --mda-font-display: 'Ubuntu', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mda-font-body: 'Nunito Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;

  --mda-shell: 1280px;
  --mda-shell-pad-x: 32px;
}

/* ============================  Full-bleed reset  ============================
 * Same pattern as magicdata-home.css — hides the compat scaffolding
 * that TwentyTwentyFive's get_header() fallback emits and ensures
 * edge-to-edge rendering. */

html:has(body.page-template-page-about),
html:has(body.page-template-page-about-php) {
  background: var(--mda-bg) !important;
  overflow-x: clip !important;
}
body.page-template-page-about,
body.page-template-page-about-php {
  background: var(--mda-bg) !important;
  margin: 0 !important;
  overflow-x: clip !important;
}

body.page-template-page-about #page,
body.page-template-page-about-php #page {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--mda-bg) !important;
}
body.page-template-page-about #header,
body.page-template-page-about-php #header,
body.page-template-page-about #page > hr:first-of-type,
body.page-template-page-about-php #page > hr:first-of-type,
body.page-template-page-about #footer,
body.page-template-page-about-php #footer {
  display: none !important;
}

body.page-template-page-about .wp-site-blocks,
body.page-template-page-about-php .wp-site-blocks,
body.page-template-page-about main,
body.page-template-page-about-php main,
body.page-template-page-about main .wp-block-group,
body.page-template-page-about-php main .wp-block-group,
body.page-template-page-about .wp-block-post-content,
body.page-template-page-about-php .wp-block-post-content {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: visible !important;
}

body.page-template-page-about .wp-block-post-title,
body.page-template-page-about-php .wp-block-post-title,
body.page-template-page-about .wp-block-post-featured-image,
body.page-template-page-about-php .wp-block-post-featured-image,
body.page-template-page-about .wp-block-post-date,
body.page-template-page-about-php .wp-block-post-date,
body.page-template-page-about .wp-block-post-terms,
body.page-template-page-about-php .wp-block-post-terms {
  display: none !important;
}

/* ============================  Main wrapper  ============================ */

.mdx-about {
  position: relative;
  background: var(--mda-bg);
  color: var(--mda-text);
  font-family: var(--mda-font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Shared shell — centers content and caps width */
.mdx-about__shell {
  width: 100%;
  max-width: var(--mda-shell);
  margin: 0 auto;
  padding: 0 var(--mda-shell-pad-x);
  box-sizing: border-box;
}

/* Generic section spacing */
.mdx-about__section {
  position: relative;
}

/* ========================================================================
 *  SECTION 1 — HERO
 * ======================================================================== */

.mdx-about__section--hero {
  position: relative;
  height: 540px;
  display: flex;
  align-items: center;
  padding-top: 0px;
  overflow: hidden;
}

.mdx-about__hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.mdx-about__hero-nebula {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.7;
  mix-blend-mode: screen;
}

.mdx-about__hero-photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 25%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  mix-blend-mode: lighten;
}

.mdx-about__hero-team-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 7.5%);
  mask-image: linear-gradient(to right, transparent 0%, #000 7.5%);
}

.mdx-about__hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      to top,
      var(--mda-bg) 0%,
      rgba(0,0,0,0.6) 8%,
      transparent 25%
    );
}

.mdx-about__hero-copy {
  position: relative;
  z-index: 2;
  max-width: 460px;
}

.mdx-about__hero-title {
  font-family: var(--mda-font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  background: linear-gradient(135deg, var(--mda-accent) 0%, var(--mda-fire) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mdx-about__hero-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--mda-muted);
  margin: 0;
  max-width: 420px;
}

/* ============================  HERO — responsive  ============================ */

@media (max-width: 599px) {
  .mdx-about__section--hero {
    height: 480px;
    padding-top: 40px;
    align-items: flex-start;
  }
  .mdx-about__hero-nebula {
    background-size: 140% auto;
    background-position: 50% -8%;
  }
  .mdx-about__hero-photo {
    left: 0;
    top: 20%;
    align-items: center;
  }
  .mdx-about__hero-team-img {
    object-fit: cover;
    object-position: center center;
    height: 100%;
    filter: brightness(0.42);
  }
  .mdx-about__hero-desc {
    text-shadow:
      0 0 24px rgba(0, 0, 0, 0.95),
      0 2px 8px rgba(0, 0, 0, 0.9);
  }
  .mdx-about__hero-copy {
    padding-top: 10px;
  }
}

@media (min-width: 600px) and (max-width: 839px) {
  .mdx-about__hero-photo {
    left: 10%;
  }
}

@media (min-width: 840px) {
  .mdx-about__section--hero {
    height: 560px;
  }
}

@media (min-width: 1280px) {
  .mdx-about__section--hero {
    height: 580px;
  }
  .mdx-about__hero-photo {
    left: 30%;
  }
  .mdx-about__hero-team-img {
    max-width: 900px;
  }
}

@media (min-width: 1600px) {
  .mdx-about__section--hero {
    height: 600px;
  }
  .mdx-about__hero-photo {
    left: 35%;
  }
  .mdx-about__hero-team-img {
    max-width: 1000px;
  }
}

/* ========================================================================
 *  SECTION 2 — CEO QUOTE
 * ======================================================================== */

.mdx-about__section--quote {
  padding: 100px 0;
}

.mdx-about__quote-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: center;
}

.mdx-about__quote-portrait {
  position: relative;
}

.mdx-about__quote-portrait img {
  width: 100%;
  height: auto;
  border-radius: var(--mda-radius-card);
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}

.mdx-about__blockquote {
  margin: 0 0 32px;
  padding: 0;
}

.mdx-about__blockquote p {
  font-family: var(--mda-font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0;
  font-synthesis: style;
  background: linear-gradient(135deg, var(--mda-accent) 0%, var(--mda-fire) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mdx-about__quote-credit {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mdx-about__quote-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--mda-text);
}

.mdx-about__quote-role {
  font-size: 15px;
  color: var(--mda-text);
  margin-bottom: 4px;
}

.mdx-about__quote-award {
  font-size: 13px;
  color: var(--mda-muted-2);
  line-height: 1.5;
}

/* ========================================================================
 *  SECTION 3 — STATS + LANGUAGES
 * ======================================================================== */

.mdx-about__section--stats {
  padding: 80px 0;
  border-top: 1px solid var(--mda-border-soft);
}

.mdx-about__stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.mdx-about__stats-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.mdx-about__stat-card {
  padding: 0;
}

.mdx-about__stat-num {
  display: block;
  font-family: var(--mda-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--mda-accent) 0%, var(--mda-fire) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mdx-about__stat-title {
  font-family: var(--mda-font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--mda-text);
  margin: 0 0 8px;
  line-height: 1.3;
}

.mdx-about__stat-desc {
  font-size: 13px;
  color: var(--mda-muted-2);
  margin: 0;
  line-height: 1.6;
}

/* Language grid */
.mdx-about__lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 24px;
  justify-items: start;
}

.mdx-about__lang-item {
  font-size: 15px;
  color: var(--mda-muted);
  padding: 8px 0;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.15),
    0 0 16px rgba(255, 255, 255, 0.06);
  transition:
    opacity 0.825s ease-in-out,
    filter 0.825s ease-in-out,
    color 0.15s ease,
    text-shadow 0.825s ease-in-out;
  opacity: 1;
  filter: blur(0px);
}

.mdx-about__lang-item:hover {
  color: var(--mda-text);
}

.mdx-about__lang-item.is-fading {
  opacity: 0;
  filter: blur(6px);
  text-shadow: none;
}

/* ========================================================================
 *  SECTION 4 — CLIENTS & METRICS
 * ======================================================================== */

.mdx-about__section--clients {
  padding: 80px 0 100px;
  border-top: 1px solid var(--mda-border-soft);
}

.mdx-about__clients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

/* Logo wall — left-aligned; rows share height, logos vertically centered per row */
.mdx-about__logo-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 32px;
  align-items: stretch;
  justify-items: start;
}

.mdx-about__logo-item {
  display: flex;
  align-items: center;
  justify-content: start;
  width: 100%;
}

.mdx-about__logo-item img {
  max-width: 100%;
  max-height: 28px;
  width: auto;
  height: auto;
  opacity: 0.7;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s ease;
}

.mdx-about__logo-item img:hover {
  opacity: 1;
}

/* Per-logo size overrides — mirrors homepage logo-strip tuning (max-height vs default 28px) */
.mdx-about__logo-item[data-logo="tencent"] img {
  max-height: 29px;
}
.mdx-about__logo-item[data-logo="ali"] img {
  max-height: 12px;
}
.mdx-about__logo-item[data-logo="meta"] img {
  max-height: 13px;
}
.mdx-about__logo-item[data-logo="naver"] img {
  max-height: 10px;
}
.mdx-about__logo-item[data-logo="zoom"] img {
  max-height: 14px;
}
.mdx-about__logo-item[data-logo="soundhound"] img {
  max-height: 14px;
}
.mdx-about__logo-item[data-logo="nvidia"] img {
  max-height: 14px;
}
.mdx-about__logo-item[data-logo="qualcomm"] img {
  max-height: 15px;
}

.mdx-about__logo-item[data-logo="byd"] img {
  max-height: 13px;
}

.mdx-about__logo-item[data-logo="cerence"] img {
  max-height: 16px;
}

.mdx-about__logo-item[data-logo="minimax"] img {
  max-height: 18px;
}

.mdx-about__logo-item[data-logo="ms"] img {
  max-height: 18px;
}

.mdx-about__logo-item[data-logo="apple"] img {
  max-height: 20px;
}

.mdx-about__logo-item[data-logo="baidu"] img {
  max-height: 18px;
}

.mdx-about__logo-item[data-logo="bilibili"] img {
  max-height: 18px;
}

.mdx-about__logo-item[data-logo="zai"] img {
  max-height: 18px;
}

/* Metric cards */
.mdx-about__metric-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.mdx-about__metric-card {
  padding: 0;
}

.mdx-about__metric-num {
  display: block;
  font-family: var(--mda-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--mda-accent);
  margin-bottom: 8px;
}

.mdx-about__metric-title {
  font-family: var(--mda-font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--mda-text);
  margin: 0 0 8px;
  line-height: 1.3;
}

.mdx-about__metric-desc {
  font-size: 13px;
  color: var(--mda-muted-2);
  margin: 0;
  line-height: 1.6;
}

/* ============================  Responsive  ============================ */

@media (max-width: 960px) {
  .mdx-about__quote-grid {
    grid-template-columns: 200px 1fr;
    gap: 40px;
  }

  .mdx-about__stats-grid,
  .mdx-about__clients-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 720px) {
  :root {
    --mda-shell-pad-x: 20px;
  }

  .mdx-about__section--quote {
    padding: 60px 0;
  }

  .mdx-about__quote-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .mdx-about__quote-portrait {
    max-width: 200px;
    margin: 0 auto;
  }

  .mdx-about__quote-credit {
    align-items: center;
  }

  .mdx-about__section--stats,
  .mdx-about__section--clients {
    padding: 60px 0;
  }

  .mdx-about__stats-cards,
  .mdx-about__metric-cards {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .mdx-about__lang-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
  }

  .mdx-about__logo-wall {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
  }

  /* 15 cells → 5×3 even columns (hide 16th while grid is 3 columns) */
  .mdx-about__lang-grid .mdx-about__lang-item:nth-child(16),
  .mdx-about__logo-wall .mdx-about__logo-item:nth-child(16) {
    display: none;
  }

  .mdx-about__logo-item img {
    max-height: 20px;
  }
}

@media (max-width: 480px) {
  .mdx-about__stats-cards,
  .mdx-about__metric-cards {
    grid-template-columns: 1fr;
  }

  /* Keep 3 columns for languages + logos (inherited from 720px); slightly tighter gaps */
  .mdx-about__lang-grid {
    gap: 10px 12px;
  }

  .mdx-about__logo-wall {
    gap: 10px 12px;
  }

  .mdx-about__logo-item img {
    max-height: 18px;
  }
}
