/* Typecask's site. Dark only, from the app icon: near-black ground, cream text, one orange.
   The chrome uses the system face so that the specimens are the only typography on the page, and so
   that a site whose selling point is that nothing is collected makes no third-party font request. */

:root {
    color-scheme: dark;

    --ground: #141318;
    --ground-2: #1c1b22;
    --ground-3: #26242e;
    --ink: #f7f5f0;
    --ink-2: #aba7b5;
    --ink-3: #8f8b99;
    --rule: #2c2a35;
    --rule-2: #3b3846;
    --hot: #ff9f43;
    --hot-ink: #1c1b22;

    --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --gut: max(20px, env(safe-area-inset-left, 0px));
    --gut-r: max(20px, env(safe-area-inset-right, 0px));
    --wide: 1140px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--ui);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.12;
    letter-spacing: -0.025em;
    text-wrap: balance;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.prose a,
.doc a {
    color: var(--hot);
    text-decoration: underline;
    text-underline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

/* .spec-row sets display, which would otherwise win over the UA's [hidden] rule. */
[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--hot);
    outline-offset: 3px;
    border-radius: 4px;
}

.vh {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--hot);
    color: var(--hot-ink);
    padding: 10px 16px;
    font-weight: 600;
    z-index: 50;
}

.skip:focus {
    left: 0;
}

/* One wrapper holds the gutter; coloured bands span the width and put .bar inside. */
.bar {
    max-width: var(--wide);
    margin-inline: auto;
    padding-left: var(--gut);
    padding-right: var(--gut-r);
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hot);
}

.lede {
    font-size: clamp(1.02rem, 1.6vw, 1.18rem);
    color: var(--ink-2);
    max-width: 60ch;
}

.fine {
    font-size: 0.84rem;
    color: var(--ink-3);
}

.more {
    color: var(--hot);
    font-weight: 600;
    font-size: 0.92rem;
}

.more:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.note {
    border: 1px solid var(--rule-2);
    border-radius: 10px;
    padding: 14px 18px;
    color: var(--ink-2);
    font-size: 0.9rem;
    margin-block: 16px;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hot);
    color: var(--hot-ink);
    font-weight: 650;
    border-radius: 999px;
    white-space: nowrap;
}

.btn-small {
    padding: 7px 16px;
    font-size: 0.88rem;
}

.btn-big {
    padding: 13px 26px;
    font-size: 1rem;
}

.btn:hover {
    filter: brightness(1.08);
}

.btn-quiet {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule-2);
}

.btn-quiet:hover {
    filter: none;
    border-color: var(--ink-3);
}

.btn-off {
    background: var(--ground-3);
    color: var(--ink-2);
    cursor: default;
}

.btn-off:hover {
    filter: none;
}

/* ---------- header and footer ---------- */

.site-head {
    border-bottom: 1px solid var(--rule);
    background: var(--ground);
}

.site-head .bar {
    display: flex;
    align-items: center;
    gap: 14px 22px;
    flex-wrap: wrap;
    padding-block: 12px;
}

.mark {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    margin-right: auto;
}

.mark em {
    color: var(--hot);
    font-style: normal;
}

@media (max-width: 599px) {
    .site-head .btn {
        display: none;
    }
}

.site-head nav {
    display: flex;
    gap: 18px;
    font-size: 0.92rem;
    color: var(--ink-2);
}

.site-head nav a:hover,
.site-head nav a[aria-current] {
    color: var(--ink);
}

.site-head nav a[aria-current] {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-color: var(--hot);
    text-decoration-thickness: 2px;
}

.site-foot {
    border-top: 1px solid var(--rule);
    margin-top: 72px;
    padding-top: 40px;
    color: var(--ink-2);
    font-size: 0.9rem;
}

.site-foot .bar {
    display: flex;
    flex-wrap: wrap;
    gap: 28px 48px;
}

.foot-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.foot-col h2 {
    font-size: 0.72rem;
    font-family: var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 4px;
    font-weight: 500;
}

.foot-col a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.foot-mark {
    font-weight: 800;
    font-size: 1rem;
    color: var(--ink);
}

