/* Page-specific chrome overrides (shared chrome is in ff-chrome.css). */
.top-content { justify-content: space-between; }
.top-content span, .top-content .hamburger {
    font-family: 'FFMono', monospace; font-size: 10pt;
    color: var(--nav-color); letter-spacing: 0.02em;
    transition: color 0.4s ease;
}
.bottom-right {
    font-family: 'FFMono', monospace; font-size: 10pt;
    color: var(--nav-color); transition: color 0.4s ease;
}
@media (max-width: 768px) { .bottom-content { padding: 10px 0; } }

/* ── MARQUEE ── */
.marquee-wrap {
    overflow: hidden;
    flex: 1;
    margin: 0 32px;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 22s linear infinite;
}
.marquee-track span {
    font-family: 'FFMono', monospace; font-size: 10pt;
    color: var(--nav-color); letter-spacing: 0.02em;
    line-height: 1; transition: color 0.4s ease;
    padding-right: 48px;
    flex-shrink: 0;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@media (max-width: 768px) { .marquee-wrap { margin: 0; mask-image: none; -webkit-mask-image: none; } }

/* ── PAGE CONTENT ──
   top-content row ≈ 48px + 1px border + ff-animation 200px
── */
#page-content {
    padding-top: calc(48px + 1px + 200px);
    padding-bottom: 60px;
    min-height: 100vh;
    opacity: 0; transition: opacity 0.6s ease;
}
#page-content.visible { opacity: 1; }



/* ── TESTER CONTROLS WRAPPER ──
   Now just the font picker. Narrow vertical column on the right
   edge, just above the color switcher, matching its width.
   The Width/Size sliders moved into each specimen row. */
.tester-controls {
    position: fixed;
    right: 0;
    bottom: calc(50% + 50px);
    width: auto;
    max-width: none;
    min-width: 0;
    z-index: 800;
    background: var(--bg-color);
    border: 1px solid var(--nav-color);
    border-right: none;
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* Hide the now-empty global controls bar entirely (it's gone
   from the DOM but the class is referenced in scroll JS) */
.tester-controls .controls-bar { display: none; }

/* Font picker: narrow vertical strip, 2 cells (active + 1 empty) */
.tester-controls .font-picker-row {
    grid-template-columns: 1fr;
    border: none;
}
.tester-controls .font-slot {
    /* width matches color-switcher: 32 px outer, 12 px dot + 10 px side padding */
    width: 32px;
    min-height: 70px;
    padding: 8px 0;
    justify-content: center;
    border-right: none;
    border-bottom: 1px solid var(--nav-color);
}
.tester-controls .font-slot:last-child,
.tester-controls .font-slot:nth-child(2) { border-bottom: none; }
/* Hide slots beyond the first two (1 font + 1 "coming soon") */
.tester-controls .font-slot:nth-child(n+3) { display: none; }
/* Labels rotated 90° clockwise so they fit a 32 px column */
.tester-controls .font-slot-name,
.tester-controls .font-slot .slot-soon {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 8pt;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.tester-controls .font-slot.empty:hover .slot-soon { opacity: 1; }

/* ── PER-ROW SPECIMEN CONTROLS ──
   Each specimen row now carries its own Width + Size sliders
   in the top-right corner where .specimen-meta used to live. */
.specimen-controls {
    position: absolute;
    top: 8px;
    right: 16px;
    z-index: 3;
    display: flex;
    gap: 14px;
    align-items: center;
}
.specimen-controls .ctrl-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border: none;
    gap: 6px;
    min-width: 0;
    flex: 0 0 auto;
}
.specimen-controls .ctrl-label {
    display: inline;
    margin: 0;
    font-family: 'FFMono', monospace;
    font-size: 6pt;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nav-color);
    white-space: nowrap;
}
.specimen-controls .ctrl-value {
    display: inline;
    margin: 0;
    font-family: 'FFMono', monospace;
    font-size: 7pt;
    letter-spacing: 0.04em;
    color: var(--nav-color);
}
.specimen-controls .ctrl-wrap {
    position: relative;
    width: 70px;
}
.specimen-controls .ctrl-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 1px; background: var(--nav-color);
    outline: none; border: none; border-radius: 0;
    opacity: 1;
}
.specimen-controls .ctrl-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 9px; height: 9px;
    background: var(--nav-color); border-radius: 0;
}
.specimen-controls .ctrl-slider::-moz-range-thumb {
    width: 9px; height: 9px; background: var(--nav-color); border-radius: 0; border: none;
}
.specimen-controls .ctrl-arrow {
    position: absolute;
    top: -14px;
    pointer-events: none;
    font-size: 11px;
    line-height: 1;
    color: var(--nav-color);
    opacity: 0;
    transition: opacity 0.12s;
    transform: translateX(-50%);
}
.specimen-controls .ctrl-wrap:hover .ctrl-arrow { opacity: 1; }

