/* FONT PAGE (shared by every font page, loaded after /styles.css).
   Typeface text is drawn as SVG by js/fp-type.js; CSS here only sets size, weight, style, colour, spacing.
   Scene layouts of each page live in that page's own <style>. */

:root {
    --fp-light: #E5E6E0;
    --fp-dark: #1D1D1D;
    --fp-accent: #E4B877;
    --fp-gutter: clamp(16px, 3vw, 52px);
    --fp-header: 76px; /* measured from header.html by js/font-page.js */

    /* type tokens */
    --D1: clamp(88px, 16vw, 248px);
    --D2: clamp(64px, 11vw, 168px);
    --D3: clamp(44px, 6.5vw, 100px);
    --H1: clamp(30px, 3.6vw, 56px);
    --H2: clamp(22px, 2.4vw, 36px);
    --B: 16px;
    --S: 15px;   /* R12: 15px is the floor for all text (verify-min15.mjs) */
}

::selection {
    background: #E4B877;
    color: #1D1D1D;
}

/* resets with zero specificity: any page class wins over them */
:where(.fp-main, .fp-footer) :where(p, h1, h2, h3, ul, ol) {
    margin: 0;
    padding: 0;
}

/* styles.css sets h2 { color:#1d1d1d; line-height:32px; letter-spacing:.2px } for the old pages */
.fp-main h1,
.fp-main h2,
.fp-main h3 {
    color: inherit;
}

/* styles.css also sets h2 line-height 32px: headings inherit instead. (0,1,0) beats styles.css h2 (0,0,1),
   and the D/H tokens and page classes come later, so they still win */
.fp-main :where(h1, h2, h3) {
    line-height: inherit;
    letter-spacing: inherit;
}

/* headings take their container's weight (zero specificity, so every page class can still set its own) */
:where(.fp-main) :where(h1, h2, h3) {
    font-weight: inherit;
}

.fp-main ul,
.fp-main ol {
    list-style: none;
}

.fp-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* the header drawer must cover the fixed buttons on mobile.
   header.html re-inserts /styles.css after this file, so this needs higher specificity, not a later position */
body .drawer {
    z-index: 10;
}


/* DRAWN TEXT */

[data-fp] {
    position: relative;
}

.fp-svg {
    display: block;
    overflow: visible;
    max-width: none;
}

/* block hosts: the svg follows the host's width (the attribute width is only the last layout) */
[data-fp]:not([data-fp="fit"]) > .fp-svg {
    width: 100%;
}

[data-fp="fit"] {
    display: block;
    flex: none;
}


/* LOADING */

.fp-scene,
.fp-tester,
.fp-actions {
    transition: opacity 300ms ease;
}

.fp-loading .fp-scene,
.fp-loading .fp-tester,
.fp-loading .fp-actions {
    opacity: 0;
}


/* TYPE TOKENS (size + default line-height/tracking) */

.D1, .D2, .D3 { line-height: .92; letter-spacing: -0.02em; }
.D1 { font-size: var(--D1); }
.D2 { font-size: var(--D2); }
.D3 { font-size: var(--D3); }
.H1, .H2 { line-height: 1.1; }
.H1 { font-size: var(--H1); }
.H2 { font-size: var(--H2); }
.B { font-size: var(--B); line-height: 1.45; }
.S { font-size: var(--S); font-weight: 500; letter-spacing: 0.08em; line-height: 1.3; }

.w100 { font-weight: 100; } .w200 { font-weight: 200; } .w300 { font-weight: 300; }
.w400 { font-weight: 400; } .w500 { font-weight: 500; } .w600 { font-weight: 600; }
.w700 { font-weight: 700; } .w800 { font-weight: 800; } .w900 { font-weight: 900; }
.it { font-style: italic; }
.acc { color: var(--fp-accent); }
.dim { color: rgba(229, 230, 224, .6); }
[data-theme="light"] .dim { color: rgba(29, 29, 29, .65); }   /* 60% measured 4.11:1 on #E5E6E0; 65% passes 4.5:1 */
.tl { text-align: left; } .tc { text-align: center; } .tr { text-align: right; }


/* ROUND-03 helpers */
:root { --XL: clamp(140px, 26vw, 420px); }
.XL { font-size: var(--XL); line-height: .85; letter-spacing: -0.02em; }
.t9, .t10, .t11, .t12 { font-size: 15px; }   /* R12: 15px is the floor for all text (verify-min15.mjs, was 12px in R11); t9-t12 kept as names so the pages need no edit */
.t9, .t10, .t11, .t12 { line-height: 1.4; letter-spacing: 0; }
.caps-wide { letter-spacing: 0.2em; }

