:root {
    --ground: #cdcdcd;
    --ink: #626262;
    --ui: #626262;
    --gold: #c49a3d;
    --blue: #2b3b5f;
    --text: #626262;
    --heading: #626262;
    --muted: #7a7a7a;
    --hair: 0.5px solid var(--ink);

    --gutter: 26px;
    --rail: 212px;
    --col: min(2100px, 85vw);
    --bar-w: min(2350px, 95vw);
    --bar-w-compact: max(var(--bar-w) * 0.8, 380px);
    --bar-t: 0.55s cubic-bezier(0.65, 0, 0.35, 1);

    --bar-top: 20px;
    --bar-h: 80.45px;
    --bar-top-compact: 20px;
    --bar-h-compact: 38.68px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--ground);
    overflow-x: clip;
}

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

h1, h2, h3 {
    margin: 40px 0 20px;
    line-height: 1.05;
    color: var(--heading);
    font-weight: 700;
}

h2 { font-size: 2.2rem; font-weight: 300; }

p { margin-bottom: 28px; }
a { color: #2e2e2e; }

figcaption {
    margin-top: 18px;
    font-size: 11.45px;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    text-align: center;
    color: var(--ui);
}

/* sticky, not fixed */
.bg {
    position: sticky;
    top: 0;
    z-index: -1;
    height: 100vh;
    margin-bottom: -100vh;
    overflow: hidden;
    background: var(--ground);
    pointer-events: none;
}

@supports (height: 100lvh) {
    .bg { height: 100lvh; margin-bottom: -100lvh; }
}

.gear-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 1400px;
    height: 1400px;
    margin: -700px 0 0 -700px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.8;
    filter: blur(115px);
    will-change: transform;
    animation: squash 40s ease-in-out infinite;
}

@keyframes squash {
    0%, 45%, 100% { scale: 1 1; }
    50%, 95% { scale: 1 0.5; }
}

/* gears */
.gears {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 90vh;
    width: auto;
    overflow: visible;
    fill: var(--gold);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%);
}

.gears.intro {
    visibility: visible;
    will-change: transform, opacity, filter;
    animation:
        gears-zoom 3.6s cubic-bezier(0.33, 1, 0.68, 1) both,
        gears-fade 3.6s linear both;
}

.gears:not(.intro) .gear { animation-play-state: paused; }

.gear {
    transform-box: view-box;
    animation: turn 24s linear infinite;
}

.gear.small { transform-origin: 392.81px 135.19px; }
.gear.big { transform-origin: 182.97px 381.93px; animation-direction: reverse; }

@keyframes turn {
    to { transform: rotate(360deg); }
}

@keyframes gears-zoom {
    from { transform: translate(-50%, -50%) scale(1.333); }
    to   { transform: translate(-50%, -50%) scale(1); }
}