/* ── FONT PICKER ROW ── */
.font-picker-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--nav-color);
    border-bottom: 1px solid var(--nav-color);
}
.font-slot {
    padding: 14px 24px;
    transition: padding 0.2s ease, background 0.15s;
    display: flex; align-items: center;
    position: relative;
    overflow: hidden;
    transition: background 0.15s;
    border-right: 1px solid var(--nav-color);
}
.font-slot:last-child { border-right: none; }
.font-slot.active {
    background: var(--nav-color);
}
.font-slot.active .font-slot-name {
    color: var(--bg-color);
}
.font-slot-name {
    font-family: 'FFMono', monospace; font-size: 10pt;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--nav-color);
}
/* Empty slot — diagonal cross from corner to corner */
.font-slot.empty::before,
.font-slot.empty::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.font-slot.empty::before {
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 0.5px),
        var(--nav-color) calc(50% - 0.5px),
        var(--nav-color) calc(50% + 0.5px),
        transparent calc(50% + 0.5px)
    );
}
.font-slot.empty::after {
    background: linear-gradient(
        to bottom left,
        transparent calc(50% - 0.5px),
        var(--nav-color) calc(50% - 0.5px),
        var(--nav-color) calc(50% + 0.5px),
        transparent calc(50% + 0.5px)
    );
}
.font-slot.empty .font-slot-content { visibility: hidden; }
.font-slot-content { position: relative; z-index: 1; }
.font-slot-upload { display: none; }


/* ── COMING SOON TOOLTIP on empty font slots ── */
.font-slot.empty .slot-soon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'FFMono', monospace; font-size: 8pt;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--nav-color);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 2;
}
.font-slot.empty:hover .slot-soon { opacity: 1; }

/* ── CONTROLS BAR ── */
.controls-bar {
    display: flex; flex-wrap: wrap;
    border-bottom: 1px solid var(--nav-color);
}
.ctrl-group {
    display: flex; flex-direction: column;
    padding: 10px 18px;
    border-right: 1px solid var(--nav-color);
    min-width: 100px; flex: 1;
}
.ctrl-group:last-child { border-right: none; }
.ctrl-label {
    font-family: 'FFMono', monospace; font-size: 7pt;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--nav-color); margin-bottom: 6px;
}
.ctrl-value {
    font-family: 'FFMono', monospace; font-size: 8pt;
    letter-spacing: 0.06em; color: var(--nav-color); margin-bottom: 7px;
}
.ctrl-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 1px; background: var(--nav-color);
    outline: none; border: none; border-radius: 0;
    opacity: 1; position: relative;
}
.ctrl-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 9px; height: 9px;
    background: var(--nav-color); border-radius: 0;
}
.ctrl-slider::-moz-range-thumb {
    width: 9px; height: 9px; background: var(--nav-color); border-radius: 0; border: none;
}
.ctrl-wrap {
    position: relative;
}
.ctrl-arrow {
    position: absolute;
    top: -18px;
    pointer-events: none;
    font-size: 18px;
    line-height: 1;
    color: var(--nav-color);
    opacity: 0;
    transition: opacity 0.12s;
    transform: translateX(-50%);
}
.ctrl-wrap:hover .ctrl-arrow { opacity: 1; }