/* fill hosts: drawn at the size that spans the host (data-fp-fill); 100px is only the starting size */
[data-fp-fill] { font-size: 100px; white-space: nowrap; }

/* vertical text, reads bottom to top: the box gives the length (--len), the host is rotated -90deg */
.fp-vert { position: relative; width: var(--thick, 1.2em); height: var(--len, 60vh); }
.fp-vert > [data-fp] { position: absolute; left: 0; bottom: 0; width: var(--len, 60vh); transform-origin: 0 100%; transform: rotate(-90deg) translateY(100%); }

/* CSS arrow: 1em long, 0.08em thick, with a head; colour = currentColor */
.fp-arw { display: inline-block; position: relative; width: 1em; height: .08em; background: currentColor; flex: none; }
.fp-arw::after { content: ""; position: absolute; right: -.02em; top: 50%; width: .3em; height: .3em; border-top: .08em solid currentColor; border-right: .08em solid currentColor; transform: translateY(-50%) rotate(45deg); }
.fp-arw.dl { transform: rotate(135deg); }

/* pill */
.fp-pill { display: inline-block; border: 1px solid currentColor; border-radius: 99px; padding: 4px 18px; }

/* SCENES */

.fp-scene {
    min-height: calc(100vh - var(--fp-header));
    width: 100%;
    padding: 184px var(--fp-gutter) 56px;   /* top: the fixed buttons end at 160, plus a 24px clear gap (rest-rules A) */
    display: flex;
    flex-direction: column;
    font-weight: 400;
    letter-spacing: 0;
    position: relative;
}

.fp-scene[data-theme="light"] {
    background: var(--fp-light);
    color: var(--fp-dark);
}

.fp-scene[data-theme="dark"] {
    background: var(--fp-dark);
    color: var(--fp-light);
}

.fp-scene hr {
    width: 100%;
    height: 0;
    border: 0;
    margin: 0;
}

/* 12-column scene grid */
.fp-g {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
    width: 100%;
}

.fp-push { margin-top: auto; }
.fp-center { margin: auto 0; }

/* three cells: left / centre / right */
.fp-row3 {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: start;
}
.fp-row3 > :nth-child(2) { text-align: center; }
.fp-row3 > :nth-child(3) { text-align: right; }

.fp-split {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px 24px;
}

/* scene 1 bottom row: styles / scripts / licence */
.fp-meta {
    border-top: 1px solid currentColor;
    padding-top: 16px;
    margin-top: 48px;
    font-size: var(--S);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.3;
}

.fp-meta a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.fp-meta a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}


/* FIXED BUTTONS */

