/* ==========================================================================
   Materia M3 — Type System
   The complete M3 type scale: display / headline / title / body / label,
   each in large / medium / small. Uses Roboto Flex with optical sizing.
   ========================================================================== */

:root {
    --md-sys-typescale-font-brand: 'Roboto Flex', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --md-sys-typescale-font-plain: 'Roboto Flex', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --md-sys-typescale-font-mono:  'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 16px;
    font-weight: 400;
    font-variation-settings: "opsz" 14;
}

body {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

/* ----- Display ----- */
.m3-typescale-display-large {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 57px;
    line-height: 64px;
    font-weight: 400;
    letter-spacing: -0.25px;
    font-variation-settings: "opsz" 144;
}
.m3-typescale-display-medium {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 45px;
    line-height: 52px;
    font-weight: 400;
    letter-spacing: 0;
    font-variation-settings: "opsz" 144;
}
.m3-typescale-display-small {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 36px;
    line-height: 44px;
    font-weight: 400;
    letter-spacing: 0;
    font-variation-settings: "opsz" 144;
}

/* ----- Headline ----- */
.m3-typescale-headline-large {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 32px;
    line-height: 40px;
    font-weight: 400;
    letter-spacing: 0;
}
.m3-typescale-headline-medium {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 28px;
    line-height: 36px;
    font-weight: 400;
    letter-spacing: 0;
}
.m3-typescale-headline-small {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 24px;
    line-height: 32px;
    font-weight: 400;
    letter-spacing: 0;
}

/* ----- Title ----- */
.m3-typescale-title-large {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 22px;
    line-height: 28px;
    font-weight: 400;
    letter-spacing: 0;
}
.m3-typescale-title-medium {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    letter-spacing: 0.15px;
}
.m3-typescale-title-small {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* ----- Body ----- */
.m3-typescale-body-large {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.m3-typescale-body-medium {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    letter-spacing: 0.25px;
}
.m3-typescale-body-small {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: 0.4px;
}

/* ----- Label ----- */
.m3-typescale-label-large {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    letter-spacing: 0.1px;
}
.m3-typescale-label-medium {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.m3-typescale-label-small {
    font-family: var(--md-sys-typescale-font-plain);
    font-size: 11px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ============= Default styling for native HTML elements ============= */
h1 {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 36px; line-height: 44px;
    font-weight: 400; letter-spacing: 0;
    margin: 1.5rem 0 1rem;
}
h2 {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 28px; line-height: 36px;
    font-weight: 400; letter-spacing: 0;
    margin: 1.5rem 0 1rem;
}
h3 {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 24px; line-height: 32px;
    font-weight: 400; letter-spacing: 0;
    margin: 1.25rem 0 0.75rem;
}
h4 {
    font-family: var(--md-sys-typescale-font-brand);
    font-size: 22px; line-height: 28px;
    font-weight: 400; letter-spacing: 0;
    margin: 1rem 0 0.5rem;
}
h5 {
    font-size: 16px; line-height: 24px;
    font-weight: 500; letter-spacing: 0.15px;
    margin: 1rem 0 0.5rem;
}
h6 {
    font-size: 14px; line-height: 20px;
    font-weight: 500; letter-spacing: 0.1px;
    margin: 1rem 0 0.5rem;
}

p {
    font-size: 16px; line-height: 24px;
    font-weight: 400; letter-spacing: 0.5px;
    margin: 0 0 1rem;
}

small {
    font-size: 12px;
    letter-spacing: 0.4px;
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
a:hover, a:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

strong, b { font-weight: 700; }
em, i { font-style: italic; }

code, kbd, pre, samp {
    font-family: var(--md-sys-typescale-font-mono);
    font-size: 0.9em;
}

code {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    padding: 0.125em 0.375em;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

pre {
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    padding: 1rem 1.25rem;
    border-radius: var(--md-sys-shape-corner-medium);
    overflow-x: auto;
    margin: 1rem 0;
    line-height: 1.5;
}

pre code {
    background: transparent;
    padding: 0;
}

kbd {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-bottom-width: 2px;
    padding: 0.125em 0.5em;
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-size: 0.85em;
}

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-container-low);
    border-radius: 0 var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-medium) 0;
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
}

blockquote p:last-child { margin-bottom: 0; }
blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}
blockquote cite::before { content: "— "; }

hr {
    border: 0;
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 2rem 0;
}

ul, ol {
    margin: 0 0 1rem;
    padding-left: 1.75rem;
}

li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

dl {
    margin: 0 0 1rem;
}

dt {
    font-weight: 500;
    margin-top: 0.75rem;
}

dd {
    margin: 0.25rem 0 0.75rem;
    padding-left: 1rem;
    color: var(--md-sys-color-on-surface-variant);
}

mark {
    background-color: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
    padding: 0.125em 0.25em;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

abbr[title] {
    text-decoration: underline dotted;
    text-decoration-color: var(--md-sys-color-outline);
    cursor: help;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 1.5rem 0;
    font-size: 14px;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

th {
    background-color: var(--md-sys-color-surface-container-low);
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

tbody tr {
    transition: background-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

tbody tr:hover {
    background-color: var(--md-sys-color-surface-container);
}

caption {
    caption-side: bottom;
    text-align: left;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
    padding: 0.5rem 0;
}

figure {
    margin: 1.5rem 0;
}

figcaption {
    margin-top: 0.5rem;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
}