@keyframes gears-fade {
    0%   { opacity: 0; filter: blur(0); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
    55%  { opacity: 0.9; filter: blur(0); animation-timing-function: ease-in; }
    100% { opacity: 0; filter: blur(16px); }
}

/* front page gears */
.gears.home {
    top: auto;
    left: auto;
    --gh: min(78vh, 55vw);
    right: calc(var(--gh) * -0.1);
    bottom: calc(var(--gh) * -0.32);
    height: var(--gh);
    visibility: visible;
    opacity: 1;
    transform: none;
    transform-origin: 35% 68%;
}

.gears.home .gear { animation-play-state: running; }

.gears.home.intro {
    animation:
        gears-land 3s cubic-bezier(0.33, 1, 0.68, 1) both,
        gears-show 2s ease-in-out both;
}

@keyframes gears-land {
    from { transform: scale(1.6); }
    to   { transform: scale(1); }
}

@keyframes gears-show {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* top bar */
.topbar {
    position: fixed;
    z-index: 1000;
    top: var(--bar-top);
    left: 0;
    right: 0;
    width: var(--bar-w);
    height: var(--bar-h);
    margin: 0 auto;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    box-shadow:
        inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.55),
        inset -1px -1px 0 rgba(255, 255, 255, 0.22),
        inset 0 0 18px rgba(255, 255, 255, 0.28),
        0 1px 14px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(16px) saturate(150%) brightness(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(150%) brightness(1.1);
    transition: width var(--bar-t), top var(--bar-t), height var(--bar-t), background var(--bar-t), box-shadow var(--bar-t);
}

/* light rim */
.topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.15) 26%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.15) 74%,
        rgba(255, 255, 255, 0.5) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.refract .topbar {
    backdrop-filter: blur(16px) url(#glass) saturate(150%) brightness(1.1);
}

.glass-defs { position: absolute; }

.topbar nav { height: 100%; }

.site-menu {
    container-type: inline-size;
    display: flex;
    justify-content: space-between;
    height: 100%;
    padding: 0 78px 0 58px;
    list-style: none;
    transition: padding var(--bar-t);
}

.site-menu li {
    display: flex;
    justify-content: center;
    width: 0;
}

.site-menu li a { flex: none; position: relative; }

/* full-slot hit area */
.site-menu li a::after {
    content: '';
    position: absolute;
    inset: 0 auto;
    left: 50%;
    width: calc(100cqw / 7);
    translate: -50% 0;
}

/* gears hug logo */
.site-menu li.home { margin-right: -3vw; }

.site-menu a {
    display: grid;
    grid-template-rows: 28px auto;
    justify-items: center;
    align-items: center;
    row-gap: 5.3px;
    height: 100%;
    padding-top: 22.4px;
    color: #9a9a9a;
    text-decoration: none;
    transition: padding var(--bar-t), color 0.2s ease;
}

.site-menu svg {
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.35s ease, scale var(--bar-t);
}

.site-menu span {
    font-size: 9.45px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity 0.25s ease 0.25s;
}

.topbar .site-menu li.home a {
    grid-template-rows: 1fr;
    padding-top: 0;
    color: var(--gold);
}

.site-menu .home-gears {
    width: 47.6px;
    height: 51px;
    fill: currentColor;
    stroke: none;
    translate: 0 0;
    transition: width var(--bar-t), height var(--bar-t);
}

.site-menu svg:not(.home-gears) { scale: 0.85; }
.is-compact .home-gears { width: 22.4px; height: 24px; translate: none; }
.is-compact .site-menu svg:not(.home-gears) { scale: 0.8; }

.site-menu a:hover { color: var(--gold); }

.site-menu a[aria-current] { color: var(--ui); }

.topbar.is-compact {
    top: var(--bar-top-compact);
    width: var(--bar-w-compact);
    height: var(--bar-h-compact);
    background: rgba(255, 255, 255, 0.13);
    box-shadow:
        inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.55),
        inset -1px -1px 0 rgba(255, 255, 255, 0.22),
        inset 0 0 10px rgba(255, 255, 255, 0.22),
        0 1px 14px rgba(0, 0, 0, 0.12);
}

.is-compact .site-menu a { padding-top: calc((var(--bar-h-compact) - 28px) / 2); }
.is-compact .site-menu { padding: 0 36px; }
.is-compact .site-menu span { opacity: 0; transition-delay: 0s; transition-duration: 0.15s; }

@media (hover: hover) and (min-width: 769px) {
    .topbar.is-compact:hover,
    .topbar.is-compact:focus-within {
        width: var(--bar-w);
        height: var(--bar-h);
        background: rgba(255, 255, 255, 0.13);
        -webkit-backdrop-filter: blur(16px) saturate(150%) brightness(1.1);
        backdrop-filter: blur(16px) saturate(150%) brightness(1.1);
    }

    .refract .topbar.is-compact:hover,
    .refract .topbar.is-compact:focus-within {
        backdrop-filter: blur(16px) url(#glass) saturate(150%) brightness(1.1);
    }

    .is-compact:hover .site-menu a,
    .is-compact:focus-within .site-menu a { padding-top: 22.4px; }

    .is-compact:hover .site-menu,
    .is-compact:focus-within .site-menu { padding: 0 78px 0 58px; }

    .is-compact:hover .site-menu span,
    .is-compact:focus-within .site-menu span { opacity: 1; transition-delay: 0.25s; transition-duration: 0.25s; }

    .is-compact:hover .home-gears,
    .is-compact:focus-within .home-gears { width: 47.6px; height: 51px; }

    .is-compact:hover .site-menu svg,
    .is-compact:focus-within .site-menu svg { scale: 0.85; }
}

/* page */
.page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 38.68px - 31px);
    padding: 153.4px 0 20px;
}

.page-body { flex: 1; position: relative; z-index: 1; }
.page-main { align-self: stretch; }

.page-head > h1 {
    margin: 0 0 0 var(--gutter);
    font-size: clamp(56px, 7.1vw, 115.45px);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.823;
    letter-spacing: -0.07em;
    max-width: 60vw;
    color: var(--ink);
}

