@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap");

/*
 * Shared typography for public-facing pages.
 *
 * This mirrors the hierarchy already used by the authenticated sidebar:
 * rounded, compact headings; comfortable copy; and strong uppercase labels.
 * Layout, component sizing, colours and interactions stay page-owned.
 */
:root {
    --public-rounded-font: "Nunito", "Arial Rounded MT Bold", "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --public-heading-tracking: -0.022em;
    --public-label-tracking: 0.035em;
}

body,
button,
input,
select,
textarea,
optgroup,
option {
    font-family: var(--public-rounded-font) !important;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/*
 * Several public stylesheets set Poppins on their own components.  Applying
 * the family to text-bearing elements prevents those declarations from
 * silently winning over an inherited body font.
 */
body :where(
    h1, h2, h3, h4, h5, h6,
    p, a, span, li, label, legend,
    strong, b, small, summary,
    blockquote, figcaption, caption,
    dt, dd, th, td
) {
    font-family: var(--public-rounded-font) !important;
}

/* Rounded display hierarchy visible in the Duolingo references. */
body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
    font-style: normal;
}

body h1 {
    font-weight: 900 !important;
    letter-spacing: var(--public-heading-tracking) !important;
    line-height: 1.08;
}

body h2 {
    font-weight: 800 !important;
    letter-spacing: -0.018em !important;
    line-height: 1.12;
}

body h3 {
    font-weight: 800 !important;
    letter-spacing: -0.012em !important;
    line-height: 1.18;
}

body h4,
body h5,
body h6 {
    font-weight: 800 !important;
    letter-spacing: -0.008em !important;
    line-height: 1.2;
}

body p,
body li,
body dd,
body td {
    font-weight: 500;
}

body strong,
body b,
body th,
body label,
body legend,
body summary {
    font-weight: 800 !important;
}

body input:not([type="button"]):not([type="submit"]):not([type="reset"]),
body select,
body textarea {
    font-weight: 600;
}

body input::placeholder,
body textarea::placeholder {
    font-weight: 500;
}

/*
 * Duolingo treats navigation and actions as labels rather than body copy.
 * Match the sidebar's exact 800 / .035em / uppercase treatment.
 */
body :where(
    .nav-links a,
    .mobile-menu a,
    .mobile-nav a,
    .btn,
    [class*="btn-"],
    button,
    input[type="button"],
    input[type="submit"],
    input[type="reset"]
) {
    font-weight: 800 !important;
    letter-spacing: var(--public-label-tracking) !important;
    line-height: 1.15;
    text-transform: uppercase;
}

/* Compact Duolingo-like labels used by cards, badges and section kickers. */
body :where(
    .badge,
    .section-badge,
    .hero-badge,
    .plan-badge,
    .feature-badge,
    .eyebrow,
    .kicker
) {
    font-weight: 800 !important;
    letter-spacing: var(--public-label-tracking) !important;
}

body .footer h3 {
    font-weight: 800 !important;
    letter-spacing: -0.008em !important;
}

body .footer-links a {
    font-weight: 700 !important;
}

/* Keep the product wordmark aligned with the authenticated sidebar. */
.logo-text {
    font-family: "Poppins", "Inter", system-ui, sans-serif !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em !important;
    line-height: 1 !important;
}

/* Landing wordmark: isolated from legacy `.logo-text` rules so the exact
 * Medicina sidebar lockup cannot be overridden by page-specific bundles. */
body.external-page .navbar .logo-icon {
    display: none !important;
}

html body.external-page .navbar a.logo > .studiverse-public-wordmark {
    display: inline-block !important;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    color: #2f6bff !important;
    background: none !important;
    font-family: "Poppins", "Inter", system-ui, sans-serif !important;
    font-size: 1.48rem !important;
    font-style: normal !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em !important;
    line-height: 1 !important;
    opacity: 1 !important;
    text-transform: none !important;
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor !important;
}

html body.external-page .navbar a.logo:is(:hover, :focus, :focus-visible, :active, :visited) > .studiverse-public-wordmark {
    color: #2f6bff !important;
    background: none !important;
    filter: none !important;
    transform: none !important;
    -webkit-text-fill-color: currentColor !important;
}

/* External navigation is the deliberate lowercase exception to CTA labels. */
body.external-page :is(.nav-links, .mobile-menu, .mobile-nav) a {
    text-transform: lowercase !important;
}

/* Public navigation needs a clear but restrained emphasis. Weight 700 keeps
 * the four primary destinations readable without competing with the brand. */
html body.external-page .navbar .nav-links a,
html body.external-page .navbar .nav-links a.highlighted,
html body.external-page .mobile-menu .mobile-links a {
    font-weight: 700 !important;
}

/* Keep this sentence readable as copy, not as an all-caps CTA label. */
body.external-page :is(.navbar, .mobile-auth-buttons) .btn-enter {
    text-transform: lowercase !important;
}

/* Technical identifiers in the legal pages must remain unmistakably code. */
code,
pre,
kbd,
samp {
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
}
