/* KSLY Stained Glass — site styles. Hand-written, no framework. */

:root {
    --bg: #0e1114;
    --bg-2: #13181d;
    --surface: #1a2026;
    --surface-2: #222a32;
    --line: rgba(255, 255, 255, .09);
    --ink: #f4efe4;
    --muted: #a9afb6;
    --gold: #e4b33d;
    --gold-2: #f6d684;
    --glass: linear-gradient(115deg, #e4b33d 0%, #e46a3a 25%, #c2386f 45%, #4a6fd8 70%, #2fb39a 100%);

    --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;

    --radius: 18px;
    --radius-sm: 12px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 76px;
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) - 8px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 clamp(15px, .3vw + 14px, 17px)/1.7 var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, dl, dd, figure, blockquote { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 600; }
p { margin: 0; }

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

.icon { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }

.container {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: fixed; left: 12px; top: -60px; z-index: 100;
    background: var(--gold); color: #111; padding: 10px 16px; border-radius: 8px;
    transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Type helpers ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: .78rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
}
.eyebrow::before {
    content: ""; width: 28px; height: 2px; border-radius: 2px;
    background: var(--glass);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4.2vw, 3.4rem);
    letter-spacing: -.01em;
}

.lead { color: var(--muted); font-size: 1.05em; max-width: 60ch; margin-top: 20px; }

.section { padding-block: clamp(72px, 10vw, 128px); position: relative; }
.section-head { margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: end; justify-content: space-between; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 12px 24px;
    border-radius: 999px;
    font-weight: 500; font-size: .95rem; letter-spacing: .01em;
    transition: transform .35s var(--ease-out), background-color .3s, color .3s, box-shadow .35s, border-color .3s;
    will-change: transform;
}
.btn .icon { transition: transform .35s var(--ease-out); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .icon:last-child { transform: translateX(3px); }

.btn-gold { background: var(--gold); color: #17130a; box-shadow: 0 8px 24px -10px rgba(228, 179, 61, .7); }
.btn-gold:hover { background: var(--gold-2); box-shadow: 0 14px 34px -12px rgba(228, 179, 61, .85); }

.btn-ghost { border: 1px solid rgba(255, 255, 255, .28); color: var(--ink); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }

.link-arrow {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--gold); font-weight: 500; font-size: .92rem;
}
.link-arrow .icon { transition: transform .35s var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(5px); }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50;
    height: var(--header-h);
    transition: background-color .4s, box-shadow .4s, height .4s var(--ease);
}
.site-header.is-scrolled {
    --header-h: 64px;
    height: 64px;
    background: rgba(14, 17, 20, .82);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    box-shadow: 0 1px 0 var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: .06em; }
.brand img { width: 44px; height: 44px; transition: transform .6s var(--ease-out); }
.brand:hover img { transform: rotate(-12deg) scale(1.06); }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { display: flex; gap: 4px; }
.nav ul a {
    position: relative; display: block; padding: 8px 12px;
    font-size: .92rem; color: rgba(244, 239, 228, .82);
    transition: color .25s;
}
.nav ul a::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px;
    background: var(--glass);
    transform: scaleX(0); transform-origin: left;
    transition: transform .4s var(--ease-out);
}
.nav ul a:hover, .nav ul a.is-active { color: var(--ink); }
.nav ul a:hover::after, .nav ul a.is-active::after { transform: scaleX(1); }
.nav-call { min-height: 42px; padding: 8px 18px; font-size: .88rem; }