.fp-actions {
    position: fixed;
    top: calc(var(--fp-header) + 28px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 34px;
    z-index: 5;
}

.fp-actions.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.fp-btn {
    width: 220px;
    height: 56px;
    border: 1px solid var(--fp-dark);
    background: var(--fp-light);
    color: var(--fp-dark);
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.fp-btn:hover,
.fp-btn:focus-visible {
    text-decoration: none;
    background: var(--fp-dark);
    color: var(--fp-light);
}

.fp-btn__main { font-weight: 700; }
.fp-btn__sub { font-weight: 400; }

body[data-under="dark"] .fp-btn {
    background: var(--fp-light);
    border-color: var(--fp-light);
    color: var(--fp-dark);
}

body[data-under="dark"] .fp-btn:hover,
body[data-under="dark"] .fp-btn:focus-visible {
    background: var(--fp-accent);
    border-color: var(--fp-accent);
    color: var(--fp-dark);
}

.fp-btn:focus-visible {
    outline: 2px solid var(--fp-dark);
    outline-offset: 2px;
}

body[data-under="dark"] .fp-btn:focus-visible {
    outline-color: var(--fp-accent);
}


/* MAIL MENU (ROUND-06: "Get the font" opens Gmail / Outlook / copy instead of mailto:) */

.fp-mail { position: relative; }
.fp-mail > .fp-btn { font: inherit; font-size: 16px; line-height: 1.25; padding: 0; cursor: pointer; }
.fp-mail.is-open > .fp-btn { background: var(--fp-dark); color: var(--fp-light); }
.fp-mail__menu { position: absolute; left: 0; top: 100%; width: 100%; margin-top: -1px; display: none; flex-direction: column; background: var(--fp-light); border: 1px solid var(--fp-dark); }
.fp-mail.is-open .fp-mail__menu { display: flex; }
.fp-mail__menu a, .fp-mail__menu button { height: 44px; display: flex; align-items: center; justify-content: center; font: inherit; font-size: 16px; color: var(--fp-dark); background: none; border: 0; border-bottom: 1px solid var(--fp-dark); text-decoration: none; cursor: pointer; }
.fp-mail__menu a:hover, .fp-mail__menu button:hover,
.fp-mail__menu a:focus-visible, .fp-mail__menu button:focus-visible { background: var(--fp-accent); text-decoration: none; }
.fp-mail__addr { height: 40px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--fp-dark); }

/* the menu keeps its dark border on dark scenes too: at 390 it rises into the scene above, often a light one (brief had border-color light here) */
body[data-under="dark"] .fp-mail.is-open > .fp-btn { background: var(--fp-accent); border-color: var(--fp-accent); color: var(--fp-dark); }

@media (max-width: 920px) {
    .fp-mail { width: calc(50% - 24px); }
    .fp-mail > .fp-btn { width: 100%; }
    .fp-mail__menu { top: auto; bottom: 100%; margin: 0 0 -1px; }   /* buttons sit at the bottom: menu opens upward */
    .fp-mail__addr { font-size: 11px; height: 36px; }
}


/* TESTER (controls, tabs and footer stay in the site font) */

.fp-tester {
    padding: 0 var(--fp-gutter) 120px;
    background: var(--fp-light);
    color: var(--fp-dark);
    border-top: 1px solid var(--fp-dark);
    letter-spacing: 0;
    scroll-margin-top: var(--fp-header);
    font-family: 'Andre Sans', sans-serif;
}

.fp-tabs {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 44px;
}

.fp-tab {
    font: 400 18px/1.4 'Andre Sans', sans-serif;
    color: var(--fp-dark);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* the visible tab is the span; the button around it is the touch area */
.fp-tab span {
    display: block;
    padding: 0 6px;
}

.fp-tab[aria-selected="true"] span {
    background: var(--fp-dark);
    color: var(--fp-light);
}

.fp-tab[aria-selected="false"]:hover span {
    text-decoration: underline;
}

.fp-tab:focus-visible,
.fp-seg__btn:focus-visible,
.fp-select:focus-visible,
.fp-range:focus-visible,
.fp-footer a:focus-visible,
.fp-meta a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.fp-controls {
    margin-top: 52px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 28px;
}

.fp-field {
    display: block;
}

.fp-field[hidden],
.fp-seg[hidden] {
    display: none;
}

.fp-select {
    -webkit-appearance: none;
    appearance: none;
    width: 230px;
    height: 38px;
    border: 1px solid var(--fp-dark);
    border-radius: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%231D1D1D'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding: 0 34px 0 12px;
    font: 400 16px/1 'Andre Sans', sans-serif;
    color: var(--fp-dark);
    cursor: pointer;
}

.fp-select:hover {
    background-color: rgba(29, 29, 29, .06);
}

.fp-seg {
    display: flex;
    border: 1px solid var(--fp-dark);
}

.fp-seg__btn {
    height: 36px;
    padding: 0 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font: 400 16px/1 'Andre Sans', sans-serif;
    color: var(--fp-dark);
    cursor: pointer;
}

.fp-seg__btn + .fp-seg__btn {
    border-left: 1px solid var(--fp-dark);
}

.fp-seg__btn:hover {
    background: rgba(29, 29, 29, .06);
}

.fp-seg__btn[aria-pressed="true"] {
    background: var(--fp-dark);
    color: var(--fp-light);
}

.fp-size {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 38px;
}

.fp-size__label,
.fp-size__out {
    font-size: 15px;
    font-weight: 400;
}

.fp-size__out {
    min-width: 52px;
}

.fp-range {
    -webkit-appearance: none;
    appearance: none;
    width: 260px;
    height: 38px;
    margin: 0;
    background: linear-gradient(var(--fp-dark), var(--fp-dark)) center / 100% 1px no-repeat;
    cursor: pointer;
}

.fp-range::-webkit-slider-runnable-track {
    height: 34px;
    background: transparent;
}

.fp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 18px;
    height: 34px;
    background: var(--fp-light);
    border: 1px solid var(--fp-dark);
    border-radius: 0;
}

.fp-range::-moz-range-track {
    height: 1px;
    background: var(--fp-dark);
    border: 0;
}

.fp-range::-moz-range-thumb {
    box-sizing: border-box;
    width: 18px;
    height: 34px;
    background: var(--fp-light);
    border: 1px solid var(--fp-dark);
    border-radius: 0;
}

/* drawing + invisible textarea on top (focus, typing, phone keyboard) */
.fp-stage {
    position: relative;
    margin: 64px auto 0;
    width: 100%;
    min-height: max(45vh, var(--fp-stage-h, 0px));
    cursor: text;
}

.fp-stage__svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.fp-stage__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    resize: none;
    border: 0;
    padding: 0;
    margin: 0;
    font-size: 16px;
    color: transparent;
    background: transparent;
    caret-color: transparent;
    cursor: text;
    outline: none;   /* invisible field: the drawn blinking caret shows focus */
}

