/*
 * Milan Ghimire — portfolio
 * Dark editorial, dependency-free. Used by the homepage, project
 * case studies and 404 page.
 */

/* Self-hosted variable fonts (latin subset) */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/webfonts/fraunces-normal-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/webfonts/fraunces-italic-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/webfonts/inter-normal-latin.woff2') format('woff2');
}

:root {
    --bg: #0b0b0e;
    --surface: #131318;
    --surface-2: #1a1a21;
    --line: #26262e;
    --line-soft: #1d1d24;
    --text: #ece9e2;
    --muted: #9b98a3;
    --accent: #d9a55b;
    --accent-bright: #e8b96f;
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Film grain */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
    background: var(--accent);
    color: #17120a;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.08;
}

h1 em, h2 em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent-bright);
}

h1 {
    font-size: clamp(3rem, 9vw, 6.25rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -0.01em;
    margin-bottom: 1.75rem;
}

h3 {
    font-size: 1.4rem;
}

p {
    max-width: 62ch;
}

a {
    color: var(--accent);
    text-decoration: none;
}

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

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

section {
    scroll-margin-top: 72px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -48px;
    left: 16px;
    background: var(--accent);
    color: #17120a;
    padding: 8px 16px;
    border-radius: 6px;
    z-index: 3000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 12px;
}

/* ============ Header ============ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}

.scroll-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

.site-header.scrolled {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line-soft);
}

.site-header nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--text);
    letter-spacing: 0.01em;
}

.site-header ul {
    display: flex;
    gap: 30px;
    list-style: none;
}

.site-header ul a {
    position: relative;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 4px 0;
    transition: color 0.25s;
}

.site-header ul a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.site-header ul a:hover,
.site-header ul a.active {
    color: var(--text);
}

.site-header ul a:hover::after,
.site-header ul a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ============ Hero ============ */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 55% 45% at 80% 18%, rgba(217, 165, 91, 0.12), transparent 65%),
        radial-gradient(ellipse 45% 40% at 12% 88%, rgba(84, 98, 180, 0.12), transparent 65%),
        var(--bg);
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* Cursor-tracked glow (desktop pointers only, driven by site.js) */
.hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background: radial-gradient(
        520px circle at var(--mx, 70%) var(--my, 30%),
        rgba(217, 165, 91, 0.09),
        transparent 70%
    );
}

.hero-glow.on {
    opacity: 1;
}