/* ── SPECIMEN GRID ── */
.specimen-grid {
    border-bottom: 1px solid var(--nav-color);
}
.specimen-row-full {
    border-bottom: 1px solid var(--nav-color);
    padding: 40px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
}
.specimen-row-full:hover { background: rgba(0,0,0,0.025); }
.specimen-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.specimen-col-left {
    border-right: 1px solid var(--nav-color);
    display: flex;
    flex-direction: column;
}
.specimen-row {
    border-bottom: 1px solid var(--nav-color);
    padding: 40px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
}
.specimen-row:last-child { border-bottom: none; }
.specimen-row:hover { background: rgba(0,0,0,0.025); }
.specimen-meta {
    position: absolute; top: 10px; right: 16px;
    font-family: 'FFMono', monospace; font-size: 7pt;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--nav-color);
}
.specimen-font-name-inline {
    position: absolute; top: 10px; left: 16px;
    font-family: 'FFMono', monospace; font-size: 7pt;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--nav-color);
}
/* Inverted row */
.specimen-row.inverted {
    background: var(--nav-color);
}
.specimen-row.inverted .specimen-text {
    color: var(--bg-color);
}
.specimen-row.inverted .specimen-meta,
.specimen-row.inverted .specimen-font-name-inline {
    color: var(--bg-color);
}
.specimen-row.inverted:hover {
    background: var(--nav-color);
}
.specimen-text {
    outline: none; border: none; background: transparent;
    color: var(--nav-color); width: 100%;
    font-family: 'FFFOVERDRIVE', 'Helvetica Neue', Helvetica, sans-serif;
    resize: none; overflow: hidden;
    text-align: center;
    display: block;
}

.specimen-font-desc-block {
    border-top: 1px solid var(--nav-color);
    padding: 20px 24px;
    font-family: 'FFMono', monospace; font-size: 11pt;
    line-height: 1.4; letter-spacing: 0.02em;
    color: var(--bg-color);
    background: var(--nav-color);
}

/* ── RIGHT COLUMN SHOWCASE ── */
.specimen-col-right { display: flex; flex-direction: column; }
.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
}
.sc-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--nav-color);
    border-bottom: 1px solid var(--nav-color);
    overflow: hidden;
    transition: background 0.12s, color 0.12s;
}
.sc-cell.no-right { border-right: none; }
.sc-cell.no-bottom { border-bottom: none; }
.sc-cell:hover { background: var(--nav-color); }
.sc-cell span {
    font-family: 'FFFOVERDRIVE', sans-serif;
    font-size: 10vw; /* fallback, overridden per-cell by JS */
    line-height: 1;
    color: var(--nav-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s;
}
.sc-cell:hover span { color: var(--bg-color); }


@media (max-width: 768px) {
    /* Nav */
    #page-content { padding-top: calc(44px + 1px + 160px); }
    /* Mobile: revert tester to old full-width sticky below nav */
    .tester-controls {
        position: sticky;
        top: calc(44px + 1px + 160px);
        bottom: auto;
        right: auto;
        width: auto;
        max-width: none;
        min-width: 0;
        border: none;
        border-bottom: 1px solid var(--nav-color);
    }
    .tester-controls .font-slot { padding: 14px 24px; justify-content: flex-start; }
    .tester-controls .font-slot-name { font-size: 10pt; letter-spacing: 0.04em; }
    .tester-controls .ctrl-group {
        padding: 10px 18px;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 0;
    }
    .tester-controls .ctrl-label { display: block; margin: 0 0 6px 0; font-size: 7pt; }
    .tester-controls .ctrl-value { display: block; margin: 0 0 7px 0; font-size: 8pt; }
    .tester-controls .ctrl-wrap { min-width: 40px; }
    .controls-bar { overflow-x: auto; flex-wrap: nowrap; }
    .ctrl-group { min-width: 88px; }

    /* Nav bar backgrounds — same opacity as desktop */
    .top-content, .bottom-content { background: rgba(255,255,255,0.15); }

    /* Font picker: 2 columns on mobile, hide empty slots */
    .font-picker-row { grid-template-columns: 1fr 1fr; }
    .font-slot.empty { display: none; }

    /* Specimen: single column, left cell gets decent height */
    .specimen-cols { grid-template-columns: 1fr; }
    .specimen-col-left {
        border-right: none;
        border-bottom: 1px solid var(--nav-color);
        min-height: 60vw;
    }
    #textA { font-size: 20vw !important; }
    #textB { font-size: 14vw !important; }
    #textC { font-size: 10vw !important; }

}

/* ── COLOR SWITCHER (right edge, vertically centered) ── */
#color-switcher {
    position: fixed; right: 0; top: 50%; z-index: 800;
    transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 12px 10px;
    border-left: 1px solid var(--nav-color);
    border-top: 1px solid var(--nav-color);
    border-bottom: 1px solid var(--nav-color);
    background: var(--bg-color);
    transition: background 0.4s ease, border-color 0.4s ease;
}
.sw-dot {
    width: 12px; height: 12px; border-radius: 50%;
    border: 1px solid var(--nav-color);
    transition: transform 0.2s ease, border-color 0.4s ease;
    flex-shrink: 0;
}
.sw-dot:hover { transform: scale(1.5); }
#sw-invert { background: var(--nav-color); }
#sw-random { background: transparent; }