.fp-caret {
    animation: fp-blink 1s steps(1) infinite;
}

@keyframes fp-blink {
    50% { opacity: 0; }
}


/* FEATURES */

.fp-features {
    max-width: 900px;
    margin: 56px auto 0;
    text-align: center;
}

.fp-feature {
    margin-bottom: 56px;
}

.fp-feature:last-child {
    margin-bottom: 0;
}

.fp-feature__title {
    font: 700 18px/1.3 'Andre Sans', sans-serif;
}

.fp-feature__desc {
    max-width: 60ch;
    margin: 8px auto 0 !important;
    font: 400 16px/1.45 'Andre Sans', sans-serif;
}

.fp-feature__ex {
    margin-top: 20px !important;
    font-weight: 400;
    font-size: clamp(28px, 3.4vw, 48px);
    line-height: 1.15;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fp-feature__ex + .fp-feature__ex {
    margin-top: 8px !important;
}

.fp-before {
    color: rgba(29, 29, 29, .4);
}

.fp-after {
    color: var(--fp-dark);
}

.fp-before,
.fp-after {
    text-align: right;
    white-space: pre;
}

.fp-arrow {
    color: rgba(29, 29, 29, .4);
    white-space: pre;
    font-family: 'Andre Sans', sans-serif;
}

/* a row whose phrases do not fit side by side stacks: before, arrow down, after (set by js/font-page.js) */
.fp-feature__ex.is-stacked {
    flex-direction: column;
}

.fp-feature__ex.is-stacked .fp-before,
.fp-feature__ex.is-stacked .fp-after {
    text-align: center;
}

.fp-feature__ex.is-stacked .fp-arrow {
    display: block;
    white-space: normal;
    transform: rotate(90deg);
    line-height: 1.2;
}


/* FOOTER */

.fp-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px var(--fp-gutter);
    border-top: 1px solid var(--fp-dark);
    background: var(--fp-light);
    font-family: 'Andre Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
}

.fp-footer a {
    color: var(--fp-dark);
    text-decoration: none;
}

.fp-footer a:hover {
    text-decoration: underline;
}


/* MOBILE */

