@font-face {
    font-family: 'Dorienne';
    src: url('../font/Dorienne-Variable.woff2?v=1.002') format('woff2-variations');
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
}

.typeface-view {
    min-width: 0;
    background: #fff;
}

.typeface-hero {
    position: relative;
    min-height: 14rem;
    display: grid;
    grid-template-rows: auto auto minmax(6rem, 1fr) auto;
    padding: var(--pad);
    padding-top: var(--space-6);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.typeface-hero__index {
    margin-bottom: var(--space-2);
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.typeface-hero__name {
    align-self: start;
    margin: 0;
    padding: 0;
    font-family: var(--display);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.typeface-hero__footer {
    display: contents;
}

.typeface-hero__intro {
    max-width: var(--measure);
    padding: var(--space-3) 2.5rem var(--space-5) 0;
    font-size: 0.98rem;
    line-height: 1.5;
}

.typeface-hero__intro p + p {
    margin-top: var(--space-3);
}

.typeface-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 calc(var(--pad) * -1) calc(var(--pad) * -1);
    border-top: 1px solid var(--line);
}

.typeface-facts div {
    min-height: 4.8rem;
    padding: var(--space-2) var(--pad);
}

.typeface-facts div + div {
    border-left: 1px solid var(--line);
}

.typeface-facts dt,
.typeface-section__number,
.typeface-comparison figcaption,
.typeface-specimen__meta {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.typeface-facts dd {
    margin: var(--space-1) 0 0;
}

.typeface-section {
    border-bottom: 1px solid var(--line);
}

.typeface-section__header {
    display: grid;
    grid-template-columns: 4rem minmax(12rem, 0.8fr) minmax(18rem, 1.2fr);
    gap: var(--pad);
    align-items: start;
    padding: var(--pad);
    border-bottom: 1px solid var(--line);
}

.typeface-section__header--compact {
    grid-template-columns: 4rem minmax(0, 1fr);
}

.typeface-section__header h2,
.typeface-download h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.typeface-section__copy {
    max-width: 58ch;
    font-size: 0.92rem;
    line-height: 1.48;
}

.typeface-section__copy p + p {
    margin-top: var(--space-3);
}

.typeface-source__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.typeface-source__figure {
    min-width: 0;
    border-top: 1px solid var(--line);
}

.typeface-source__figure:nth-child(3n) {
    border-left: 1px solid var(--line);
}

.typeface-source__figure:nth-child(3n + 1) {
    grid-column: 1 / -1;
    border-left: 0;
}

.typeface-source__figure--lead {
    border-top: 0;
}

.typeface-source__figure img {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
    background: #f5f5f2;
}

.typeface-source__figure--lead img {
    max-height: none;
}

.typeface-source__figure figcaption {
    min-height: 2.4rem;
    padding: var(--space-2) var(--pad);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.76rem;
}

.typeface-comparisons__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.typeface-comparison {
    min-width: 0;
}

.typeface-comparison__image {
    display: block;
    width: 100%;
    height: auto;
}

.typeface-specimen__row + .typeface-specimen__row {
    border-top: 1px solid var(--line);
}

.typeface-specimen__meta {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) var(--pad) 0;
}

.typeface-specimen__row p {
    padding: var(--space-3) var(--pad) var(--space-4);
    font-family: 'Dorienne', serif;
    font-size: clamp(3.7rem, 8.2vw, 9.5rem);
    font-weight: var(--sample-weight);
    font-stretch: normal;
    font-kerning: normal;
    font-feature-settings: "kern" 1, "liga" 1;
    font-variation-settings: "wght" var(--sample-weight);
    line-height: 0.88;
    letter-spacing: normal;
    overflow-wrap: break-word;
}

.typeface-tester__controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    border-bottom: 1px solid var(--line);
}

.typeface-tester__controls label {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-2);
    align-content: center;
    min-height: 5.3rem;
    padding: var(--space-2) var(--pad);
    font-size: 0.76rem;
}