.page-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--col) minmax(0, 1fr);
    align-items: start;
}

.rail { margin-left: var(--gutter); width: var(--rail); }


.page-main {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
    color: var(--ui);
}

.page-main a { color: inherit; }
.page-main > :first-child:not(style, link),
.page-main > :is(style, link) + :not(style, link) { margin-top: 57px; }

/* clear the rail */
.page-main > h2:first-child { margin-top: 200px; }

.page-main > p {
    max-width: 72ch;
    margin-inline: auto;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: 0.5px;
}
.page-main > .home-hero ~ p { line-height: 2.1; }
.page-main > .home-hero ~ p:last-child { margin-bottom: 124px; }
.page-main ul { list-style-position: inside; }

.page-main h2 {
    position: relative;
    padding-top: 20px;
    margin: 80px 0;
    font-size: 48px;
    font-weight: 100;
    line-height: 1.15;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--ui);
}

/* full-bleed rule */
.page-main h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    translate: -50% 0;
    border-top: var(--hair);
}

.page-main h2::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 7.75px;
    height: 7.75px;
    translate: -50% -50%;
    border-radius: 50%;
    background: var(--ink);
}

.page-main > .home-hero ~ p + h2 { margin-top: 160px; }

.page-main h2 { scroll-margin-top: calc(var(--bar-top-compact) + var(--bar-h-compact) + 24px); }

/* rail */
.rail {
    position: sticky;
    top: calc(var(--bar-top) + var(--bar-h) + 55px);
    transition: top var(--bar-t);
    margin-top: 53.5px;
}


@media (min-width: 769px) {
    body:has(.topbar.is-compact) .rail { top: calc(var(--bar-top-compact) + var(--bar-h-compact) + 55px); }
}

.rail ul { list-style: none; }

.rail li {
    position: relative;
    padding: 14.25px 0;
    transition: padding 0.3s ease;
}

.rail li::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    border-left: var(--hair);
}

.rail li:first-child::before { top: 50%; }

.rail li { --pad: 14.25px; --up: 0px; }
.rail li:last-child::before {
    bottom: auto;
    height: calc(var(--pad) + 13px * 1.23 / 2 - var(--up) + 1px);
}

.rail button {
    display: block;
    padding: 0 0 0 12.9px;
    font: inherit;
    font-size: 13px;
    font-weight: 200;
    line-height: 1.23;
    letter-spacing: 0.07em;
    text-align: left;
    color: var(--ink);
    background: none;
    border: 0;
    cursor: pointer;
    transition: font-size 0.3s ease, font-weight 0.3s ease;
}

.rail button::after {
    content: '';
    position: absolute;
    left: 4px;
    bottom: 3px;
    width: 104.7px;
    border-bottom: var(--hair);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.rail li:not(.is-active) button:hover::after { transform: scaleX(1); }

.rail li.is-active { --pad: 36.5px; --up: 1px; padding: var(--pad) 0 12.5px; }
.rail li.is-active:first-child { --pad: 14.25px; --up: 2px; }

.rail .is-active button {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.23;
}

.rail .is-active::after {
    content: '';
    position: absolute;
    top: calc(var(--pad) + 13px * 1.23 / 2 - var(--up));
    left: 0.375px;
    width: 7.75px;
    height: 7.75px;
    margin-top: calc(1px - 3.875px);
    border-radius: 50%;
    background: var(--ink);
}

/* home */
.page-main > .home-hero:first-child { margin-top: 0; }

.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 153.4px);
    padding-inline: 20px;
}

.kicker {
    margin-bottom: 24px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #8a8a8a;
}

h1.home-lead {
    text-align: center;
    margin: 0;
    font-size: clamp(56px, 7.1vw, 115.45px);
    font-weight: 800;
    line-height: 0.823;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.home-mark {
    --mark: min(100vw - 40px, 85vh);
    position: relative;
    flex: 1;
    align-self: stretch;
    min-height: calc(var(--mark) * 0.4);
    margin: 0;
    overflow: hidden;
}

.home-mark img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--mark);
    aspect-ratio: 1;
    object-fit: contain;
    padding: 10%;
    translate: -50% -60%;
}

.page-main h3 {
    margin: 72px 0 14px;
    font-size: clamp(28px, 3.55vw, 57.7px);
    font-weight: 800;
    line-height: 0.823;
    letter-spacing: -0.07em;
    text-align: center;
    color: var(--ink);
}

