/* ============================================================
   Lingyi Information — English site typography & layout deltas
   Loaded after style.css / theme-light.css on every /en/ page.
   The Chinese site keeps its own font stack; this file only
   adjusts Latin typesetting, wrapping and a few dense rows.
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Helvetica, Arial, "Noto Sans", sans-serif;
  --en-measure: 64ch;
}

html {
  background: #ffffff;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
}

.section-title,
.hero-ed-title,
.hero-title,
.page-hero-title,
.contact-hero-title,
.head-title,
.moe-title,
.news-card-title,
.news-post-title,
.value-card-title,
.process-title,
.privacy-section h2,
.advantage-card-title,
.portfolio-card-title,
.service-slide-title,
.news-related-title,
.news-post-content h2,
.news-post-content h3,
.news-post-callout-title,
.footer-title {
  font-family: var(--font-sans);
}

/* ---------- display type ---------- */
.hero-ed-title,
.page-hero-title,
.contact-hero-title,
.hero-title {
  letter-spacing: -0.035em;
  line-height: 1.03;
  text-wrap: balance;
}

.hero-ed-title {
  font-size: clamp(42px, 6.4vw, 88px);
  max-width: none;
}

.product-h1-sub {
  display: block;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 0.42em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-hero-title,
.contact-hero-title {
  font-size: clamp(40px, 5.6vw, 76px);
  max-width: 900px;
}

.about-hero-text .page-hero-title,
.about-hero-text .contact-hero-title {
  font-size: clamp(38px, 5vw, 72px);
}

/* English section labels don't need the Chinese kicker */
.section-label i {
  display: none;
}

.page-hero-title .title-line,
.contact-hero-title .title-line {
  overflow-wrap: break-word;
}

.head-title,
.section-title {
  text-wrap: balance;
}

.head-title {
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.section-title {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-ed-desc,
.head-desc,
.page-hero-desc,
.section-desc,
.svc-desc,
.moe-desc {
  text-wrap: pretty;
}

.hero-ed-desc {
  max-width: 46ch;
  line-height: 1.7;
}

.head-desc {
  max-width: 58ch;
  line-height: 1.7;
}

.hero-ed-meta {
  letter-spacing: 0.11em;
}

.eyebrow {
  letter-spacing: 0.14em;
}

/* Chinese display titles sometimes use a hard <br>; English
   versions still read fine, but avoid orphan words when possible. */
.hero-ed-title br,
.page-hero-title br {
  display: block;
}

/* ---------- navigation ---------- */
.navbar-menu a {
  white-space: nowrap;
}

.navbar-logo {
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.lang-switch {
  display: none;
}

@media (min-width: 1024px) {
  .lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 34px;
    margin-right: 10px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  }

  .lang-switch:hover {
    color: var(--ink);
    border-color: #cbd5e1;
    background: #f8fafc;
  }
}

.navbar-cta {
  white-space: nowrap;
}

.mobile-menu .mobile-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
}

.mobile-menu .mobile-lang a {
  color: var(--primary);
  font-weight: 600;
}

/* English nav has one more item than Chinese; tighten gaps */
@media (min-width: 1024px) and (max-width: 1180px) {
  .navbar-menu a {
    padding-left: 11px;
    padding-right: 11px;
    font-size: 13.5px;
  }

  .navbar-logo {
    font-size: 18px;
  }
}

/* ---------- dense rows / cards ---------- */
.svc-row {
  grid-template-columns: 56px minmax(230px, 300px) minmax(0, 1fr) 44px;
}

.sol-index a {
  min-width: 0;
  min-height: 96px;
}

.sol-index a i {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.4;
}

.sol-index a b {
  line-height: 1.3;
}

.svc-name {
  font-size: clamp(21px, 2.2vw, 25px);
  line-height: 1.2;
}

.svc-tags {
  line-height: 1.5;
}

.builder-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.builder-fact b {
  letter-spacing: -0.015em;
}

.lw-mode-head {
  align-items: flex-start;
}

.lw-mode-ask,
.moe-cap-desc,
.lw-mode-list li {
  text-wrap: pretty;
}

.moe-desc {
  max-width: 66ch;
}

.moe-title {
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.moe-sys-name,
.moe-cap-title {
  text-wrap: balance;
}

.hx-node,
.hx-cap,
.hx-ev {
  white-space: nowrap;
}

.hx-engine-chips {
  gap: 6px;
}

.hx-engine-chips span {
  padding: 6px 5px;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.hx-events {
  gap: 8px 10px;
  padding: 12px 14px;
}

.hx-ev {
  font-size: 10.5px;
}

/* English copy is longer; give the hero architecture diagram room */
.harness-promo-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

/* ---------- page hero ---------- */
.page-hero--about,
.about-hero-text {
  text-align: left;
}

.en-page-faq .page-hero,
.en-page-privacy .page-hero {
  text-align: center;
}

.en-page-faq .page-hero,
.en-page-privacy .page-hero {
  padding-bottom: 36px;
}

.contact-hero-title {
  font-size: clamp(34px, 4.2vw, 58px);
}

.contact-hero-desc {
  max-width: 44ch;
}

.contact-hero-number-value {
  font-size: clamp(30px, 3.6vw, 48px);
  white-space: nowrap;
}

.about-hero-text {
  max-width: 760px;
}

.about-hero-badge-label {
  letter-spacing: 0.08em;
}

/* ---------- cards / lists ---------- */
.value-card-title,
.timeline-title,
.adv-ed-title {
  letter-spacing: -0.02em;
}

.faq-question {
  font-size: 17px;
  line-height: 1.45;
  text-align: left;
}

.privacy-section h2 {
  letter-spacing: -0.02em;
}

/* ---------- forms ---------- */
.inquiry-field label,
.form-label,
.inquiry-consent label {
  letter-spacing: 0;
}

.inquiry-contact-row {
  grid-template-columns: 110px minmax(0, 1fr);
}

/* ---------- footer ---------- */
.footer-brand p {
  max-width: 34ch;
}

.footer {
  text-wrap: pretty;
}

/* ---------- Insights / article typography ---------- */
.news-post-content {
  max-width: 860px;
  margin: 0 auto;
  text-wrap: pretty;
}

.news-post-content p,
.news-post-content li {
  color: #4b5563;
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.news-post-content .news-post-table-wrap {
  width: calc(100% + 120px);
  margin: 24px 0 24px -60px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

@media (max-width: 1099px) {
  .news-post-content .news-post-table-wrap {
    width: 100%;
    margin-left: 0;
  }
}

.news-row-cat {
  color: var(--primary);
}

.news-post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
}

.news-post-content th,
.news-post-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  min-width: 110px;
}

.news-post-content th {
  background: #f7f9fc;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.news-post-content td {
  color: #4b5563;
}

.news-post-content tr:last-child td {
  border-bottom: 0;
}

.news-post-content code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.news-post-content .source-list {
  margin: 20px 0 0;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

.news-post-content .source-list li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.news-post-content .source-list a {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.news-post-content .author-box {
  margin: 40px 0 0;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f7f9fc;
}

.news-post-content .author-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
}

.news-post-content .author-box p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.en-news-more {
  margin: 28px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

.en-news-more a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- visual QA: ?noanim + animation failure fallback ---------- */
html.no-anim .page-transition-overlay,
html.no-anim .loading-bar,
html.anim-fallback .page-transition-overlay,
html.anim-fallback .loading-bar {
  display: none !important;
}

html.no-anim .fade-in,
html.no-anim #navbar,
html.anim-fallback .fade-in,
html.anim-fallback #navbar,
html.no-anim .stat-ed,
html.no-anim .news-card,
html.no-anim .faq-item,
html.anim-fallback .stat-ed,
html.anim-fallback .news-card,
html.anim-fallback .faq-item {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  .hero-ed-title {
    font-size: clamp(38px, 11vw, 58px);
    max-width: none;
  }

  .head-title,
  .section-title {
    font-size: clamp(28px, 8vw, 38px);
  }

  .page-hero-title,
  .contact-hero-title {
    font-size: clamp(36px, 10vw, 56px);
  }

  .svc-row {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .builder-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inquiry-contact-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .harness-promo-grid {
    grid-template-columns: 1fr;
  }
}
