/*
  LinkMine design rules inspired by the referenced Apple system.
  Scope: typography, interaction rhythm, responsive text safety.
  The existing LinkMine colors, sections, imagery, and component concepts stay unchanged.
*/

:root {
  --lm-font-display: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --lm-font-text: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --lm-type-hero: 2.75rem;
  --lm-type-display: 2.5rem;
  --lm-type-section: 2.125rem;
  --lm-type-title: 1.3125rem;
  --lm-type-body: 1.0625rem;
  --lm-type-caption: 0.875rem;
  --lm-type-fine: 0.75rem;
  --lm-leading-display: 1.1;
  --lm-leading-body: 1.47;
  --lm-leading-loose: 1.72;
  --lm-weight-body: 400;
  --lm-weight-strong: 600;
  --lm-radius-utility: 0.5rem;
  --lm-radius-card: 1.125rem;
  --lm-radius-pill: 9999px;
  --lm-focus-ring: rgba(70, 215, 168, 0.38);
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--lm-font-text);
  font-size: var(--lm-type-body);
  font-weight: var(--lm-weight-body);
  line-height: var(--lm-leading-body);
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
.hero-copy h1,
.section-head h2,
.faq-hero h1,
.legal-hero h1,
.admin-header h1,
.mp-hero h1,
.mp-section h2,
.mp-product-section-cn,
.lp-hero h1,
.lp-section h2,
.lc-hero h1,
.lc-section h2,
#calculator-root h1 {
  font-family: var(--lm-font-display);
  font-weight: var(--lm-weight-strong);
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy h1,
.faq-hero h1,
.legal-hero h1,
.mp-hero h1,
.lp-hero h1,
.lc-hero h1,
#calculator-root h1 {
  font-size: var(--lm-type-hero);
  line-height: 1.07;
}

.section-head h2,
.mp-section h2,
.lp-section h2,
.lc-section h2,
.legal-card h2,
.admin-section-head h2 {
  font-size: var(--lm-type-section);
  line-height: var(--lm-leading-display);
}

.definition-card h3,
.why-card h3,
.pillar-card h3,
.unit-card h3,
.linkedin-card h3,
.mp-product-card h3,
.mp-engine-card h3,
.lp-section h3,
.lc-section h3,
.faq-question {
  font-family: var(--lm-font-display);
  font-size: var(--lm-type-title);
  font-weight: var(--lm-weight-strong);
  line-height: 1.24;
  letter-spacing: 0;
  text-wrap: balance;
}

p,
li,
label,
input,
textarea,
select,
button,
a,
.hero-copy p,
.section-head p,
.definition-card p,
.why-card p,
.pillar-card p,
.unit-card p,
.linkedin-copy,
.linkedin-card p,
.strategic-partners-copy p,
.partners-copy p,
.contact-form,
.mp-section p,
.lp-section p,
.lc-section p,
.faq-answer,
.legal-copy p,
.admin-note {
  font-family: var(--lm-font-text);
  font-weight: var(--lm-weight-body);
  letter-spacing: 0;
}

p,
li,
.hero-copy p,
.section-head p,
.definition-card p,
.why-card p,
.pillar-card p,
.unit-card p,
.linkedin-card p,
.mp-section p,
.lp-section p,
.lc-section p,
.faq-answer,
.legal-copy p {
  line-height: var(--lm-leading-body);
}

.section-kicker,
.loading-eyebrow,
.legal-hero p,
.legal-card > p,
.admin-header p,
.admin-section-head p,
.mp-eyebrow,
.mp-product-section-en,
.lp-eyebrow,
.lc-eyebrow,
#calculator-root [class*="uppercase"] {
  font-family: var(--lm-font-text);
  font-size: var(--lm-type-fine);
  font-weight: var(--lm-weight-strong);
  letter-spacing: 0;
}

a,
button,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

a,
button,
.hero-button,
.header-cta,
.mobile-cta,
.linkedin-cta,
.contact-form button,
.mp-button,
.mp-header-cta,
.mp-download-link,
.lp-button,
.lp-header-cta,
.lc-button,
.lc-header-cta,
.calculator-header-cta,
.legal-back,
.legal-tabs a,
.admin-card button,
.admin-header a {
  font-weight: var(--lm-weight-strong);
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--lm-focus-ring);
  outline-offset: 3px;
}

button:active,
.hero-button:active,
.header-cta:active,
.mobile-cta:active,
.linkedin-cta:active,
.contact-form button:active,
.mp-button:active,
.mp-header-cta:active,
.mp-download-link:active,
.lp-button:active,
.lp-header-cta:active,
.lc-button:active,
.lc-header-cta:active,
.calculator-header-cta:active,
.legal-back:active,
.legal-tabs a:active,
.admin-card button:active,
.admin-header a:active {
  transform: scale(0.97);
}

.hero-button,
.linkedin-cta,
.contact-form button,
.mp-button,
.mp-download-link,
.lp-button,
.lc-button,
.legal-tabs a,
.admin-card button {
  border-radius: var(--lm-radius-pill);
}

.header-cta,
.mobile-cta,
.mp-header-cta,
.lp-header-cta,
.lc-header-cta,
.calculator-header-cta,
.legal-back,
.admin-header a {
  border-radius: var(--lm-radius-utility);
}

.definition-card,
.why-card,
.pillar-card,
.unit-card,
.linkedin-card,
.strategic-partners-panel,
.partners-card,
.contact-card,
.faq-panel,
.legal-card,
.admin-card,
.mp-product-card,
.mp-engine-card,
.lp-section article,
.lc-section article,
#calculator-root [class*="rounded-"] {
  overflow-wrap: anywhere;
}

.site-footer,
.mp-site-footer,
.lp-site-footer,
.lc-site-footer,
.calculator-site-footer {
  font-size: var(--lm-type-fine);
}

.site-footer a,
.site-footer li,
.mp-site-footer a,
.mp-site-footer li,
.lp-site-footer a,
.lp-site-footer li,
.lc-site-footer a,
.lc-site-footer li,
.calculator-site-footer a,
.calculator-site-footer li {
  line-height: 2;
}

#calculator-root [class*="text-[32px]"],
#calculator-root [class*="text-[28px]"],
#calculator-root [class*="text-2xl"] {
  letter-spacing: 0;
}

#calculator-root [class*="font-semibold"],
#calculator-root [class*="font-medium"] {
  font-weight: var(--lm-weight-strong);
}

#calculator-root [class*="leading-7"] {
  line-height: var(--lm-leading-body);
}

@media (max-width: 780px) {
  :root {
    --lm-type-hero: 2.125rem;
    --lm-type-display: 1.875rem;
    --lm-type-section: 1.625rem;
    --lm-type-title: 1.125rem;
    --lm-type-body: 1rem;
  }

  .hero-copy h1,
  .faq-hero h1,
  .legal-hero h1,
  .mp-hero h1,
  .lp-hero h1,
  .lc-hero h1,
  #calculator-root h1 {
    line-height: 1.12;
  }

  .hero-copy h1 {
    font-size: clamp(1.48rem, 6.4vw, 2.1rem);
    letter-spacing: -0.02em;
    text-wrap: auto;
  }

  p,
  li,
  .hero-copy p,
  .section-head p,
  .mp-section p,
  .lp-section p,
  .lc-section p,
  .faq-answer,
  .legal-copy p {
    line-height: 1.58;
  }
}