.page-main h3 svg {
    display: block;
    width: 106px;
    height: 106px;
    margin: 0 auto 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 0.68;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-gears { display: none; }

/* scroll cue */
.scroll-down {
    display: grid;
    place-items: center;
    width: 38.68px;
    height: 38.68px;
    margin: 0 auto 40px;
    padding: 0;
    position: relative;
    isolation: isolate;
    color: var(--ui);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.scroll-down:hover { color: #fff; }

.scroll-down svg {
    width: 12px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
}

/* equal-width downloads */
.download-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    gap: 26px;
    margin-top: 0;
}

.download-btn,
.download-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38.68px;
    padding: 0 16px;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    position: relative;
    isolation: isolate;
    color: var(--ui);
    background: transparent;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.download-all-btn {
    align-self: center;
    min-width: 247.56px;
    height: 38.68px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.download-btn:hover,
.download-all-btn:hover { color: #fff; }

/* prev / next */
.page-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 42px;
    margin-top: auto;
    padding-top: 64px;
}

.page-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 0 1 15vw;
    min-width: min(190px, 100%);
    height: 38.68px;
    padding: 0 18px;
    position: relative;
    isolation: isolate;
    color: var(--ui);
    text-decoration: none;
    transition: color 0.2s ease, translate 0.3s ease;
}

.page-nav a:hover { color: #fff; }
.page-nav .prev:hover { translate: -15px 0; }
.page-nav .next:hover { translate: 15px 0; }

/* button shape */
.download-btn::before,
.download-all-btn::before,
.page-nav a::before,
.scroll-down::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 0.5px solid var(--ui);
    border-radius: 5px;
    transition: inset 0.3s ease, background 0.2s ease, border-radius 0.3s ease, border-color 0.2s ease;
}

.download-btn:hover::before,
.download-all-btn:hover::before,
.page-nav a:hover::before,
.scroll-down:hover::before {
    inset: 0 -16px;
    background: var(--gold);
    border-color: transparent;
    border-radius: 20px;
}

.page-nav .next { justify-content: flex-end; }

.page-nav .arrow { font-size: 1rem; line-height: 1; }

.page-nav .label {
    font-size: 11.45px;
    font-weight: 300;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* badge */
.badge {
    position: relative;
    z-index: 2;
    width: 240.4px;
    margin: 0 auto 31px;
    color: var(--ui);
    font-size: 11.45px;
    font-weight: 300;
    border: 0.5px solid var(--ui);
}

.badge a { color: inherit; text-decoration: none; }
.badge a:hover { color: var(--gold); }

.badge-card,
.badge-foot { position: relative; }

.badge-card::before,
.badge-foot::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 39.3px;
    border-left: 0.5px solid var(--ui);
    pointer-events: none;
}

/* hover card */
.badge-card {
    position: absolute;
    bottom: 100%;
    left: -0.5px;
    right: -0.5px;
    border: 0.5px solid var(--ui);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    translate: 0 6px;
    visibility: hidden;
    transition: opacity 0.25s ease, translate 0.25s ease, visibility 0s 0.25s;
}

.badge:hover .badge-card,
.badge:focus-within .badge-card,
.badge.is-open .badge-card {
    opacity: 1;
    translate: 0 0;
    visibility: visible;
    transition: opacity 0.25s ease, translate 0.25s ease;
}

.badge-social {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-left: 39.3px;
    padding: 10px 15px 4px 8px;
    list-style: none;
    border-top: 0.5px solid var(--ui);
}

.badge-social a { display: block; }

.badge-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.badge-contact { padding: 4px 0; list-style: none; }

.badge-contact li {
    display: grid;
    grid-template-columns: 39.3px 1fr;
    align-items: center;
    height: 31px;
}

.badge-contact svg {
    justify-self: center;
    width: 9px;
    height: 9px;
    fill: currentColor;
}

.badge-contact a { padding-left: 8px; }

.badge-foot {
    display: grid;
    grid-template-columns: 39.3px 1fr;
    height: 38.68px;
}

.badge-mark {
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-mark svg {
    width: 20.6px;
    height: 19px;
    overflow: visible;
    fill: currentColor;
}

.badge-year {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 14px;
}

/* bar-wide gallery */
.gallery {
    --w: var(--bar-w);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    width: var(--w);
    margin: 14px 0 44px calc(50% - var(--w) / 2);
}

.gallery figure { flex: 1 1 360px; min-width: 0; }

.gallery a {
    display: block;
    overflow: hidden;
    border-radius: 20px;
    cursor: zoom-in;
}

.gallery img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption { text-align: left; }

.gallery.masonry {
    --gap: 24px;
    display: flex;
    align-items: flex-start;
    gap: var(--gap);
}

.masonry-col { flex: 1; min-width: 0; }

@media (max-width: 768px) { .gallery.masonry { --gap: 12px; } }

.masonry figure { margin: 0 0 var(--gap); }
.masonry img { height: auto; aspect-ratio: auto; }
.masonry a:hover img { transform: none; }

/* logo page */
.logo-main {
    display: grid;
    gap: 36px;
    max-width: 760px;
    margin: 14px auto 44px;
}

.logo-main img,
.versions img {
    width: 100%;
    padding: 12%;
    border-radius: 20px;
}

.logo-main img { border: var(--hair); }

.versions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
    margin: 14px 0 44px;
}

/* element tiles */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
    margin: 14px 0 44px;
}

.asset-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 22%;
    border-radius: 20px;
}