.menu-toggle { display: none; width: 44px; height: 44px; position: relative; z-index: 2; }
.menu-toggle span {
    position: absolute; left: 11px; width: 22px; height: 2px; border-radius: 2px; background: var(--ink);
    transition: transform .4s var(--ease-out), opacity .2s;
}
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 27px; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1020px) {
    .menu-toggle { display: block; }
    .nav {
        position: fixed; inset: 0; z-index: 1;
        flex-direction: column; justify-content: center; gap: 36px;
        background: rgba(10, 12, 15, .97);
        opacity: 0; visibility: hidden;
        transition: opacity .4s var(--ease), visibility 0s .4s;
    }
    .nav ul { flex-direction: column; align-items: center; gap: 6px; }
    .nav ul a { font-family: var(--font-display); font-size: 2rem; padding: 6px 16px; opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s var(--ease-out), color .25s; }
    .nav ul a::after { bottom: 0; }
    .menu-open .nav { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
    .menu-open .nav ul a { opacity: 1; transform: none; }
    .menu-open .nav ul li:nth-child(2) a { transition-delay: .04s; }
    .menu-open .nav ul li:nth-child(3) a { transition-delay: .08s; }
    .menu-open .nav ul li:nth-child(4) a { transition-delay: .12s; }
    .menu-open .nav ul li:nth-child(5) a { transition-delay: .16s; }
    .menu-open .nav ul li:nth-child(6) a { transition-delay: .2s; }
    .menu-open .nav ul li:nth-child(7) a { transition-delay: .24s; }
    .menu-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative; isolation: isolate;
    min-height: 100svh;
    display: flex; align-items: center;
    padding-block: calc(var(--header-h) + 40px) 96px;
    overflow: hidden;
    background: #07090b;
}
.hero-slides, .hero-shade { position: absolute; inset: 0; z-index: -1; }
.hero-slide {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: 70% center;
    opacity: 0;
    transition: opacity 1.6s var(--ease);
}
.hero-slide.is-active { opacity: 1; animation: kenburns 9s var(--ease) both; }
@keyframes kenburns { from { transform: scale(1.1); } to { transform: scale(1); } }

.hero-shade {
    background:
        linear-gradient(90deg, rgba(7, 9, 11, .94) 0%, rgba(7, 9, 11, .8) 40%, rgba(7, 9, 11, .2) 78%),
        linear-gradient(0deg, var(--bg) 0%, rgba(14, 17, 20, 0) 30%);
}

.hero-content { position: relative; }
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.9rem, 8vw, 6.4rem);
    line-height: .98;
    letter-spacing: -.015em;
}
.shine {
    background: var(--glass);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    animation: shine 9s linear infinite;
}
@keyframes shine { to { background-position: -220% 0; } }

.hero-lead { color: rgba(244, 239, 228, .78); max-width: 46ch; margin-top: 24px; font-size: 1.06em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* Staggered entrance on load; pure CSS so it never waits for JS */
.hero-in { animation: rise 1s var(--ease-out) both; animation-delay: calc(var(--d) * 140ms + 150ms); }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.hero-dots { position: absolute; left: var(--gutter); bottom: 36px; display: flex; gap: 10px; }
@media (min-width: 1240px) { .hero-dots { left: calc((100vw - 1240px) / 2 + var(--gutter)); } }
.hero-dots button { width: 34px; height: 24px; position: relative; }
.hero-dots button::before {
    content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; border-radius: 2px;
    background: rgba(255, 255, 255, .3);
    transition: background-color .3s;
}
.hero-dots button.is-active::before { background: var(--gold); }

.scroll-cue {
    position: absolute; right: var(--gutter); bottom: 30px;
    width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .4); border-radius: 14px;
}
.scroll-cue span {
    position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
    background: var(--gold);
    animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

@media (max-width: 720px) {
    .hero { align-items: flex-end; }
    .hero .eyebrow { letter-spacing: .14em; }
    .hero-slide { object-position: center; }
    .hero-shade {
        background: linear-gradient(0deg, rgba(7, 9, 11, .96) 8%, rgba(7, 9, 11, .55) 55%, rgba(7, 9, 11, .2) 100%);
    }
    .scroll-cue { display: none; }
    .hero-actions .btn { flex: 1 1 auto; }
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: clamp(36px, 6vw, 80px); grid-template-columns: 1.15fr .85fr; align-items: center; }
.info-cards { display: grid; gap: 14px; }
.info-card {
    display: flex; gap: 18px; align-items: flex-start;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .45s var(--ease-out), border-color .3s, background-color .3s;
}
.info-card:hover { transform: translateX(6px); border-color: rgba(228, 179, 61, .4); background: var(--surface-2); }
.info-card h3 { font-size: 1rem; margin-bottom: 4px; }
.info-card p { color: var(--muted); font-size: .94rem; }
.info-card a:hover { color: var(--gold-2); }
.info-icon {
    display: grid; place-items: center; flex: none;
    width: 46px; height: 46px; border-radius: 50%;
    color: var(--gold);
    background: rgba(228, 179, 61, .1);
    border: 1px solid rgba(228, 179, 61, .25);
}

@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Shared media ---------- */
.media { position: relative; display: block; width: 100%; overflow: hidden; background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out), filter .6s; }

/* ---------- Services ---------- */
.services { background: var(--bg-2); }
.service-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.service-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out), border-color .3s;
}
.service-card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); border-color: rgba(228, 179, 61, .35); }
.service-card .media { aspect-ratio: 4 / 3; }
.service-card:hover .media img { transform: scale(1.07); }
.zoom {
    position: absolute; right: 16px; top: 16px;
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: rgba(14, 17, 20, .65); backdrop-filter: blur(6px);
    color: var(--ink);
    opacity: 0; transform: scale(.7);
    transition: opacity .35s, transform .45s var(--ease-out);
}
.service-card:hover .zoom, .media:focus-visible .zoom { opacity: 1; transform: none; }
.service-body { display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 30px; flex: 1; }
.service-body h3 { font-family: var(--font-display); font-size: 1.7rem; }
.service-body p { color: var(--muted); font-size: .95rem; flex: 1; }