/* Giant Devanagari watermark */
.hero-watermark {
    position: absolute;
    right: -0.06em;
    top: 50%;
    transform: translateY(-52%);
    font-family: var(--serif);
    font-size: clamp(11rem, 22vw, 20rem);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(236, 233, 226, 0.06);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .hero-watermark {
        display: none;
    }
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(217, 165, 91, 0.5);
    animation: pulse 2.4s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(217, 165, 91, 0.45); }
    70%  { box-shadow: 0 0 0 12px rgba(217, 165, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 165, 91, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .pulse {
        animation: none;
    }
}

.accent-dot {
    color: var(--accent);
    font-style: normal;
}

.lede {
    color: var(--muted);
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.65;
    margin-top: 1.75rem;
    max-width: 46ch;
}

.lede strong {
    color: var(--text);
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-solid {
    background: var(--accent);
    color: #17120a;
}

.btn-solid:hover {
    background: var(--accent-bright);
}

.btn-arrow {
    transition: transform 0.25s;
}

.btn-solid:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-ghost {
    border: 1px solid var(--line);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
}

/* Hero meta strip */
.hero-meta-wrap {
    width: 100%;
    margin-top: clamp(3rem, 8vh, 6rem);
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    border-top: 1px solid var(--line-soft);
    padding-top: 28px;
}

.hero-meta dt,
.contact-meta dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.hero-meta dd,
.contact-meta dd {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.55;
}

/* ============ Skills marquee ============ */
.marquee {
    overflow: hidden;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    padding: 18px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
    display: flex;
    align-items: baseline;
    gap: 34px;
    width: max-content;
    animation: marquee 36s linear infinite;
}

.marquee-track span {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.marquee-track .m-alt {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.03em;
    font-size: 1rem;
    color: var(--text);
}

.marquee-track .m-sep {
    color: var(--accent);
    font-size: 0.6rem;
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}

.marquee + .section {
    border-top: 0;
}

/* ============ Sections ============ */
.section {
    padding: clamp(90px, 12vw, 140px) 0;
    border-top: 1px solid var(--line-soft);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 2.25rem;
}

.sec-num {
    font-family: var(--serif);
    font-style: italic;
    color: var(--accent);
    font-size: 1.05rem;
}

.sec-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft);
}

.section p + p {
    margin-top: 1rem;
}

/* ============ About ============ */
.grid-2 {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
    align-items: center;
}

.about-photo {
    position: relative;
}

.about-photo img {
    border-radius: 12px;
    filter: grayscale(35%) contrast(1.02);
    transition: filter 0.5s ease;
}

.about-photo:hover img {
    filter: grayscale(0%);
}

.about-photo::after {
    content: "";
    position: absolute;
    inset: 20px -20px -20px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    z-index: -1;
}

.about-photo figcaption {
    position: absolute;
    right: 14px;
    bottom: 12px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(236, 233, 226, 0.85);
    background: rgba(11, 11, 14, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 5px 12px;
    border-radius: 999px;
}

.toolbox {
    margin-top: 2.25rem;
}

.toolbox-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chips li {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 0.85rem;
    color: var(--muted);
    transition: color 0.25s, border-color 0.25s;
}

.chips li:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* ============ Experience ============ */
.xp {
    list-style: none;
    margin-top: 3rem;
}

.xp li {
    display: grid;
    grid-template-columns: 200px 1fr 1.2fr;
    gap: 28px;
    padding: 34px 20px;
    margin: 0 -20px;
    border-top: 1px solid var(--line-soft);
    border-radius: 10px;
    transition: background 0.3s;
}

.xp li:last-child {
    border-bottom: 1px solid var(--line-soft);
}

.xp li:hover {
    background: var(--surface);
}

.xp .when {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-top: 6px;
}

.pill-now {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    border: 1px solid rgba(217, 165, 91, 0.45);
    border-radius: 999px;
    background: rgba(217, 165, 91, 0.08);
    color: var(--accent-bright);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    vertical-align: 1px;
}

.xp .role {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 4px;
}

.xp-desc {
    color: var(--muted);
    font-size: 0.98rem;
}

/* ============ Work ============ */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 3rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    color: inherit;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card::before,
.post-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(217, 165, 91, 0.65),
        rgba(217, 165, 91, 0.05) 45%,
        rgba(84, 98, 180, 0.4));
    -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, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.card:hover::before,
.post-card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

.card:hover .card-logo {
    transform: scale(1.06) rotate(-2deg);
}

.card-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 1px solid var(--line);
    margin-bottom: 1.25rem;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.card h3 {
    color: var(--text);
}

.card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.card .tags {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 1rem;
}

.card-link {
    margin-top: auto;
    padding-top: 1.25rem;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
}

.card-link span {
    display: inline-block;
    transition: transform 0.25s;
}

.card:hover .card-link span {
    transform: translateX(4px);
}

.card:hover .card-link {
    color: var(--accent-bright);
}

/* Work sub-groups (Now / Earlier) */
.work-group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 3.5rem;
}

.work-group:first-of-type {
    margin-top: 3rem;
}

.work-group + .cards {
    margin-top: 1.5rem;
}

.work-group-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.work-group-label strong {
    color: var(--accent);
    font-weight: 600;
}

.work-group::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft);
}

/* Featured (current) project cards */
.card-featured {
    border-color: rgba(217, 165, 91, 0.28);
    background: linear-gradient(180deg, rgba(217, 165, 91, 0.05), transparent 45%), var(--surface);
}