@media (min-width: 769px) {
    .versions > :last-child:nth-child(odd),
    .asset-grid > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 18px);
    }
}

.tile-light img { border: var(--hair); }
.tile-dark img { background: rgba(42, 42, 42, 0.7); border: var(--hair); }

.logo-main figcaption,
.versions figcaption,
.asset-grid figcaption { display: grid; place-items: center; height: 38.68px; margin: 0; }

/* colour swatches */
.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 32px;
    flex: 1;
    min-height: 560px;
    margin: 14px 0 0;
}

.swatch-grid figure { display: flex; }

.swatch {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.swatch-blue { background: var(--blue); }
.swatch-gold { background: var(--gold); }

.swatch-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.swatch-blue .swatch-text { color: var(--gold); }
.swatch-gold .swatch-text { color: var(--blue); }

.swatch-text strong { display: block; margin-bottom: 0.4em; font-size: 1.1rem; }

.swatch-text em {
    position: absolute;
    inset: auto 40px 40px;
    font-size: 22.9px;
    font-weight: 300;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: 0.36em;
    text-transform: uppercase;
}

/* usage rules */
.rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin: 14px 0 46px;
}

.rule-grid figcaption { margin-top: 10px; }

.clearspace {
    padding: 10%;
    border: 2px dashed rgba(31, 31, 31, 0.35);
    border-radius: 20px;
}

.clearspace-fig { width: 100%; max-width: 640px; justify-self: center; }
.clearspace img { width: 100%; }

.rule-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    padding: 10%;
    background: rgba(42, 42, 42, 0.7);
    border: var(--hair);
    border-radius: 20px;
}

.rule-tile img { width: 80%; }

/* wrong example */
.rule-tile .white-box {
    padding: 8% 10%;
    background: #fff;
    border-radius: 4px;
}

.rule-tile .white-box img { width: 100%; }

/* typography */
.archivo { font-family: 'Archivo Black', sans-serif; font-weight: 400; }
.arch { font-family: 'Archivo', sans-serif; }
.mont { font-family: 'Montserrat', sans-serif; }

.w-200 { font-weight: 200; }
.w-400 { font-weight: 400; }
.w-500 { font-weight: 500; }
.w-600 { font-weight: 600; }
.w-800 { font-weight: 800; }