.foot-mark em {
    color: var(--hot);
    font-style: normal;
}

.foot-fine {
    border-top: 1px solid var(--rule);
    margin-top: 36px;
    padding-top: 18px;
    padding-bottom: 40px;
    font-size: 0.8rem;
    color: var(--ink-3);
    justify-content: space-between;
}

.foot-fine p {
    max-width: 62ch;
}

/* ---------- home ---------- */

.hero {
    border-bottom: 1px solid var(--rule);
}

.hero-grid {
    display: grid;
    gap: 40px;
    padding-block: clamp(44px, 7vw, 86px);
    align-items: center;
}

@media (min-width: 880px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 64px;
    }
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.phone {
    justify-self: center;
    width: 100%;
    max-width: 280px;
    border: 9px solid #000;
    border-radius: 38px;
    overflow: hidden;
    background: var(--ground-2);
    box-shadow: 0 24px 60px -30px #000;
}

.phone-screen {
    background: var(--ground-2);
}

.phone-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    border-bottom: 1px solid var(--rule);
}

.phone-sort {
    color: var(--hot);
    font-weight: 500;
}

.phone-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
}

.phone-card {
    background: var(--ground-3);
    border-radius: 12px;
    padding: 10px;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
}

.phone-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.phone-spec {
    white-space: pre-line;
    font-size: 0.7rem;
    line-height: 1.35;
    max-height: 4.05em;
    overflow: hidden;
    color: var(--ink);
}

.phone-name {
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink-2);
}

.strip-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-block: 34px 18px;
}

.feats {
    border-top: 1px solid var(--rule);
}

.feats-grid {
    display: grid;
    gap: 32px 48px;
    padding-block: clamp(40px, 6vw, 68px);
}