.card-soon {
    cursor: default;
}

.card-soon:hover {
    transform: none;
    box-shadow: none;
}

.card-soon:hover::before {
    opacity: 0;
}

.card-soon .card-link {
    color: var(--muted);
}

.card .pill-now {
    margin-left: 0;
}

.card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

/* Photography */
.photography {
    margin-top: 72px;
}

.photography-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.photo-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 760px;
}

.photo-strip figure {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
}

.photo-strip img {
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-strip figure:hover img {
    transform: scale(1.045);
}

.photo-strip figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 18px 14px;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--text);
    background: linear-gradient(transparent, rgba(11, 11, 14, 0.88));
}

/* ============ How I work ============ */
.practices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 3rem;
}

.practice {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px 28px;
    transition: border-color 0.3s, transform 0.3s;
}

.practice:hover {
    border-color: rgba(217, 165, 91, 0.4);
    transform: translateY(-4px);
}

.practice h3 {
    font-size: 1.12rem;
    color: var(--text);
}

.practice .p-num {
    display: block;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.practice p {
    color: var(--muted);
    font-size: 0.93rem;
    margin-top: 0.6rem;
    line-height: 1.65;
}

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

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

/* ============ Architecture flow (case studies) ============ */
.flow {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    margin-top: 2.25rem;
    max-width: 980px;
}

.flow + .flow {
    margin-top: 1.25rem;
}

.flow-node {
    flex: 1 1 0;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
}

.fn-kicker {
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.fn-title {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

.fn-desc {
    color: var(--muted);
    font-size: 0.83rem;
    margin-top: 4px;
    line-height: 1.55;
}

.flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 14px;
    flex-shrink: 0;
}

.flow-arrow .fa-glyph {
    color: var(--accent);
    font-size: 1.15rem;
    line-height: 1;
}

.flow-arrow .fa-label {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .flow {
        flex-direction: column;
        align-items: stretch;
    }

    .flow-arrow {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 0 10px 22px;
    }

    .flow-arrow .fa-glyph {
        transform: rotate(90deg);
    }
}

/* ============ Store badges ============ */
.store-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.store-row .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
}

.store-row svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ============ Contact ============ */
.mail-link {
    display: inline-block;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.35rem, 3.4vw, 2.4rem);
    color: var(--text);
    margin-top: 1.5rem;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-size: 100% 1px;
    background-position: 0 100%;
    padding-bottom: 6px;
    transition: color 0.3s, background-size 0.3s;
    word-break: break-all;
}

.mail-link:hover {
    color: var(--accent-bright);
    background-size: 100% 2px;
}

.contact-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    border-top: 1px solid var(--line-soft);
    margin-top: 3.5rem;
    padding-top: 28px;
    max-width: 760px;
}

.contact-meta a {
    color: var(--text);
    transition: color 0.25s;
}

.contact-meta a:hover {
    color: var(--accent);
}

.social {
    list-style: none;
    display: flex;
    gap: 14px;
    margin-top: 3rem;
}