.type-hero {
    --pad-x: clamp(40px, 10vw, 100px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 14px 0 46px;
    padding: clamp(56px, 10vw, 120px) var(--pad-x);
    border-radius: 20px;
    background:
        linear-gradient(rgba(20, 20, 20, 0.6), rgba(20, 20, 20, 0.6)),
        url(../images/photos/tn-dominoes-row.jpg) center 68% / cover;
    color: #fff;
    text-align: left;
}

.type-hero > * { position: relative; z-index: 1; max-width: 34em; }

.type-hero > .type-gears {
    position: absolute;
    z-index: auto;
    right: -6%;
    bottom: -24%;
    height: 75%;
    fill: var(--gold);
}

.type-hero .signal {
    margin: 0 0 1.2em;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.type-hero .rule {
    align-self: stretch;
    max-width: none;
    height: 1px;
    margin: 0 calc(-1 * var(--pad-x)) 1.2em;
    background: var(--gold);
}

.type-hero .display {
    max-width: none;
    margin: 0 0 0.35em;
    color: var(--gold);
    font-size: clamp(2.2rem, 8vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.01em;
}

.type-hero p { color: #fff; font-size: 1.05rem; line-height: 1.6; }

.type-hero .lead {
    margin: 0 0 1.2em;
    font-size: clamp(1.3rem, 2.6vw, 1.9rem);
    font-weight: 700;
    line-height: 1.15;
}

.type-hero p:last-child { margin-bottom: 0; font-weight: 200; }

.type-hero h2 {
    margin: 1.4em 0 0.5em;
    padding-top: 0;
    color: var(--gold);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-transform: none;
}

.type-hero h2::before,
.type-hero h2::after { content: none; }

.faces {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    margin: 14px 0 26px;
}

.specimen {
    padding: 36px;
    border: var(--hair);
    border-radius: 20px;
}

.specimen .meta,
.pair .meta {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.specimen .line {
    margin: 0;
    font-size: clamp(2.2rem, 3.5vw, 4rem);
    line-height: 1.15;
    word-break: break-word;
}

.specimen .note {
    margin: 22px 0 0;
    color: var(--text);
    font-size: 0.95rem;
}

.pairs { margin: 14px 0 26px; }

.pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: clamp(32px, 5vw, 96px);
    padding: 48px 0;
    border-top: var(--hair);
    text-align: left;
}

.pair-head {
    margin: 0;
    font-size: clamp(2.2rem, 4.5vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pair-body {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .versions,
    .asset-grid,
    .swatch-grid,
    .rule-grid,
    .faces,
    .pair { grid-template-columns: minmax(0, 1fr); }

    .swatch { min-height: 480px; }
    .swatch-text em { inset: auto 20px 32px; font-size: 12px; line-height: 1.7; }
    .specimen { padding: 22px; }
    .pair { row-gap: 20px; }
    .pair .meta:nth-child(2) { order: 1; margin: 0; }
    .pair-body { order: 2; }

    .type-hero .signal { font-size: 0.77rem; }
    .type-hero .display { font-size: 1.54rem; }
    .type-hero .lead { font-size: 0.91rem; }
    .type-hero p { font-size: 0.735rem; }
    .type-hero h2 { font-size: 1.05rem; }
    .type-hero > .type-gears { right: -3%; bottom: -12%; height: 37.5%; }
}

/* lightbox */
.lightbox {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 64px 72px 24px;
    border: 0;
    color: #fff;
    background: rgba(17, 17, 17, 0.94);
}

.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lb-in 0.25s ease both;
}

.lightbox::backdrop { background: transparent; }

.lb-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
}

.lb-frame img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.lb-frame figcaption {
    min-height: 1.6em;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.lb-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); }

.lb-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lb-close { top: 16px; right: 16px; }
.lb-prev,
.lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lightbox.single .lb-prev,
.lightbox.single .lb-next { display: none; }

/* chevron optical nudge */
.lb-prev svg { transform: translateX(-1px); }
.lb-next svg { transform: translateX(1px); }

@keyframes lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}


.menu-toggle { display: none; }

/* phone */
@media (max-width: 768px) {
    :root {
        --gutter: 16px;
        --col: calc(100vw - 32px);
        --bar-top: 12px;
        --bar-top-compact: 12px;
        --bar-h: 44px;
        --bar-h-compact: 44px;
    }


    .site-menu a,
    .is-compact .site-menu a { padding-top: 8px; }

    .site-menu .home-gears,
    .is-compact .home-gears { width: 28px; height: 30px; }


    .site-menu,
    .is-compact .site-menu { padding: 0 30px; }

    .site-menu span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .page { padding-top: 84px; }

    .page-head > h1 { font-size: clamp(30px, 9vw, 44px); max-width: none; }
    h1.home-lead { font-size: clamp(34px, 10vw, 48px); }

    .page-main h2 {
        margin: 48px 0;
        padding-top: 16px;
        font-size: clamp(20px, 5.6vw, 26px);
        letter-spacing: 0.3em;
    }

    .page-main > .home-hero ~ p + h2 { margin-top: 96px; }
    .page-main > h2:first-child { margin-top: 72px; }

    .badge { width: 204.3px; }

    .blob {
        width: 700px;
        height: 700px;
        margin: -350px 0 0 -350px;
        filter: blur(58px);
    }

    .gears.home { display: none; }

    .page { overflow-x: clip; }

    /* scrolls under toolbar */
    .home-hero {
        position: relative;
        isolation: isolate;
        min-height: calc(100lvh - 84px);
    }

    .hero-gears {
        display: block;
        position: absolute;
        z-index: -1;
        right: calc(-1 * var(--gutter) - 4vh);
        bottom: -12.5vh;
        height: 39vh;
        fill: var(--gold);
        clip-path: inset(0 0 12.5vh 0);
        animation:
            gears-land 3s cubic-bezier(0.33, 1, 0.68, 1) both,
            gears-show 2s ease-in-out backwards;
        transform-origin: 35% 68%;
    }

    .scroll-down { margin-bottom: calc(40px + 100lvh - 100svh); }

    .download-row { grid-auto-columns: minmax(0, 1fr); gap: 10px; }
    .download-row .download-btn { padding: 0 6px; letter-spacing: 0.1em; }

    .page-nav { flex-wrap: nowrap; gap: 12px; }

    .page-nav a {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 12px;
    }

    .page-nav .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .gallery { --w: calc(100vw - 24px); }

    .page-body {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 var(--gutter);
    }

    .rail { width: auto; }

    .page-main { grid-column: 1; }

    .rail {
        z-index: 10;
        top: calc(var(--bar-top) + var(--bar-h));
        margin: 6px calc(var(--gutter) * -1) 0;
        padding: 6px var(--gutter) 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .rail:empty { display: none; }

    .rail ul {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 34px;
        width: max-content;
        min-width: 80%;
        margin-inline: auto;
        border-top: var(--hair);
    }

    .rail li,
    .rail li.is-active,
    .rail li.is-active:first-child { padding: 10px 0 8px; }

    .rail li::before { display: none; }

    .rail li { max-width: 115px; }

    .rail button { padding: 0; text-align: center; }

    .rail button::after { display: none; }

    .rail .is-active::after {
        top: -4.1px;
        left: 50%;
        margin: 0 0 0 -3.875px;
    }

    .page-main h2 { scroll-margin-top: 130px; }


    .lightbox { padding: 64px 12px 72px; }
    .lb-prev,
    .lb-next { top: auto; bottom: 16px; transform: none; }
    .lb-prev { left: calc(50% - 56px); }
    .lb-next { right: calc(50% - 56px); }
}

@media (max-width: 600px) {
    .rail { display: none; }
    .page-main > h2:first-child { margin-top: 64px; }
}

/* phone menu */
@media (max-width: 768px) {
    .menu-toggle {
        display: grid;
        place-items: center;
        position: absolute;
        top: 0;
        left: 50%;
        width: 44px;
        height: var(--bar-h);
        padding: 0;
        translate: -50% 0;
        color: var(--ui);
        background: none;
        border: 0;
        cursor: pointer;
    }

    .menu-toggle svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: rotate var(--bar-t);
    }

    .topbar,
    .topbar.is-compact { width: max(88px, calc((100vw - 24px) * 0.2)); }

    .topbar.is-open {
        width: 90vw;
        height: 78svh;
    }

    .topbar:not(.is-open) .site-menu { padding: 0 12px; }
    .topbar:not(.is-open) .menu-toggle { left: auto; right: 6px; width: 32px; translate: none; }

    .topbar.is-open .menu-toggle svg { rotate: 180deg; }

    .site-menu,
    .is-compact .site-menu {
        flex-direction: column;
        justify-content: flex-start;
        padding: 0 18px 18px;
    }

    .site-menu li { width: auto; justify-content: flex-start; }
    .site-menu li.home { flex: none; height: var(--bar-h); margin-right: 0; }
    .site-menu li:not(.home) { flex: 1; }

    .site-menu li:not(.home) a,
    .is-compact .site-menu li:not(.home) a {
        grid-template-rows: none;
        grid-template-columns: 28px 1fr 28px;
        justify-items: center;
        column-gap: 0;
        width: 100%;
        padding: 0;
    }

    .site-menu li:not(.home) svg {
        width: auto;
        height: clamp(20px, 3.4vh, 34px);
    }

    .site-menu li:not(.home) span { grid-column: 2; }
    .site-menu li a::after { display: none; }

    .site-menu span,
    .is-compact .site-menu span {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
        opacity: 1;
        font-size: clamp(10.4px, 1.76vh, 17.6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    .lightbox[open] { transition: none !important; animation: none !important; }
}