@media (min-width: 720px) {
    .feats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.feat {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.feat h2 {
    font-size: 1.12rem;
}

.feat p {
    color: var(--ink-2);
    font-size: 0.95rem;
}

.styles-band,
.privacy-band {
    border-top: 1px solid var(--rule);
}

.styles-band .bar {
    padding-block: clamp(34px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.style-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.style-links a {
    border: 1px solid var(--rule-2);
    border-radius: 999px;
    padding: 8px 17px;
    font-size: 0.92rem;
    color: var(--ink-2);
    display: inline-flex;
    gap: 8px;
    align-items: baseline;
}

.style-links a:hover {
    border-color: var(--hot);
    color: var(--ink);
}

.style-links b {
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--ink-3);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.style-links-page {
    padding-bottom: 40px;
}

.privacy-grid {
    display: grid;
    gap: 32px 48px;
    padding-block: clamp(40px, 6vw, 68px);
}

@media (min-width: 720px) {
    .privacy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.privacy-grid > div {
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-width: 0;
}

.privacy-grid p {
    color: var(--ink-2);
    font-size: 0.95rem;
}

/* ---------- the specimen wall ---------- */

.wall {
    border-top: 1px solid var(--rule);
}

.spec-row {
    display: block;
    border-bottom: 1px solid var(--rule);
    padding: 18px var(--gut-r) 20px var(--gut);
    max-width: var(--wide);
    margin-inline: auto;
    /* 2,193 rows: don't lay out or paint the ones nobody has scrolled to. */
    content-visibility: auto;
    contain-intrinsic-size: auto 118px;
}

.spec-row:hover {
    background: var(--ground-2);
}

.spec-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 10px;
}

.spec-meta b {
    color: var(--ink);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.tag-nerd {
    color: var(--hot);
}

.spec-installs {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 639px) {
    .spec-installs {
        display: none;
    }
}

.spec-line {
    display: block;
    font-size: clamp(1.5rem, 5.4vw, 3rem);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    color: var(--ink);
}

/* ---------- catalog filters ---------- */

.catalog-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-block: clamp(32px, 5vw, 56px) 22px;
}

.filters {
    position: sticky;
    top: 0;
    z-index: 15;
    background: var(--ground);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    padding-block: 12px;
}

.search {
    flex: 1 1 220px;
    min-width: 0;
}

.search input {
    width: 100%;
    background: var(--ground-2);
    border: 1px solid var(--rule-2);
    border-radius: 9px;
    padding: 9px 14px;
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
}

.search input::placeholder {
    color: var(--ink-3);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chip {
    background: transparent;
    border: 1px solid var(--rule-2);
    border-radius: 999px;
    padding: 6px 13px;
    font: inherit;
    font-size: 0.84rem;
    color: var(--ink-2);
    cursor: pointer;
}

.chip:hover {
    border-color: var(--ink-3);
    color: var(--ink);
}

.chip.is-on {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--ground);
    font-weight: 600;
}

.sort select {
    background: var(--ground-2);
    border: 1px solid var(--rule-2);
    border-radius: 9px;
    padding: 8px 12px;
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
}

.result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 11px;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--ink-3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.empty {
    padding-block: 60px;
    color: var(--ink-2);
}

/* ---------- a font's page ---------- */

.crumbs {
    display: flex;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 14px;
}

.crumbs a:hover {
    color: var(--hot);
}

.font-page > .bar:first-child {
    padding-block: clamp(28px, 4vw, 44px) 0;
}

.specimen {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 26px;
    padding-bottom: 26px;
    min-width: 0;
}

.specimen-big {
    white-space: pre-line;  /* a font for another script: its line, then the Latin sample */
    font-size: clamp(1.7rem, 6vw, 3.6rem);
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.specimen-mid {
    white-space: pre-line;
    font-size: clamp(1rem, 2.1vw, 1.35rem);
    line-height: 1.5;
    color: var(--ink-2);
    overflow-wrap: anywhere;
}

.specimen-glyphs {
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
    color: var(--hot);
    overflow-wrap: anywhere;
}

.specimen-note {
    padding-bottom: 30px;
    border-bottom: 1px solid var(--rule);
}

.font-grid {
    display: grid;
    gap: 36px;
    padding-block: 36px;
}

@media (min-width: 820px) {
    .font-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 56px;
    }
}

.font-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.prose {
    color: var(--ink-2);
    font-size: 0.98rem;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-wrap: anywhere;
}

.prose p {
    margin: 0;
}

.attrib {
    color: var(--ink-3);
    font-size: 0.86rem;
}

.get {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid var(--rule-2);
    border-radius: 14px;
    background: var(--ground-2);
}

.license summary {
    cursor: pointer;
    font-weight: 650;
    padding: 12px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.license pre {
    font-family: var(--mono);
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--ink-3);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 16px 0 0;
    max-height: 420px;
    overflow-y: auto;
}

.font-facts {
    min-width: 0;
}

.font-facts dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 20px;
    margin: 0 0 20px;
    font-size: 0.88rem;
}

.font-facts dt {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-3);
    align-self: baseline;
}

.font-facts dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.font-facts dd a {
    color: var(--hot);
}

.cask-token {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-2);
}

.related {
    border-top: 1px solid var(--rule);
    padding-block: 36px 10px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.related-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.related-card {
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 15px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    overflow: hidden;
}

.related-card:hover {
    border-color: var(--hot);
}

.related-spec {
    white-space: pre-line;
    font-size: 1rem;
    line-height: 1.35;
    max-height: 4.05em;
    overflow: hidden;
}

.related-name {
    font-size: 0.84rem;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- documents ---------- */

/* Keep the page's own wrapper, so a document's left edge lines up with the header's, and hold the
   measure on the content instead. */
.doc {
    padding-block: clamp(32px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.doc > * {
    max-width: 68ch;
}

.doc .prose {
    font-size: 1rem;
    color: var(--ink-2);
    gap: 18px;
}

.doc .prose h2 {
    color: var(--ink);
    margin-top: 16px;
    font-size: 1.25rem;
}

.doc .prose h3 {
    color: var(--ink);
    font-size: 1.02rem;
}

.doc .prose ul,
.doc .prose ol {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc .prose code {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--ground-2);
    border-radius: 4px;
    padding: 1px 5px;
}

.doc .prose table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.92rem;
}

.doc .prose th,
.doc .prose td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