.social a {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 50%;
    transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.social a:hover {
    border-color: var(--accent);
    background: rgba(217, 165, 91, 0.06);
    transform: translateY(-3px);
}

.social svg {
    width: 18px;
    height: 18px;
    fill: var(--muted);
    transition: fill 0.25s;
}

.social a:hover svg {
    fill: var(--accent);
}

/* ============ Footer ============ */
.site-footer {
    border-top: 1px solid var(--line-soft);
    padding: 40px 0 32px;
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.1rem;
}

.site-footer nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.site-footer nav a,
.to-top {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    transition: color 0.25s;
}

.site-footer nav a:hover,
.to-top:hover {
    color: var(--text);
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
}

.footer-meta p {
    color: var(--muted);
    font-size: 0.8rem;
}

/* ============ Writing strip ============ */
.posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 3rem;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px;
    color: inherit;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

.post-date {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.post-card h3 {
    font-size: 1.18rem;
    line-height: 1.35;
    color: var(--text);
    margin: 0.7rem 0 1rem;
}

.posts-all {
    display: inline-block;
    margin-top: 1.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.25s;
}

.posts-all:hover {
    color: var(--accent);
}

/* ============ Copy email ============ */
.mail-row {
    display: flex;
    align-items: baseline;
    gap: 18px;
    flex-wrap: wrap;
}

.copy-btn {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.copy-btn.copied {
    color: var(--accent);
    border-color: var(--accent);
}

/* ============ Case study pages ============ */
.case-hero {
    padding: 160px 0 64px;
    background:
        radial-gradient(ellipse 55% 60% at 80% 0%, rgba(217, 165, 91, 0.1), transparent 65%),
        var(--bg);
}

.crumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.crumb a {
    color: var(--muted);
    transition: color 0.25s;
}

.crumb a:hover {
    color: var(--accent);
}

.crumb span {
    color: var(--line);
}

.case-hero h1 {
    font-size: clamp(2.6rem, 7vw, 4.6rem);
}

.case-hero .hero-meta {
    margin-top: 3.5rem;
}

.case-body {
    padding: 24px 0 110px;
}

.case-body h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
    margin: 3rem 0 1.1rem;
}

.case-body h2:first-child {
    margin-top: 2rem;
}

.feature-list {
    list-style: none;
    display: grid;
    gap: 12px;
    max-width: 62ch;
    margin-top: 1.25rem;
}

.feature-list li {
    position: relative;
    padding-left: 28px;
    color: var(--muted);
}

.feature-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.feature-list strong {
    color: var(--text);
    font-weight: 600;
}

.shot-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 2.5rem;
    max-width: 900px;
}

.shot-row img,
.shot-wide img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.shot-wide {
    margin-top: 2.5rem;
    max-width: 900px;
}

.shot-row.narrow {
    grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
}

.shot-row figcaption,
.shot-wide figcaption {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 10px;
}

.next-project {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 4.5rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--line-soft);
}

/* ============ Blog post body ============ */
.case-hero .post-date {
    margin-top: 1.6rem;
}

.post-body {
    max-width: 68ch;
    margin-top: 1.5rem;
}

.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5 {
    color: var(--text);
    margin: 2.4rem 0 0.9rem;
}

.post-body h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.post-body h3 {
    font-size: 1.3rem;
}

.post-body h4 {
    font-size: 1.15rem;
}

.post-body h5 {
    font-size: 1rem;
}

.post-body p {
    color: var(--muted);
    margin-bottom: 1.1rem;
}

.post-body ol,
.post-body ul {
    color: var(--muted);
    display: grid;
    gap: 8px;
    margin: 0 0 1.3rem 1.4rem;
}

.post-body li::marker {
    color: var(--accent);
}

.post-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-body strong {
    color: var(--text);
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 6px;
}

.post-body pre {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 22px;
    overflow-x: auto;
    margin: 1.4rem 0 1.6rem;
}

.post-body pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.83rem;
    line-height: 1.65;
}

.post-body img {
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    margin: 1.4rem 0;
}

.post-body blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 18px;
    color: var(--muted);
    margin: 1.4rem 0;
}

/* ============ Reveal ============ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .about-photo {
        max-width: 440px;
    }

    .xp li {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 28px 20px;
    }

    .xp .when {
        padding-top: 0;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .posts {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .hero {
        padding-top: 108px;
        padding-bottom: 48px;
    }

    .hero-meta {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .cards {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
}

@media (max-width: 560px) {
    .brand {
        display: none;
    }

    .site-header nav {
        justify-content: center;
        padding: 16px 20px;
    }

    .site-header ul {
        gap: 18px;
    }

    .site-header ul a {
        font-size: 0.7rem;
        letter-spacing: 0.12em;
    }

    .eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.14em;
    }

    .contact-meta {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .photo-strip {
        grid-template-columns: 1fr;
    }

    .footer-grid,
    .footer-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