/* ── I-BEAM CURSOR for specimen textareas ── */
@keyframes ibeam-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
#ibeam-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 998;
    display: none;
}
#ibeam-cursor .ibeam-bar {
    position: absolute;
    left: 50%; top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--nav-color);
    animation: ibeam-blink 1.1s step-end infinite;
}
#ibeam-cursor .ibeam-top {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 10px; height: 2px;
    background: var(--nav-color);
    animation: ibeam-blink 1.1s step-end infinite;
}
#ibeam-cursor .ibeam-bot {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 10px; height: 2px;
    background: var(--nav-color);
    animation: ibeam-blink 1.1s step-end infinite;
}

/* ── TYPEFACE GRID — cards listing, similar to the studio work page ──
   No padding-top here: #page-content already clears the fixed
   top-bar + FFF logo. Adding extra here pushed the first card
   way further down than the commissions grid does. */
.typeface-grid {
    padding-bottom: 80px;
}
.typeface-row {
    display: flex;
    width: 100%;
}
.typeface-cell {
    flex: 1;
    min-width: 0;
}
.typeface-cell { cursor: none; }
.typeface-cell a {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: none;
}
.typeface-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-left: 1px solid var(--nav-color);
    border-right: 1px solid var(--nav-color);
    border-top: 1px solid var(--nav-color);
    border-bottom: none;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}
.typeface-preview-text {
    color: var(--nav-color);
    font-size: 10vw;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
    text-box: trim-both cap alphabetic;
    transition: color 0.3s ease, filter 0.6s ease, transform 0.6s ease;
}
/* Hover: variable-axis pulse on the preview-text. JS animates
   font-variation-settings between axisMin and axisMax. */
.typeface-title {
    padding: 12px 16px;
    font-family: 'FFMono', monospace; font-size: 10pt;
    color: var(--nav-color); letter-spacing: 0.02em;
    background: var(--bg-color);
    border-left: 1px solid var(--nav-color);
    border-right: 1px solid var(--nav-color);
    border-bottom: 1px solid var(--nav-color);
    border-top: 1px solid var(--nav-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    transition: background 0.3s ease, color 0.3s ease;
}
.typeface-title .typeface-axis {
    font-size: 10pt;
    letter-spacing: 0.02em;
    color: var(--nav-color);
}
/* Collapse shared borders between adjacent cells in a row */
.typeface-cell + .typeface-cell .typeface-preview { border-left: none; }
.typeface-cell + .typeface-cell .typeface-title   { border-left: none; }
/* Collapse the shared horizontal border between stacked rows.
   Without this, row N's title.border-bottom and row N+1's
   preview.border-top would render as a double line. */
.typeface-row + .typeface-row .typeface-preview { border-top: none; }
/* Empty (coming-soon) cells: diagonal cross */
.typeface-cell.empty .typeface-preview::before,
.typeface-cell.empty .typeface-preview::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.typeface-cell.empty .typeface-preview::before {
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 0.5px),
        var(--nav-color) calc(50% - 0.5px),
        var(--nav-color) calc(50% + 0.5px),
        transparent calc(50% + 0.5px)
    );
}
.typeface-cell.empty .typeface-preview::after {
    background: linear-gradient(
        to bottom left,
        transparent calc(50% - 0.5px),
        var(--nav-color) calc(50% - 0.5px),
        var(--nav-color) calc(50% + 0.5px),
        transparent calc(50% + 0.5px)
    );
}
.typeface-cell.empty .typeface-preview-text { visibility: hidden; }
.typeface-cell.empty .typeface-title {
    color: var(--nav-color);
}
@media (max-width: 768px) {
    .typeface-row { flex-direction: column; }
    /* Cells stack vertically on mobile. Drop the desktop sibling
       border-left and don't add a border-top — the previous card's
       .typeface-title already supplies a border-bottom which acts
       as the divider. Adding one to the next preview would double
       it. */
    .typeface-cell + .typeface-cell .typeface-preview { border-left: none; border-top: none; }
    .typeface-cell + .typeface-cell .typeface-title   { border-left: none; }
    .typeface-preview-text { font-size: 18vw; }
}