@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .service-grid { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.project-track { display: grid; gap: 22px; grid-template-columns: repeat(4, 1fr); }
.project-card .media { aspect-ratio: 4 / 5; border-radius: var(--radius); }
.project-card .media::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(7, 9, 11, .7), rgba(7, 9, 11, 0) 50%);
    transition: opacity .5s;
}
.project-card:hover .media img { transform: scale(1.08); }
.project-card:hover .media::after { opacity: .4; }
.num {
    position: absolute; left: 18px; bottom: 14px; z-index: 1;
    font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
    color: var(--gold-2);
}
.project-body { padding: 18px 4px 0; }
.project-body h3 { font-size: 1.05rem; letter-spacing: .02em; }
.project-body p { color: var(--muted); font-size: .9rem; margin-top: 4px; }

@media (max-width: 960px) {
    /* Horizontal swipe row on smaller screens */
    .project-track {
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(240px, 72%);
        overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
        margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); padding-bottom: 8px;
        scrollbar-width: none;
    }
    .project-track::-webkit-scrollbar { display: none; }
    .project-card { scroll-snap-align: start; }
}
@media (min-width: 621px) and (max-width: 960px) { .project-track { grid-auto-columns: 40%; } }

/* ---------- Gallery (masonry) ---------- */
.gallery { background: var(--bg-2); }
.masonry { columns: 3 300px; column-gap: 20px; }
.tile {
    position: relative; display: block; width: 100%;
    margin-bottom: 20px; break-inside: avoid;
    border-radius: var(--radius-sm); overflow: hidden;
    background: var(--surface-2);
    text-align: left;
}
.tile img { width: 100%; transition: transform 1.1s var(--ease-out); }
.tile::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(7, 9, 11, .88) 0%, rgba(7, 9, 11, 0) 55%);
    opacity: 0; transition: opacity .5s var(--ease);
}
.tile-cap {
    position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1;
    font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2;
    opacity: 0; transform: translateY(14px);
    transition: opacity .45s, transform .55s var(--ease-out);
}
.tile-cap small { display: block; font-family: var(--font-body); font-size: .8rem; color: var(--gold-2); margin-top: 4px; letter-spacing: .03em; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; transform: none; }
@media (max-width: 640px) {
    .masonry { columns: 2; column-gap: 12px; }
    .tile { margin-bottom: 12px; }
    /* Thumbnails are too small for captions; the lightbox shows them instead */
    .tile-cap, .tile::after { display: none; }
}
@media (hover: none) {
    .tile::after { opacity: .9; }
    .tile-cap { opacity: 1; transform: none; font-size: 1.1rem; }
}

/* ---------- Stats ---------- */
.stats { overflow: hidden; }
.stats::before {
    /* soft stained-glass glow behind the numbers */
    content: ""; position: absolute; inset: 15% -10%; z-index: -1;
    background: var(--glass); opacity: .14; filter: blur(80px); border-radius: 50%;
}
.stat-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); }
.stat {
    display: flex; flex-direction: column-reverse; gap: 6px;
    padding: 30px 24px; text-align: center;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: rgba(26, 32, 38, .6);
}
.stat dd {
    font-family: var(--font-display); font-size: clamp(3rem, 6vw, 4.4rem); line-height: 1;
    color: var(--gold-2);
    font-variant-numeric: lining-nums tabular-nums;
}
.stat dt { color: var(--muted); font-size: .92rem; }
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Reviews ---------- */
.reviews-grid { display: grid; gap: clamp(36px, 5vw, 64px); grid-template-columns: .8fr 1.2fr; align-items: start; }
.reviews-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.review-track { display: grid; gap: 18px; }
.review {
    position: relative;
    padding: 30px 30px 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .5s var(--ease-out), border-color .3s;
}
.review:hover { transform: translateY(-4px); border-color: rgba(228, 179, 61, .35); }
.review .quote { position: absolute; right: 26px; top: 24px; width: 34px; height: 34px; color: rgba(228, 179, 61, .3); }
.review blockquote { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.4; padding-right: 36px; }
.review figcaption { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.review figcaption img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(228, 179, 61, .5); }
.review figcaption span { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.review figcaption strong { display: block; color: var(--ink); font-weight: 600; font-size: .95rem; }

@media (max-width: 900px) {
    .reviews-grid { grid-template-columns: 1fr; }
    .reviews-intro { position: static; }
    .review-track {
        grid-auto-flow: column; grid-auto-columns: 86%; align-items: start;
        overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
        margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); padding-bottom: 8px;
        scrollbar-width: none;
    }
    .review-track::-webkit-scrollbar { display: none; }
    .review { scroll-snap-align: start; }
    .review blockquote { font-size: 1.2rem; }
}

