/*
 * SEVI Typography & Readability v1.0
 * Keeps the original cosmic visual system and component layout, while raising
 * text size, contrast, font weight, line length and control target sizes.
 */

:root {
  --font-ko: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-vi: "Be Vietnam Pro", Inter, Arial, system-ui, sans-serif;
  --sevi-font: var(--font-ko);

  --read-nav: 15px;
  --read-kicker: 11.5px;
  --read-micro: 11px;
  --read-helper: 13px;
  --read-small: 14px;
  --read-card: 14.5px;
  --read-label: 14px;
  --read-input: 16px;
  --read-body: 17px;
  --read-lead: 18px;
  --read-button: 15px;
  --read-footer: 13px;
  --read-legal: 16px;
  --read-legal-table: 14px;
}

html[lang="ko"] { --sevi-font: var(--font-ko); }
html[lang="vi"] { --sevi-font: var(--font-vi); }

html.readability-large {
  --read-nav: 16.5px;
  --read-kicker: 13px;
  --read-micro: 12.5px;
  --read-helper: 14.5px;
  --read-small: 15.5px;
  --read-card: 16px;
  --read-label: 15.5px;
  --read-input: 17.5px;
  --read-body: 19px;
  --read-lead: 20px;
  --read-button: 16.5px;
  --read-footer: 14.5px;
  --read-legal: 18px;
  --read-legal-table: 15.5px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
button,
input,
textarea,
select {
  font-family: var(--sevi-font);
}

body {
  font-weight: 450;
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

/* Language-sensitive headline tracking. */
html[lang="ko"] :is(.hero h1, .section-heading h2, .verification-copy h2, .network-copy h2, .final-cta-copy h2, .form-intro h1, .enterprise-intro h1, .content-hero h1, .content-section h2, .scope-panel h2, .legal-document h2) {
  letter-spacing: -0.035em;
}
html[lang="vi"] :is(.hero h1, .section-heading h2, .verification-copy h2, .network-copy h2, .final-cta-copy h2, .form-intro h1, .enterprise-intro h1, .content-hero h1, .content-section h2, .scope-panel h2, .legal-document h2) {
  letter-spacing: -0.025em;
}
html[lang="vi"] :is(.form-intro h1, .enterprise-intro h1, .content-hero h1) {
  font-size: clamp(2.65rem, 4.7vw, 4.8rem);
  line-height: 1.13;
}

/* Header, controls and global copy. */
.primary-nav > a { font-size: var(--read-nav); font-weight: 550; }
.button { font-size: var(--read-button); font-weight: 650; }
.text-link { font-size: var(--read-small); }
.section-kicker,
.eyebrow { font-size: var(--read-kicker); letter-spacing: 0.11em; font-weight: 650; }
.section-heading > p,
.section-heading--split > p,
.verification-copy > p,
.network-copy > p { max-width: 46rem; font-size: var(--read-body); font-weight: 450; }
.hero-lead { max-width: 45rem; font-size: var(--read-lead); color: #b1bcc6; font-weight: 450; }
.hero-disciplines { font-size: var(--read-micro); color: #7f8d9a; letter-spacing: 0.1em; }

/* Compact display controls retain the original navigation footprint. */
.language-switch { gap: 4px; }
.language-button,
.readability-button {
  min-width: 36px;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: #8796a3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.readability-button { border-left: 1px solid rgba(159,205,229,.12); border-radius: 0 999px 999px 0; }
.language-button:hover,
.readability-button:hover { color: #dff7fc; }
.language-button.is-active,
.readability-button.is-active {
  background: rgba(140,231,255,.11);
  color: #f1fcff;
  box-shadow: inset 0 0 0 1px rgba(140,231,255,.16);
}
.readability-button:focus-visible { outline-offset: 2px; }

/* Former 7–10px information labels: minimum readable micro scale. */
:is(.brand-copy small, .signal-label small, .scroll-cue, .console-status strong, .console-bar small,
.brief-examples > span, .result-cell small, .constellation-core small, .constellation-node small,
.process-number, .process-label, .team-label, .network-legend, .region-node small, .map-caption,
.profile-code, .profile-status, .profile-card dt, .profile-tags span, .verification-grid span,
.form-principles span, .form-panel-head > div p, .form-panel-head > span, .precision-form legend span,
.field-with-suffix em, .mandate-flow > div span, .aside-card > p:first-child, .aside-contact small,
.signal-list li > span, .aside-metric, .taxonomy-card > span, .principle-stack span) {
  font-size: var(--read-micro);
  letter-spacing: .09em;
}

/* Home cards, systems and diagrams. */
.signal-label strong,
.region-node strong { font-size: var(--read-small); }
.console-status strong,
.console-bar small { color: #9aa9b5; }
.brief-examples > span,
.result-cell small,
.constellation-node small,
.process-label,
.team-label,
.region-node small,
.map-caption,
.profile-code,
.profile-status,
.profile-card dt,
.verification-grid span { color: #748592; }
.brief-examples button { min-height: 36px; font-size: var(--read-helper); color: #95a4af; }
.result-cell strong { font-size: var(--read-card); }
.capability-copy p,
.process-step p,
.network-copy p,
.profile-card > p,
.profile-card dd,
.verification-grid strong { font-size: var(--read-card); font-weight: 450; }
.capability-skill-list li,
.team-role strong,
.team-role small { font-size: var(--read-small); }
.network-legend { color: #81909c; }
.profile-tags span { color: #8394a1; }

/* Inner-page narrative copy. */
.form-intro > p:not(.section-kicker),
.enterprise-intro > p:not(.section-kicker),
.content-hero > p:last-child { max-width: 47rem; color: #9facb7; font-size: var(--read-body); font-weight: 450; }
.content-section > div > p:not(.section-kicker),
.content-section-head > p:not(.section-kicker),
.scope-panel > p:not(.section-kicker) { max-width: 48rem; color: #92a1ad; font-size: var(--read-body); font-weight: 450; }
.taxonomy-card > p,
.principle-stack p,
.region-tags span { font-size: var(--read-card); color: #8999a5; }
.taxonomy-card li { font-size: var(--read-small); color: #aab7c0; }
.principle-stack strong { font-size: 17px; }

/* Candidate and employer forms. */
.form-principles strong { font-size: 15px; font-weight: 550; color: #c8d5dc; }
.form-principles small { font-size: var(--read-helper); color: #7d8c98; line-height: 1.6; }
.form-panel-head > div p,
.form-panel-head > span { color: #7d8e9c; }
.form-panel-head h2 { font-size: 18px; font-weight: 600; }
.precision-form legend { font-size: 15px; letter-spacing: .045em; }
.field { gap: 9px; }
.field > span { color: #b0bdc6; font-size: var(--read-label); font-weight: 550; }
.field input,
.field textarea,
.field select { font-size: var(--read-input); font-weight: 450; }
.field input::placeholder,
.field textarea::placeholder { color: #758594; opacity: 1; }
.field > small:not(.field-error),
.field-error { color: #82929f; font-size: var(--read-helper); line-height: 1.55; }
.field-error { color: #ff9da5; }
.field-with-suffix em { color: #81919e; }
.upload-zone strong { font-size: 15px; font-weight: 550; }
.upload-zone small { color: #7e8f9c; font-size: var(--read-helper); }
.check-field { color: #9ba9b4; font-size: var(--read-small); line-height: 1.7; }
.check-field b { color: #d1dce1; font-weight: 600; }
.check-ui { width: 20px; height: 20px; }
.consent-note { color: #a89981; font-size: var(--read-helper); line-height: 1.7; }
.form-feedback { font-size: var(--read-small); }
.form-submit { min-height: 56px; }

/* Employer side rail and mandate flow. */
.mandate-flow strong { font-size: var(--read-small); }
.mandate-flow small { color: #7d8b97; font-size: var(--read-helper); }
.aside-card > p:first-child,
.aside-contact small { color: #778895; }
.signal-list strong { font-size: var(--read-small); color: #bbc8d0; }
.signal-list small { color: #7f8e9a; font-size: var(--read-helper); }
.aside-copy { color: #91a0ac; font-size: var(--read-small); }
.aside-metric { color: #7d8d99; }
.aside-contact a { min-height: 32px; display: inline-flex; align-items: center; font-size: var(--read-small); }

/* Footer: larger type and safer click targets. */
.footer-brand p { color: #83919d; font-size: var(--read-small); }
.footer-column strong { font-size: var(--read-footer); }
.footer-column a,
.footer-column span { color: #81909c; font-size: var(--read-footer); }
.footer-column a { min-height: 34px; display: inline-flex; align-items: center; }
.footer-bottom { color: #748592; font-size: var(--read-footer); letter-spacing: .035em; }
.footer-bottom a { min-height: 40px; display: inline-flex; align-items: center; }

/* Legal documents: body-first reading scale and controlled line length. */
.legal-banner { color: #c5ad8c; font-size: var(--read-helper); }
.legal-overline,
.legal-version-badge,
.legal-summary-grid article > span,
.legal-meta-grid span,
.legal-contact-card span,
.legal-table th { font-size: var(--read-micro) !important; letter-spacing: .08em; }
.legal-intro { max-width: 52rem; color: #afbbc3 !important; font-size: var(--read-body) !important; }
.legal-summary-grid strong { font-size: 16px; }
.legal-summary-grid p { color: #8e9da8 !important; font-size: var(--read-helper) !important; line-height: 1.75 !important; }
.legal-toc > strong { font-size: var(--read-helper); }
.legal-toc li::before { color: #708694; font-size: var(--read-micro); }
.legal-toc a { color: #a4b2bc; font-size: var(--read-small); line-height: 1.55; }
.legal-document .legal-section h3 { font-size: 22px; letter-spacing: -.015em; }
.legal-document .legal-section h4 { font-size: 16px; }
.legal-document p,
.legal-document li { color: #a5b1ba; font-size: var(--read-legal); line-height: 1.85; font-weight: 450; }
.legal-document .legal-section > :is(p, ul, ol, .legal-note, .legal-callout) { max-width: 54rem; }
.legal-meta-grid strong,
.legal-contact-card strong,
.legal-contact-card a { font-size: var(--read-small); }
.legal-table th { color: #a4b6c0; }
.legal-table td { color: #a3afb8; font-size: var(--read-legal-table); line-height: 1.8; }
.legal-callout strong { font-size: var(--read-small); }
.privacy-request-intro { max-width: 52rem; color: #98a7b2; font-size: var(--read-small); }
.legal-effective { color: #81919d; font-size: var(--read-helper); }

/* Readability mode enlarges meaningful copy without inflating cinematic headlines. */
html.readability-large .precision-form { padding-left: 42px; padding-right: 42px; }
html.readability-large .legal-document { max-width: 1180px; }
html.readability-large .legal-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }

@media (max-width: 1100px) {
  .primary-nav { gap: 14px; }
  .language-button,
  .readability-button { min-width: 34px; padding: 0 7px; }
}

@media (max-width: 900px) {
  .language-button,
  .readability-button { min-width: 48px; min-height: 40px; font-size: 12px; }
  .readability-button { border-left-color: rgba(159,205,229,.18); }
}

@media (max-width: 640px) {
  :root { --read-body: 16px; --read-lead: 17px; --read-input: 16px; --read-legal: 16px; }
  html.readability-large { --read-body: 18px; --read-lead: 19px; --read-input: 17px; --read-legal: 18px; }
  html[lang="vi"] :is(.form-intro h1, .enterprise-intro h1, .content-hero h1) { font-size: clamp(2.35rem, 10.5vw, 3.45rem); }
  .legal-summary-grid { grid-template-columns: 1fr; }
  .legal-document .legal-section h3 { font-size: 20px; }
  .precision-form,
  html.readability-large .precision-form { padding-left: 22px; padding-right: 22px; }
}

@media print {
  .readability-button { display: none !important; }
  .legal-document p,
  .legal-document li { font-size: 11pt !important; color: #222 !important; }
  .legal-table td { font-size: 9.5pt !important; color: #222 !important; }
}

/* Final microcopy pass: no meaningful operational label remains at 8–10px. */
.capability-node > span {
  font-size: var(--read-micro);
  color: #718391;
  font-weight: 650;
  letter-spacing: .08em;
}
.capability-node > small {
  font-size: var(--read-helper);
  color: #7f8f9b;
  font-weight: 500;
  line-height: 1.4;
}
.constellation-core > small,
.detail-index,
.system-topbar > span,
.system-copy > small,
.team-row > em {
  font-size: var(--read-micro);
  letter-spacing: .08em;
}
.detail-index,
.system-copy > small { font-weight: 650; }
.system-topbar > span { color: #82929f; }
.team-avatar {
  font-size: var(--read-helper);
  font-weight: 650;
}
.team-row small {
  font-size: var(--read-helper);
  color: #7f8e9a;
  font-weight: 450;
  line-height: 1.45;
}
.team-row > em { color: #7a8b98; }

/* Inline navigation and legal contacts receive a reliable pointer target. */
.text-link,
.legal-toc a,
.legal-contact-card a,
.legal-document a[href^="mailto:"],
.legal-document a[href^="tel:"] {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

/* Text zoom proxy: switch the enterprise form before minimum columns overflow. */
@media (max-width: 980px) {
  .enterprise-grid { grid-template-columns: minmax(0, 1fr); }
  .enterprise-aside {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .aside-contact { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .capability-node > small { font-size: 12px; }
  .team-row small { font-size: 12px; }
  .enterprise-aside { grid-template-columns: minmax(0, 1fr); }
  .aside-contact { grid-column: auto; }
}

/* Vietnamese headings use shorter copy plus a language-specific scale/balance. */
:is(.hero h1, .form-intro h1, .enterprise-intro h1, .content-hero h1) {
  text-wrap: balance;
}
html[lang="vi"] body[data-page="candidate"] .form-intro h1 {
  font-size: clamp(2.65rem, 4.05vw, 4.2rem);
  line-height: 1.14;
  letter-spacing: -.02em;
}
@media (max-width: 640px) {
  html[lang="vi"] body[data-page="candidate"] .form-intro h1 {
    font-size: clamp(2.35rem, 10.5vw, 3.35rem);
    line-height: 1.15;
  }
}