.typeface-tester__controls label + label,
.typeface-tester__presets {
    border-left: 1px solid var(--line);
}

.typeface-tester__controls input {
    grid-column: 1 / -1;
    width: 100%;
    accent-color: #000;
}

.typeface-tester__presets {
    display: flex;
}

.typeface-tester__presets button {
    padding: 0 var(--space-3);
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
    cursor: pointer;
}

.typeface-tester__presets button:first-child {
    border-left: 0;
}

.typeface-tester__presets button:hover,
.typeface-tester__presets button.is-active {
    background: #000;
    color: #fff;
}

.typeface-tester__canvas {
    min-height: 58vh;
    padding: var(--space-4) var(--pad) var(--space-6);
    outline: 0;
    font-family: 'Dorienne', serif;
    font-size: 76px;
    font-weight: 400;
    line-height: 0.96;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.typeface-tester__canvas:focus {
    box-shadow: inset 0 0 0 2px #000;
}

.typeface-charset__grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.typeface-charset__glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 6.8rem;
    padding: var(--space-2);
    background: #fff;
    font-family: 'Dorienne', serif;
    font-size: clamp(2.7rem, 4.2vw, 4.8rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
}

.typeface-charset__glyph--wide {
    grid-column: span 2;
}

.typeface-download {
    display: grid;
    grid-template-columns: minmax(18rem, 0.9fr) minmax(24rem, 1.1fr);
    background: #000;
    color: #fff;
}

.typeface-download__heading {
    padding: var(--pad);
}

.typeface-download__heading .typeface-section__number {
    color: rgba(255, 255, 255, 0.62);
}

.typeface-download__heading h2 {
    margin-top: var(--space-3);
    font-size: 0.98rem;
}

.typeface-download__heading p {
    max-width: 40ch;
    margin-top: var(--space-4);
    line-height: 1.45;
}

.typeface-download__files {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #fff;
}

.typeface-download__files a {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--pad);
    border-bottom: 1px solid #fff;
}

.typeface-download__files a:last-child {
    border-bottom: 0;
}

.typeface-download__files a:hover {
    background: #fff;
    color: #000;
}

.typeface-download__credits {
    grid-column: 1 / -1;
    padding: var(--space-4) var(--pad);
    border-top: 1px solid #fff;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.76rem;
    line-height: 1.45;
}

@media (max-width: 1200px) {
    .typeface-section__header {
        grid-template-columns: 3rem minmax(10rem, 0.7fr) minmax(16rem, 1.3fr);
    }
}

@media (max-width: 760px) {
    .typeface-hero {
        min-height: 14rem;
    }

    .typeface-download {
        grid-template-columns: 1fr;
    }

    .typeface-facts,
    .typeface-download__files {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

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

    .typeface-facts div {
        border-left: 0;
    }

    .typeface-facts div:nth-child(2n) {
        border-left: 1px solid var(--line);
    }

    .typeface-facts div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .typeface-section__header {
        grid-template-columns: 2.2rem 1fr;
    }

    .typeface-charset__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .typeface-charset__glyph {
        min-height: 5.4rem;
        font-size: clamp(2.4rem, 11vw, 4rem);
    }

    .typeface-section__copy {
        grid-column: 2;
    }

    .typeface-source__grid,
    .typeface-comparisons__list {
        grid-template-columns: 1fr;
    }

    .typeface-source__figure,
    .typeface-source__figure:nth-child(3n),
    .typeface-comparison:nth-child(2n),
    .typeface-comparison:nth-child(n + 3) {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .typeface-source__figure--lead {
        border-top: 0;
    }

    .typeface-tester__controls {
        grid-template-columns: 1fr;
    }

    .typeface-tester__controls label + label,
    .typeface-tester__presets {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .typeface-tester__presets button {
        flex: 1 1 0;
        min-height: 3.2rem;
    }

    .typeface-tester__canvas {
        min-height: 44vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .typeface-tester__canvas {
        scroll-behavior: auto;
    }
}