/* ---------- CTA ---------- */
.cta { padding-block: 0 clamp(72px, 9vw, 112px); }
.cta-inner {
    position: relative; overflow: hidden;
    display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
    padding-block: clamp(36px, 5vw, 56px);
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.cta-inner { padding-inline: clamp(24px, 5vw, 56px); max-width: calc(1240px - var(--gutter) * 2); width: calc(100% - var(--gutter) * 2); }
.cta-inner::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--glass);
}
.cta h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.6rem); max-width: 18ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: #090b0d; border-top: 1px solid var(--line); padding-top: clamp(56px, 8vw, 88px); }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1.2fr .8fr; }
.footer-brand p { color: var(--muted); font-size: .92rem; margin-top: 18px; max-width: 34ch; }
.footer-brand .brand img { width: 56px; height: 56px; }
.site-footer h3 { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.footer-list li { display: flex; gap: 12px; color: var(--muted); font-size: .92rem; margin-bottom: 14px; }
.footer-list .icon { margin-top: 4px; color: var(--gold); }
.footer-list a:hover, .footer-links a:hover { color: var(--ink); }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--muted); font-size: .92rem; transition: color .25s, padding .35s var(--ease-out); }
.footer-links a:hover { padding-left: 6px; }
.socials { display: flex; gap: 10px; margin-top: 22px; }
.socials a {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--line); color: var(--ink);
    transition: background-color .3s, color .3s, transform .4s var(--ease-out), border-color .3s;
}
.socials a:hover { background: var(--gold); color: #17130a; border-color: var(--gold); transform: translateY(-3px); }
.footer-bottom {
    display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
    margin-top: 48px; padding-block: 22px;
    border-top: 1px solid var(--line);
    color: #7b8289; font-size: .84rem;
}
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Back to top ---------- */
.to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 40;
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: var(--gold); color: #17130a;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7);
    opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none;
    transition: opacity .35s, transform .45s var(--ease-out);
}
.to-top .icon { transform: rotate(-90deg); }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Lightbox ---------- */
.lightbox {
    width: 100vw; height: 100dvh; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0;
    background: rgba(5, 6, 8, .94);
    color: var(--ink);
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; animation: fade .35s var(--ease); }
.lightbox figure { display: grid; justify-items: center; gap: 14px; padding: 64px 72px; max-width: 100%; max-height: 100%; }
.lightbox img {
    max-width: min(1400px, 100%); max-height: calc(100dvh - 160px); width: auto; height: auto;
    border-radius: 10px;
    transition: opacity .3s, transform .45s var(--ease-out);
}
.lightbox img.is-loading { opacity: 0; transform: scale(.97); }
.lightbox figcaption { color: var(--muted); text-align: center; font-size: .92rem; }
.lb-btn {
    position: absolute; display: grid; place-items: center;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255, 255, 255, .08); color: var(--ink);
    transition: background-color .25s;
}
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; margin-top: -24px; }
.lb-next { right: 16px; top: 50%; margin-top: -24px; }
.lb-count { position: absolute; top: 28px; left: 24px; color: var(--muted); font-size: .85rem; letter-spacing: .1em; }
@media (max-width: 640px) {
    .lightbox figure { padding: 64px 12px 90px; }
    .lb-prev, .lb-next { top: auto; bottom: 20px; margin: 0; }
    .lb-prev { left: calc(50% - 60px); }
    .lb-next { right: calc(50% - 60px); }
}
@keyframes fade { from { opacity: 0; } }

/* ---------- Scroll reveal ----------
   Only hides content when JS is running (html.js is set inline in <head>),
   so the page is fully readable without JavaScript. */
.js [data-reveal],
.js [data-reveal-group] > * {
    opacity: 0;
    /* `translate` (not `transform`) so it never fights the cards' hover transforms */
    translate: 0 32px;
}
.js [data-reveal]:not(.is-done),
.js [data-reveal-group]:not(.is-done) > * {
    transition: opacity .9s var(--ease-out), translate 1s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 110ms);
}
.js [data-reveal].is-visible,
.js [data-reveal-group].is-visible > * { opacity: 1; translate: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
    .js [data-reveal], .js [data-reveal-group] > * { opacity: 1; translate: none; }
}