@media (max-width: 920px) {

    .fp-scene {
        min-height: auto;
        padding: 96px 16px 56px;
    }

    .fp-g {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 24px;
    }

    .fp-g > * {
        grid-column: 1 / -1 !important;
    }

    .fp-row3 {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .fp-row3 > :nth-child(n) {
        text-align: left;
    }

    .fp-actions {
        top: auto;
        bottom: 16px;
        left: 0;
        right: 0;
        transform: none;
        justify-content: center;
        gap: 16px;
    }

    .fp-btn {
        width: calc(50% - 24px);
        height: 52px;
    }

    .fp-tester {
        padding: 0 16px 120px;
    }

    /* touch: every tester control gets a 48px touch area */
    .fp-tabs {
        margin-top: 16px;
    }

    .fp-tab {
        height: 48px;
        min-width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fp-controls {
        margin-top: 40px;
        gap: 16px;
    }

    .fp-field,
    .fp-select {
        width: 100%;
    }

    .fp-select {
        height: 48px;
    }

    .fp-seg {
        border: 0;
    }

    .fp-seg__btn {
        height: 48px;
        padding: 0 24px;
        border: 1px solid var(--fp-dark);
    }

    .fp-seg__btn + .fp-seg__btn {
        border-left: 0;
    }

    .fp-size {
        width: 100%;
        height: 48px;
    }

    .fp-range {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        height: 48px;
    }

    .fp-footer {
        flex-direction: column;
        gap: 8px;
    }

    /* vertical text lies flat on phones */
    .fp-vert { width: auto; height: auto; }
    .fp-vert > [data-fp] { position: static; width: auto; transform: none; }
}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    .fp-scene,
    .fp-tester,
    .fp-actions,
    .fp-actions.is-hidden,
    .fp-btn {
        transition: none;
    }

    .fp-caret {
        animation: none;
    }
}


/* GRID COLUMNS: .c-a-b = columns a to b of the 12 */
.c-1-1 { grid-column: 1 / 2; } .c-1-2 { grid-column: 1 / 3; } .c-1-3 { grid-column: 1 / 4; } .c-1-4 { grid-column: 1 / 5; } .c-1-5 { grid-column: 1 / 6; } .c-1-6 { grid-column: 1 / 7; } .c-1-7 { grid-column: 1 / 8; } .c-1-8 { grid-column: 1 / 9; } .c-1-9 { grid-column: 1 / 10; } .c-1-10 { grid-column: 1 / 11; } .c-1-11 { grid-column: 1 / 12; } .c-1-12 { grid-column: 1 / 13; }
.c-2-2 { grid-column: 2 / 3; } .c-2-3 { grid-column: 2 / 4; } .c-2-4 { grid-column: 2 / 5; } .c-2-5 { grid-column: 2 / 6; } .c-2-6 { grid-column: 2 / 7; } .c-2-7 { grid-column: 2 / 8; } .c-2-8 { grid-column: 2 / 9; } .c-2-9 { grid-column: 2 / 10; } .c-2-10 { grid-column: 2 / 11; } .c-2-11 { grid-column: 2 / 12; } .c-2-12 { grid-column: 2 / 13; }
.c-3-3 { grid-column: 3 / 4; } .c-3-4 { grid-column: 3 / 5; } .c-3-5 { grid-column: 3 / 6; } .c-3-6 { grid-column: 3 / 7; } .c-3-7 { grid-column: 3 / 8; } .c-3-8 { grid-column: 3 / 9; } .c-3-9 { grid-column: 3 / 10; } .c-3-10 { grid-column: 3 / 11; } .c-3-11 { grid-column: 3 / 12; } .c-3-12 { grid-column: 3 / 13; }
.c-4-4 { grid-column: 4 / 5; } .c-4-5 { grid-column: 4 / 6; } .c-4-6 { grid-column: 4 / 7; } .c-4-7 { grid-column: 4 / 8; } .c-4-8 { grid-column: 4 / 9; } .c-4-9 { grid-column: 4 / 10; } .c-4-10 { grid-column: 4 / 11; } .c-4-11 { grid-column: 4 / 12; } .c-4-12 { grid-column: 4 / 13; }
.c-5-5 { grid-column: 5 / 6; } .c-5-6 { grid-column: 5 / 7; } .c-5-7 { grid-column: 5 / 8; } .c-5-8 { grid-column: 5 / 9; } .c-5-9 { grid-column: 5 / 10; } .c-5-10 { grid-column: 5 / 11; } .c-5-11 { grid-column: 5 / 12; } .c-5-12 { grid-column: 5 / 13; }
.c-6-6 { grid-column: 6 / 7; } .c-6-7 { grid-column: 6 / 8; } .c-6-8 { grid-column: 6 / 9; } .c-6-9 { grid-column: 6 / 10; } .c-6-10 { grid-column: 6 / 11; } .c-6-11 { grid-column: 6 / 12; } .c-6-12 { grid-column: 6 / 13; }
.c-7-7 { grid-column: 7 / 8; } .c-7-8 { grid-column: 7 / 9; } .c-7-9 { grid-column: 7 / 10; } .c-7-10 { grid-column: 7 / 11; } .c-7-11 { grid-column: 7 / 12; } .c-7-12 { grid-column: 7 / 13; }
.c-8-8 { grid-column: 8 / 9; } .c-8-9 { grid-column: 8 / 10; } .c-8-10 { grid-column: 8 / 11; } .c-8-11 { grid-column: 8 / 12; } .c-8-12 { grid-column: 8 / 13; }
.c-9-9 { grid-column: 9 / 10; } .c-9-10 { grid-column: 9 / 11; } .c-9-11 { grid-column: 9 / 12; } .c-9-12 { grid-column: 9 / 13; }
.c-10-10 { grid-column: 10 / 11; } .c-10-11 { grid-column: 10 / 12; } .c-10-12 { grid-column: 10 / 13; }
.c-11-11 { grid-column: 11 / 12; } .c-11-12 { grid-column: 11 / 13; }
.c-12-12 { grid-column: 12 / 13; }
