/* ============================================================
   BRAND v2 — sistema de marca fosc (inspirat en jorgeml.com)
   Tipografia: Instrument Sans · Fons negre · Acent verd
   Prova d'estil — base reaprofitable per al rebranding
   ============================================================ */
:root {
    --bg: #000000;
    --bg-soft: #0a0a0b;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --line: rgba(255, 255, 255, 0.1);
    --line-soft: rgba(255, 255, 255, 0.07);
    --text: #ffffff;
    --muted: #b8b8b8;
    --muted-2: #777777;
    --acc: #4ade80;
    --acc-soft: rgba(74, 222, 128, 0.14);

    --ff: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --track-tight: -0.05em;
    --radius: 16px;
    --maxw: 1400px;
    --gutter: 48px;
}

* { box-sizing: border-box; }

body.brand {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--ff);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

/* Tipografia display */
.brand-display {
    font-weight: 400;
    letter-spacing: var(--track-tight);
    line-height: 1.0;
    /* Escala per amplada I per alçada: mai es chafa en pantalles petites/baixes */
    font-size: clamp(2.4rem, min(8.4vw, 12.5vh), 7.5rem);
    margin: 0;
}
.brand-display .dim { color: var(--muted-2); }

.brand-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 clamp(20px, 4vw, 40px);
}

/* ============================================================
   NAVBAR — flotant, liquid glass
   ============================================================ */
.brand-nav {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 2 * var(--gutter));
    max-width: var(--maxw);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand-logo {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.brand-links {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.brand-links a {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 7px 15px;
    border-radius: 999px;
    transition: color 0.25s ease, background 0.25s ease;
}
.brand-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.brand-cta {
    font-size: 0.86rem;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--text);
    color: #000;
    font-weight: 500;
    transition: opacity 0.25s ease;
}
.brand-cta:hover { opacity: 0.85; }

/* ============================================================
   HERO
   ============================================================ */
.brand-hero {
    min-height: 100svh;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 130px var(--gutter) clamp(70px, 10vh, 120px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}
.brand-hero .hero-inner { position: relative; z-index: 1; }
.hero-grid {
    position: absolute; top: 0; left: 50%; width: 100vw; height: 100%;
    transform: translateX(-50%); pointer-events: none; z-index: 0;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
}

.brand-sub {
    margin: clamp(22px, 3vw, 34px) 0 0;
    max-width: 46ch;
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
    line-height: 1.5;
    color: var(--muted);
}

/* ============================================================
   MARQUESINA DE TECNOLOGIES
   ============================================================ */
.brand-marquee {
    position: relative;
    overflow: hidden;
    padding: 26px 0;
    border-top: 1px solid var(--line-soft);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.brand-marquee .track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: brandscroll 38s linear infinite;
}
.brand-marquee .track span {
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0 1.6rem;
    text-transform: uppercase;
}
.brand-marquee .track span.sep { color: var(--acc); opacity: 0.8; }
@keyframes brandscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 1180px) { :root { --gutter: 34px; } }

@media (max-width: 760px) {
    :root { --gutter: 22px; }
    .brand-links { display: none; }
    .brand-hero { padding-top: 110px; }
    .brand-sub { font-size: 1.05rem; }
}

/* Pantalles baixes (portàtils de 13") — evita que el hero quedi comprimit */
@media (max-height: 740px) {
    .brand-hero { padding-top: 104px; }
    .brand-sub { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-hero .hero-inner { opacity: 1; transform: none; animation: none; }
    .brand-marquee .track { animation: none; }
}

/* ============================================================
   SISTEMA DE MOVIMENT (gated per .anim-ready a <html>)
   Sense JS / sense anim-ready => tot visible (progressive enhancement)
   ============================================================ */
.anim-ready [data-reveal] { opacity: 0; transform: translateY(28px); }
.anim-ready [data-reveal].in {
    opacity: 1; transform: none;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Text reveal amb màscara (línia a línia) */
.ln { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.ln > span { display: block; }
.anim-ready .ln > span { transform: translateY(115%); }
.anim-ready .ln.in > span { transform: translateY(0); transition: transform 0.95s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Stagger */
.anim-ready [data-stagger] > * { opacity: 0; transform: translateY(16px); }
.anim-ready [data-stagger] > *.in {
    opacity: 1; transform: none;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .anim-ready [data-reveal], .anim-ready [data-reveal].in,
    .anim-ready .ln > span, .anim-ready [data-stagger] > * {
        opacity: 1 !important; transform: none !important; transition: none !important;
    }
}

/* ============================================================
   PILLS
   ============================================================ */
.pill {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 0.86rem; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 999px; padding: 8px 16px;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.pill:hover { color: var(--text); border-color: rgba(255,255,255,0.26); }
.pill svg { width: 13px; height: 13px; }

/* ============================================================
   SECCIÓ DE PROJECTE (layout partit, estil jorgeml)
   ============================================================ */
.proj {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(70px, 11vh, 150px) var(--gutter);
    border-top: 1px solid var(--line-soft);
}
.proj-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 20px; margin-bottom: clamp(36px, 6vh, 70px);
}
.proj-cat { font-size: 1.35rem; letter-spacing: -0.01em; color: var(--text); }
.proj-count { font-size: 0.82rem; letter-spacing: 0.12em; color: var(--muted-2); white-space: nowrap; }

.proj-grid {
    display: grid;
    grid-template-columns: 1fr 1.08fr;
    gap: clamp(40px, 6vw, 90px);
    align-items: center;
}
.proj-title {
    font-weight: 400; letter-spacing: var(--track-tight); line-height: 1.02;
    font-size: clamp(2rem, 4.4vw, 3.5rem);
    margin: 0 0 22px;
}
.proj-desc { font-size: 1.08rem; line-height: 1.6; color: var(--muted); max-width: 44ch; margin: 0 0 28px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.proj-cta {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 0.95rem; color: var(--text);
    padding: 12px 22px; border-radius: 999px;
    background: var(--text); color: #000; font-weight: 500;
    transition: opacity 0.25s ease;
}
.proj-cta:hover { opacity: 0.85; }
.proj-cta.privat { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

/* ============================================================
   MOCKUP — panell de gestió animat
   ============================================================ */
.mock {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 40px 90px rgba(0,0,0,0.55);
}
.mock-top {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 0.85rem; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 8px 13px; margin-bottom: 16px;
}
.mock-top svg { width: 15px; height: 15px; opacity: 0.85; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mock-stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; }
.mock-stat .n { font-size: 1.7rem; line-height: 1; letter-spacing: -0.02em; }
.mock-stat .l { display: block; margin-top: 6px; font-size: 0.74rem; color: var(--muted-2); }
.mock-stat .n.green { color: var(--acc); }
.mock-list { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.mock-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; border-bottom: 1px solid var(--line-soft);
    font-size: 0.88rem;
}
.mock-row:last-child { border-bottom: 0; }
.mock-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex: none; }
.mock-row .nm { color: var(--text); }
.mock-row .tg { margin-left: auto; font-size: 0.74rem; color: var(--muted-2); background: var(--surface-2); padding: 4px 9px; border-radius: 6px; }

@media (max-width: 860px) {
    .proj-grid { grid-template-columns: 1fr; gap: 40px; }
    .proj-head { margin-bottom: 30px; }
}

/* ============================================================
   MÈDIA EMMARCADA (projectes destacats amb vídeo/imatge real)
   ============================================================ */
.proj.alt .proj-grid { grid-template-columns: 1.08fr 1fr; }
.proj.alt .proj-media { order: -1; }
@media (max-width: 860px) { .proj.alt .proj-media { order: 0; } }

.frame {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 40px 90px rgba(0,0,0,0.55);
}
.frame-bar { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.frame-bar .dots { display: flex; gap: 6px; }
.frame-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.16); }
.frame-bar .lbl { font-size: 0.78rem; color: var(--muted-2); letter-spacing: 0.02em; }
.frame-media { border-radius: 10px; overflow: hidden; aspect-ratio: 16/10; background: #0a0a0b; }
.frame-media video, .frame-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-media.auto { aspect-ratio: auto; }
.frame-media.auto img { height: auto; }

/* ============================================================
   COL·LECCIONS (fotografia, disseny, xarxes, audiovisual)
   ============================================================ */
.coll {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(60px, 9vh, 120px) var(--gutter);
    border-top: 1px solid var(--line-soft);
}
.coll-head { margin-bottom: clamp(30px, 5vh, 54px); }
.coll-head .brand-eyebrow { margin-bottom: 14px; }
.coll-title {
    font-weight: 400; letter-spacing: var(--track-tight); line-height: 1.04;
    font-size: clamp(1.8rem, 3.6vw, 2.9rem); margin: 0 0 14px;
}
.coll-desc { color: var(--muted); max-width: 52ch; font-size: 1.05rem; line-height: 1.6; }

.media-grid { display: grid; gap: 12px; }
.media-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.media-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gitem {
    position: relative; overflow: hidden; border-radius: 12px;
    border: 1px solid var(--line-soft); background: #0a0a0b;
}
.gitem img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1/1; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.gitem:hover img { transform: scale(1.05); }
.gitem .cap {
    position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 14px;
    background: linear-gradient(0deg, rgba(0,0,0,0.6), transparent 55%);
    opacity: 0; transition: opacity 0.35s ease;
}
.gitem:hover .cap { opacity: 1; }
.gitem .cap span { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; }

/* Vídeos verticals (Festa Major) */
.vert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.vcard { display: flex; flex-direction: column; gap: 14px; }
.vcard .frame-media { aspect-ratio: 9/16; }
.vcard .v-info .cat { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.vcard .v-info h3 { font-size: 1.15rem; font-weight: 500; margin: 6px 0 8px; }
.vcard .v-info p { font-size: 0.92rem; color: var(--muted); line-height: 1.5; margin: 0 0 10px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--acc); transition: gap 0.25s ease; }
.link-arrow:hover { gap: 13px; }

/* Xarxes: screenshots + stats */
.xarxes-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: stretch; }
.ig-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 14px; }
.ig-card { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 22px 22px 20px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease; }
.ig-card:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.16); transform: translateY(-3px); }
.ig-top { display: flex; align-items: center; gap: 12px; }
.ig-top img { width: 46px; height: 46px; border-radius: 50%; flex: none; background: #fff; }
.ig-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ig-id b { font-weight: 500; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-id span { font-size: 0.78rem; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-ico { width: 18px; height: 18px; flex: none; color: var(--muted-2); transition: color 0.3s ease; }
.ig-card:hover .ig-ico { color: #fff; }
.ig-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.ig-num .n { display: block; font-size: 2.3rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ig-num .l { display: block; margin-top: 6px; font-size: 0.74rem; color: var(--muted-2); }
.ig-spark { width: 56%; height: 96px; flex: none; overflow: visible; }
.sp-area { opacity: 0; transition: opacity 1s ease 0.5s; }
.drawn .sp-area { opacity: 1; }
.sp-line { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s cubic-bezier(0.4,0,0.2,1) 0.2s; }
.sp-line.blue { stroke: #5b8cff; }
.drawn .sp-line { stroke-dashoffset: 0; }

/* Panell de creixement (dreta) */
.growth { display: flex; flex-direction: column; gap: 12px; }
.g-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px; }
.g-top { display: flex; align-items: center; justify-content: space-between; }
.g-lab { font-size: 0.78rem; color: var(--muted-2); }
.g-up { width: 16px; height: 16px; color: var(--acc); }
.g-hero .n { display: block; margin-top: 8px; font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -0.03em; }
.g-card .n.green { color: var(--acc); }
.g-chart { position: relative; height: 120px; margin-top: 14px; }
.g-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.g-dot { position: absolute; right: -4px; top: calc(10 / 120 * 100% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--acc); opacity: 0; transition: opacity 0.4s ease 1.8s; }
.drawn .g-dot { opacity: 1; animation: gpulse 2s ease-out 2.2s infinite; }
@keyframes gpulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(74,222,128,0); } }
.g-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g-mini { padding: 14px; display: flex; flex-direction: column; }
.g-mini .n { display: block; font-size: 1.5rem; line-height: 1; letter-spacing: -0.02em; margin-top: 12px; }
.g-mini .l { display: block; margin-top: 5px; font-size: 0.72rem; color: var(--muted-2); line-height: 1.3; }
.g-bars { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.g-bars i { flex: 1; border-radius: 3px 3px 0 0; background: rgba(255,255,255,0.16); height: 0; transition: height 0.9s cubic-bezier(0.2,0.7,0.2,1); }
.g-bars i.hi { background: var(--acc); }
.drawn .g-bars i { height: var(--h); }
.g-line { height: 46px; }
.g-line svg { width: 100%; height: 100%; display: block; overflow: visible; }
.g-ring { height: 46px; display: flex; align-items: center; }
.g-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.g-ring .track { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 6; }
.g-ring .ring { fill: none; stroke: #a78bfa; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 150.8; stroke-dashoffset: 150.8; transition: stroke-dashoffset 1.3s cubic-bezier(0.2,0.7,0.2,1) 0.2s; }
.drawn .g-ring .ring { stroke-dashoffset: var(--off, 0); }
.g-tag { font-size: 0.68rem; color: var(--muted-2); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 9px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.cal-d { display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: center; }
.cal-d .dn { font-size: 0.66rem; color: var(--muted-2); }
.chip { display: block; height: 30px; line-height: 30px; border-radius: 8px; font-size: 0.66rem; opacity: 0; transform: scale(0.85); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2,0.7,0.2,1); }
.chip.off { background: transparent; border: 1px dashed rgba(255,255,255,0.1); }
.chip.reel { background: rgba(74,222,128,0.14); color: var(--acc); }
.chip.post { background: rgba(255,255,255,0.1); color: #e8e8e8; }
.chip.story { background: rgba(167,139,250,0.15); color: #b9a4fb; }
.drawn .chip { opacity: 1; transform: none; }
.drawn .cal-d:nth-child(1) .chip { transition-delay: 0.6s; } .drawn .cal-d:nth-child(2) .chip { transition-delay: 0.7s; }
.drawn .cal-d:nth-child(3) .chip { transition-delay: 0.8s; } .drawn .cal-d:nth-child(4) .chip { transition-delay: 0.9s; }
.drawn .cal-d:nth-child(5) .chip { transition-delay: 1.0s; } .drawn .cal-d:nth-child(6) .chip { transition-delay: 1.1s; }
.drawn .cal-d:nth-child(7) .chip { transition-delay: 1.2s; }
@media (max-width: 560px) { .ig-grid { grid-template-columns: 1fr; grid-auto-rows: auto; } .ig-spark { height: 64px; } }

/* ============================================================
   SOBRE MI
   ============================================================ */
#sobre-mi.coll .about-text { font-size: clamp(1.2rem, 2.2vw, 1.8rem); line-height: 1.5; color: var(--text); max-width: 24ch; letter-spacing: -0.01em; }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.about-quote { font-size: 1.05rem; line-height: 1.6; color: var(--muted); border-left: 2px solid var(--acc); padding-left: 20px; }
.about-quote .who { display: block; margin-top: 10px; color: var(--muted-2); font-size: 0.9rem; }
.skills { margin-top: clamp(40px, 6vh, 70px); display: flex; flex-direction: column; gap: 14px; }
.skills .row { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.skills .track { display: inline-flex; white-space: nowrap; animation: brandscroll 42s linear infinite; }
.skills .row.rev .track { animation-direction: reverse; }
.skills .track span { font-size: 1.1rem; color: var(--muted); padding: 0 1.4rem; }
.skills .track span.sep { color: var(--acc); opacity: 0.7; }

/* ============================================================
   TRAJECTÒRIA
   ============================================================ */
.traj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.traj-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px; }
.traj-card .t-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.traj-card .t-tag { font-size: 1.05rem; }
.traj-card .t-num { font-size: 0.78rem; color: var(--acc); letter-spacing: 0.1em; }
.traj-item { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.traj-item:first-of-type { border-top: 0; }
.traj-item .d { font-size: 0.74rem; letter-spacing: 0.08em; color: var(--muted); }
.traj-item .t { font-size: 0.98rem; color: var(--text); margin: 5px 0 3px; line-height: 1.3; }
.traj-item .t .tw-h { visibility: hidden; }
.traj-item .t .tw-v.typing::after { content: ""; display: inline-block; width: 2px; height: 0.95em; margin: 0 -2px 0 2px; vertical-align: -0.12em; background: var(--acc); animation: twblink 0.7s steps(1) infinite; }
@keyframes twblink { 50% { opacity: 0; } }
.traj-item .e { font-size: 0.85rem; color: var(--muted-2); }

/* ============================================================
   CONTACTE + FOOTER
   ============================================================ */
#contacte.coll { text-align: left; }
.contacte-email {
    display: inline-block;
    font-weight: 400; letter-spacing: var(--track-tight); line-height: 1.0;
    font-size: clamp(2rem, 6vw, 5rem); color: var(--text);
    margin: 10px 0 34px; transition: color 0.3s ease;
}
.contacte-email:hover .c.on { color: var(--acc); }
.contacte-links { display: flex; flex-wrap: wrap; gap: 14px; }

.brand-footer {
    max-width: var(--maxw); margin: 0 auto;
    padding: 40px var(--gutter) 60px;
    border-top: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    color: var(--muted-2); font-size: 0.85rem;
}

@media (max-width: 860px) {
    .media-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .vert-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
    .xarxes-wrap, .about-grid { grid-template-columns: 1fr; }
    .traj-grid { grid-template-columns: 1fr; }
    .brand-footer { flex-direction: column; align-items: flex-start; }
}

/* Festa Major: 2026 horitzontal + 2024/2025 verticals */
.festa-top { margin-bottom: 26px; }
.festa-top .v-info { margin-top: 12px; }
.vert-grid.two { grid-template-columns: repeat(2, 1fr); max-width: 760px; }
@media (max-width: 860px) { .vert-grid.two { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; } }

/* ============================================================
   ZONA "QUÈ FAIG" — capacitats amb mockups animats
   (reaprofita .proj / .proj-grid / .proj-title / .pill)
   ============================================================ */
.cap-intro { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px,10vh,130px) var(--gutter) clamp(30px,5vh,56px); }

/* Mockup CMS (desenvolupament web) */
.mock-cms { display: grid; grid-template-columns: 136px 1fr; min-height: 300px; }
.cms-side { border-right: 1px solid var(--line-soft); padding: 14px 10px; }
.cms-side .ci { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 0.82rem; color: var(--muted); }
.cms-side .ci.on { background: var(--surface-2); color: var(--text); }
.cms-side .ci .c { font-size: 0.72rem; color: var(--muted-2); }
.cms-main { padding: 14px 16px; }
.cms-h { display: flex; gap: 10px; margin-bottom: 12px; }
.cms-h .b { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); }
.cms-h .b.g { background: var(--acc-soft); }
.cms-rw { display: flex; align-items: center; gap: 10px; padding: 11px 6px; border-top: 1px solid var(--line-soft); font-size: 0.85rem; }
.cms-rw:first-child { border-top: 0; }
.cms-rw .sq { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.cms-rw .t { color: var(--text); }
.cms-rw .tag { margin-left: auto; font-size: 0.72rem; color: var(--muted-2); }

/* Mockup Dashboard (panells) amb gràfic de barres */
.mock-dash .mock-top { margin-bottom: 14px; }
.dash-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.dash-stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 13px; }
.dash-stat .n { font-size: 1.5rem; line-height: 1; letter-spacing: -0.02em; }
.dash-stat .n.green { color: var(--acc); }
.dash-stat .l { display: block; margin-top: 6px; font-size: 0.72rem; color: var(--muted-2); }
.dash-chart { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; }
.dash-bar { flex: 1; border-radius: 6px 6px 0 0; background: rgba(255,255,255,0.14); height: 0; transition: height 0.9s cubic-bezier(0.2,0.7,0.2,1); }
.dash-bar.hi { background: var(--acc); }
.mock-dash.drawn .dash-bar { height: var(--h); }

/* Mockup Flux (automatització i IA) */
.mock-flow { padding: 6px 4px; }
.flow-step { display: flex; align-items: center; gap: 14px; padding: 14px 14px; position: relative; }
.flow-step .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; color: var(--acc); font-size: 0.9rem; }
.flow-step .tx { display: flex; flex-direction: column; }
.flow-step .tx .t { font-size: 0.92rem; color: var(--text); }
.flow-step .tx .s { font-size: 0.76rem; color: var(--muted-2); margin-top: 2px; }
.flow-step .chk { margin-left: auto; color: var(--acc); font-size: 0.95rem; }
.flow-line { margin-left: 31px; width: 1px; height: 16px; background: var(--line); }

/* Globus (integracions) — portat del treball de serveis, accent verd */
.globe-stage { position: relative; width: 100%; margin: 0; border: 1px solid var(--line); border-radius: 20px; background: #070709; overflow: hidden; }
.globe-canvas { position: absolute; left: 7%; top: 2%; height: 132%; aspect-ratio: 1/1; width: auto; display: block; }
/* El globus es difumina cap a la dreta i cap avall (com el de jorgeml) */
.proj.cap:not(.alt) .proj-media > .globe-stage {
    -webkit-mask-image: linear-gradient(to right, #000 52%, transparent 100%), linear-gradient(to bottom, #000 60%, transparent 100%);
    mask-image: linear-gradient(to right, #000 52%, transparent 100%), linear-gradient(to bottom, #000 60%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
.globe-chip { position: absolute; top: 16px; left: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 9px; font-size: 0.84rem; color: var(--text); background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; backdrop-filter: blur(6px); }
.globe-chip svg { width: 14px; height: 14px; opacity: 0.85; }
.globe-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ============================================================
   "QUÈ FAIG" v2 — títol sticky, marquesina de tags, flux animat
   ============================================================ */
/* Capçalera de capacitat que es queda fixa en fer scroll */
.proj.cap .proj-head {
    position: sticky;
    top: 70px;
    z-index: 49;
    background: var(--bg);
    margin: 0;
    padding: 16px 0 16px;
    border-bottom: 1px solid var(--line-soft);
}
/* Màscara negra a la franja superior: amaga tot el que puja per sobre
   del títol sticky (tags, botó, globus...) perquè quedi net i negre */
body.brand::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
/* Només quan hi ha títols sticky enganxant-se apareix el fons negre */
body.brand.titles-on::before { opacity: 1; }
/* Seccions enganxades: el títol següent puja, toca l'anterior i l'empeny */
.proj.cap { padding-top: 0; padding-bottom: 0; border-top: 0; }
.proj.cap .proj-grid { padding-top: clamp(24px, 4vh, 44px); padding-bottom: clamp(40px, 7vh, 90px); }

/* Marquesina petita de tags + botó */
.tag-marquee {
    overflow: hidden;
    max-width: 440px;
    margin-bottom: 28px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 85%, transparent);
}
.tag-marquee .tt { display: inline-flex; gap: 10px; white-space: nowrap; animation: brandscroll 24s linear infinite; }
.tag-marquee .tp {
    font-size: 0.8rem; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 999px; padding: 7px 14px;
}
.tag-marquee:hover .tt { animation-play-state: paused; }

/* ============================================================
   MOCKUP AUTOMATITZACIÓ v2 — xat + pipeline amb camins animats
   ============================================================ */
.mock-auto .mock-top { margin-bottom: 14px; }
.auto-chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.bub { max-width: 82%; padding: 9px 13px; border-radius: 13px; font-size: 0.82rem; line-height: 1.45; }
.bub.me { align-self: flex-end; background: var(--surface-2); color: var(--text); border-bottom-right-radius: 4px; }
.bub.ai { align-self: flex-start; background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.25); color: var(--text); border-bottom-left-radius: 4px; }

.pipe { display: flex; align-items: center; gap: 6px; }
.pnode {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 9px 12px; font-size: 0.78rem; color: var(--text);
    white-space: nowrap; flex: none;
}
.pnode .ps { display: block; font-size: 0.68rem; color: var(--muted-2); margin-top: 2px; }
.pnode.ai { border-color: rgba(74,222,128,0.4); }
.pnode.ai .pd { color: var(--acc); }
.pconn { flex: 1; min-width: 20px; height: 14px; }
.flow-path { stroke: var(--acc); stroke-width: 2; fill: none; stroke-dasharray: 4 6; opacity: 0.8; animation: dashflow 0.9s linear infinite; }
@keyframes dashflow { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .flow-path { animation: none; } }

/* Globus arrossegable */
.globe-stage { cursor: grab; touch-action: pan-y; }
.globe-stage.dragging { cursor: grabbing; }

/* Fix: botons blancs (enllaços) necessiten text negre — .brand a els pisava */
.brand a.brand-cta,
.brand a.proj-cta:not(.privat) { color: #000; }

/* Degradat des de la cantonada superior esquerra: negre màxim a la cantonada
   i es dilueix cap al centre (perquè el nom es llegeixi sempre) */
body.brand::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 620px;
    max-width: 66vw;
    height: 46vh;
    max-height: 440px;
    /* Negre a dalt que baixa fins a transparent, només a la cantonada esquerra
       (es dilueix cap a la dreta amb una màscara, sense línia) */
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.92) 0%,
        rgba(0,0,0,0.72) 20%,
        rgba(0,0,0,0.4) 48%,
        rgba(0,0,0,0.12) 75%,
        rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to right, #000 42%, transparent 100%);
    mask-image: linear-gradient(to right, #000 42%, transparent 100%);
    z-index: 50;
    pointer-events: none;
}

/* ============================================================
   MOCKUP SEO / ANALYTICS (capacitat 05)
   ============================================================ */
.mock-seo .mock-top { margin-bottom: 16px; }
.seo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.seo-stat .l { display: block; font-size: 0.72rem; color: var(--muted-2); margin-bottom: 6px; }
.seo-stat .n { font-size: 1.4rem; letter-spacing: -0.02em; line-height: 1; }
.seo-chart { position: relative; width: 100%; height: 130px; }
.seo-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.seo-area { opacity: 0; transition: opacity 1s ease 0.5s; }
.mock-seo.drawn .seo-area { opacity: 1; }
.seo-line { fill: none; stroke-width: 2; stroke-dasharray: 760; stroke-dashoffset: 760; transition: stroke-dashoffset 1.7s cubic-bezier(0.4,0,0.2,1); }
.mock-seo.drawn .seo-line { stroke-dashoffset: 0; }
.seo-line.l1 { stroke: #a78bfa; }
.seo-line.l2 { stroke: #5b8cff; }

/* ============================================================
   MOCKUP MANTENIMENT / LIGHTHOUSE (capacitat 06)
   ============================================================ */
.mock-maint .mock-top { margin-bottom: 16px; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.gauge { text-align: center; }
.gwrap { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.gwrap svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.gwrap .track { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 5; }
.gwrap .ring { fill: none; stroke: var(--acc); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; transition: stroke-dashoffset 1.2s cubic-bezier(0.2,0.7,0.2,1); }
.mock-maint.drawn .gwrap .ring { stroke-dashoffset: var(--off, 0); }
.gwrap .gn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--text); }
.gauge .gl { display: block; margin-top: 8px; font-size: 0.7rem; color: var(--muted-2); }

.cwv { display: flex; flex-direction: column; gap: 12px; }
.cwv-row .top { display: flex; align-items: baseline; justify-content: space-between; font-size: 0.82rem; }
.cwv-row .top .k { color: var(--text); }
.cwv-row .top .k span { color: var(--muted-2); font-size: 0.74rem; margin-left: 6px; }
.cwv-row .top .v { color: var(--acc); font-weight: 500; }
.cwv-bar { position: relative; height: 5px; border-radius: 3px; margin-top: 7px; overflow: hidden; background: linear-gradient(90deg, #4ade80 0 45%, #d6a43b 45% 72%, #e5604d 72% 100%); }
.cwv-bar::after { content: ""; position: absolute; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: #fff; left: var(--p, 20%); transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(0,0,0,0.5); }

/* Amaga la barra de scroll (Lenis ja gestiona el scroll suau) */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { width: 0; height: 0; display: none; }
body.brand { scrollbar-width: none; -ms-overflow-style: none; }
body.brand::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ============================================================
   MOCKUPS "QUÈ FAIG": vores difuminades + sagnat cap a fora
   (no caixes dures; sensació que són més grans del que es veu)
   ============================================================ */
.proj.cap .proj-grid { overflow: visible; }
.proj.cap .proj-media > .mock,
.proj.cap .proj-media > .frame,
.proj.cap .proj-media > .globe-stage {
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
/* Mockup a la dreta: es difumina cap a la dreta (on surt) i cap avall */
.proj.cap:not(.alt) .proj-media > .mock,
.proj.cap:not(.alt) .proj-media > .frame,
.proj.cap:not(.alt) .proj-media > .globe-stage {
    -webkit-mask-image: linear-gradient(to right, #000 66%, transparent 100%), linear-gradient(to bottom, #000 72%, transparent 100%);
    mask-image: linear-gradient(to right, #000 66%, transparent 100%), linear-gradient(to bottom, #000 72%, transparent 100%);
}
/* Mockup a l'esquerra (.alt): es difumina cap a l'esquerra i cap avall */
.proj.cap.alt .proj-media > .mock,
.proj.cap.alt .proj-media > .frame,
.proj.cap.alt .proj-media > .globe-stage {
    -webkit-mask-image: linear-gradient(to left, #000 60%, transparent 100%), linear-gradient(to bottom, #000 84%, transparent 100%);
    mask-image: linear-gradient(to left, #000 60%, transparent 100%), linear-gradient(to bottom, #000 84%, transparent 100%);
}
/* Sagnat cap a fora segons el costat on surt el mockup */
.proj.cap:not(.alt) .proj-media { margin-right: calc(-1 * var(--gutter)); }
.proj.cap.alt .proj-media { margin-left: calc(-1 * var(--gutter)); }
@media (max-width: 860px) {
    .proj.cap:not(.alt) .proj-media,
    .proj.cap.alt .proj-media { margin-left: 0; margin-right: 0; }
}

/* ============================================================
   FRASE CENTRADA AMB OMPLERTA AL SCROLL (gris -> blanc, vora blava)
   ============================================================ */
.scroll-intro {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: clamp(40px, 7vh, 90px) var(--gutter);
}
.scroll-intro .brand-eyebrow { color: var(--muted-2); margin-bottom: 18px; }
.fill-head {
    font-weight: 400;
    letter-spacing: var(--track-tight);
    line-height: 1.1;
    font-size: clamp(2.1rem, 5vw, 4rem);
    margin: 0;
}
.fill-sub {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    line-height: 1.5;
    max-width: 42ch;
    margin: 22px auto 0;
}
[data-fill] .wd { display: inline-block; }
[data-fill] .c {
    color: #4a4a4e;
    transition: color 0.4s ease;
}
[data-fill] .c.blue { color: #5b8cff; }
[data-fill] .c.on { color: var(--text); }
@media (prefers-reduced-motion: reduce) {
    [data-fill] .c { color: var(--text) !important; }
}

/* ============================================================
   MOCKUPS "QUÈ FAIG" TOTS A LA MATEIXA ALÇADA (ordre i senzillesa)
   El que sobra per sota queda difuminat.
   ============================================================ */
.proj.cap .proj-media > .mock,
.proj.cap .proj-media > .frame,
.proj.cap .proj-media > .globe-stage {
    height: 390px;
    overflow: hidden;
}

/* Mockups de "Què faig": entren lliscant des de la dreta en baixar */
.anim-ready .proj.cap .proj-media[data-reveal]:not(.in) { transform: translateX(54px); }

/* Intros de secció/col·lecció centrades (com la de Projectes) */
.coll-head, .cap-intro { text-align: center; }
.coll-head { max-width: 900px; margin-left: auto; margin-right: auto; }
.coll-head .coll-desc, .cap-intro .coll-desc { margin-left: auto; margin-right: auto; }

/* ============================================================
   MOCKUP SOCIAL v2 — mòbil amb Reel + targetes de creixement
   ============================================================ */
.mock-social .mock-top { margin-bottom: 16px; }
.mock-social .social-row { display: flex; gap: 22px; align-items: center; }
.phone {
    width: 168px; flex: none; position: relative;
    border-radius: 26px; border: 1px solid rgba(255,255,255,0.14);
    background: #0e0e10; padding: 6px;
    box-shadow: 0 22px 50px rgba(0,0,0,0.55);
}
.phone-notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); z-index: 3; }
.phone-screen { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 9/16; background: #000; }
.phone-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-ov { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.65), transparent 45%); }
.reel-actions { position: absolute; right: 9px; bottom: 54px; display: flex; flex-direction: column; gap: 15px; align-items: center; color: #fff; }
.reel-actions .ra { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.6rem; }
.reel-actions svg { width: 19px; height: 19px; }
.reel-cap { position: absolute; left: 11px; right: 42px; bottom: 12px; color: #fff; font-size: 0.66rem; line-height: 1.35; }
.reel-cap b { font-weight: 600; }
.social-side { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.s-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 15px 16px; }
.s-card .n { font-size: 1.55rem; line-height: 1; letter-spacing: -0.02em; display: block; }
.s-card.green .n { color: var(--acc); }
.s-card .l { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--muted-2); }

/* ============================================================
   MOCKUP AUTOMATITZACIÓ v3 — canvas amb graf de nodes i camins animats
   ============================================================ */
.mock-auto .mock-top { margin-bottom: 14px; }
.auto-canvas {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 14px;
    background-color: var(--surface);
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid var(--line-soft);
    overflow: hidden;
}
.auto-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.auto-wires .flow-path {
    fill: none; stroke: var(--acc); stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 4 6; opacity: 0.85;
    animation: dashflow 0.9s linear infinite;
}
.anode {
    position: absolute;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 10px 13px;
    font-size: 0.82rem; color: var(--text);
    white-space: nowrap;
}
.anode span { display: block; font-size: 0.68rem; color: var(--muted-2); margin-top: 3px; }
.anode.a-ai { border-color: rgba(74,222,128,0.45); box-shadow: 0 0 0 4px rgba(74,222,128,0.07); }
.a-pills { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 9px; }
.a-pills i { font-style: normal; font-size: 0.64rem; color: var(--acc); background: var(--acc-soft); border-radius: 7px; padding: 4px 8px; }
.a-msg { left: 2%; top: 38%; }
.a-ai { left: 36%; top: 26%; }
.a-resp { left: 76%; top: 8%; }
.a-crm { left: 76%; top: 62%; }
@media (prefers-reduced-motion: reduce) { .auto-wires .flow-path { animation: none; } }

/* ============================================================
   CURSOR PERSONALITZAT
   ============================================================ */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity 0.25s ease; will-change: transform; }
.cursor.on { opacity: 1; }
.cursor-in {
    display: block; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
    background: #fff; box-shadow: inset 0 0 0 0 #fff;
    transition: width 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.28s cubic-bezier(0.2, 0.7, 0.2, 1),
        margin 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.28s ease, box-shadow 0.28s ease, transform 0.2s ease;
}
.cursor.is-link .cursor-in {
    width: 64px; height: 64px; margin: -32px 0 0 -32px;
    background: rgba(255, 255, 255, 0.3); box-shadow: inset 0 0 0 1.5px #fff;
}
.cursor.down .cursor-in { transform: scale(0.88); }

/* ============================================================
   MÒBIL — mateix flow que a escriptori
   ============================================================ */
.brand-burger, .mobile-menu { display: none; }

@media (max-width: 860px) {
    /* Les columnes no poden créixer per sobre de l'amplada de pantalla */
    .proj-grid, .proj.alt .proj-grid { grid-template-columns: minmax(0, 1fr); }
    .xarxes-wrap, .about-grid, .traj-grid { grid-template-columns: minmax(0, 1fr); }
    .proj-info, .proj-media, .xarxes-wrap > *, .about-grid > *, .traj-grid > * { min-width: 0; }
    .tag-marquee { max-width: 100%; }
    .proj-desc { max-width: none; }
}

@media (max-width: 760px) {
    :root { --gutter: 20px; }

    /* Navbar: barra de vidre fixa amb logo + botó de menú */
    .brand-nav {
        top: 0; width: 100%; max-width: none; transform: none; left: 0;
        padding: 12px var(--gutter);
        background: rgba(0, 0, 0, 0.62);
        -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
        border-bottom: 1px solid var(--line-soft);
    }
    .brand-cta { display: none; }
    .brand-burger {
        display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px;
        width: 44px; height: 40px; margin-right: -8px; padding: 0 8px;
        background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    .brand-burger i { display: block; height: 1.5px; background: #fff; border-radius: 2px; transition: transform 0.35s cubic-bezier(0.2,0.7,0.2,1), width 0.3s ease; }
    .brand-burger i:first-child { width: 24px; }
    .brand-burger i:last-child { width: 16px; }
    body.menu-open .brand-burger i:first-child { width: 24px; transform: translateY(3.75px) rotate(45deg); }
    body.menu-open .brand-burger i:last-child { width: 24px; transform: translateY(-3.75px) rotate(-45deg); }

    /* Menú a pantalla completa */
    .mobile-menu {
        display: flex; flex-direction: column; justify-content: space-between;
        position: fixed; inset: 0; z-index: 90; padding: 96px var(--gutter) 34px;
        background: rgba(0, 0, 0, 0.94);
        -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
        opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    }
    body.menu-open .mobile-menu { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
    body.menu-open { overflow: hidden; }
    .mm-links { display: flex; flex-direction: column; }
    .mm-links a {
        display: flex; align-items: baseline; gap: 16px; padding: 14px 0;
        font-size: clamp(2.2rem, 11vw, 3rem); letter-spacing: -0.04em; line-height: 1.05;
        border-bottom: 1px solid var(--line-soft);
        opacity: 0; transform: translateY(24px);
        transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2,0.7,0.2,1);
    }
    .mm-links a span { font-size: 0.78rem; letter-spacing: 0.12em; color: var(--acc); }
    body.menu-open .mm-links a { opacity: 1; transform: none; }
    body.menu-open .mm-links a:nth-child(1) { transition-delay: 0.08s; }
    body.menu-open .mm-links a:nth-child(2) { transition-delay: 0.14s; }
    body.menu-open .mm-links a:nth-child(3) { transition-delay: 0.20s; }
    body.menu-open .mm-links a:nth-child(4) { transition-delay: 0.26s; }
    body.menu-open .mm-links a:nth-child(5) { transition-delay: 0.32s; }
    .mm-foot { color: var(--muted-2); font-size: 0.9rem; }

    /* Titulars sticky i màscara ajustats a l'alçada de la barra mòbil */
    .proj.cap .proj-head { top: 58px; }
    body.brand::before { height: 58px; }

    /* Hero amb més presència */
    .brand-display { font-size: clamp(2.7rem, 13.2vw, 3.6rem); }
    .brand-eyebrow { font-size: 0.7rem; letter-spacing: 0.13em; }
}

.proj.cap { overflow-x: clip; }
@media (max-width: 860px) {
    .globe-canvas { left: -6%; top: 50%; width: 112%; height: auto; transform: translateY(-52%); }
    .anim-ready .proj.cap .proj-media[data-reveal]:not(.in) { transform: translateX(28px); }
}

@media (max-width: 860px) {
    /* El difuminat de la vora dreta no ha de menjar-se contingut en pantalles estretes */
    .proj.cap:not(.alt) .proj-media > .mock,
    .proj.cap:not(.alt) .proj-media > .frame,
    .proj.cap:not(.alt) .proj-media > .globe-stage {
        -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%), linear-gradient(to bottom, #000 72%, transparent 100%);
        mask-image: linear-gradient(to right, #000 90%, transparent 100%), linear-gradient(to bottom, #000 72%, transparent 100%);
    }
    .proj.cap.alt .proj-media > .mock,
    .proj.cap.alt .proj-media > .frame,
    .proj.cap.alt .proj-media > .globe-stage {
        -webkit-mask-image: linear-gradient(to left, #000 90%, transparent 100%), linear-gradient(to bottom, #000 84%, transparent 100%);
        mask-image: linear-gradient(to left, #000 90%, transparent 100%), linear-gradient(to bottom, #000 84%, transparent 100%);
    }
    .mock-auto .anode { zoom: 0.8; }
    .phone { width: 128px; }
    .mock-social .social-row { gap: 14px; }
    .s-card { padding: 11px 12px; }
    .s-card .n { font-size: 1.3rem; }
    .mock { padding: 14px; }
}

/* Escala tipogràfica mòbil: més compacta, perquè càpiga tot sense retallar */
@media (max-width: 760px) {
    .brand-display { font-size: clamp(2.1rem, 10.4vw, 2.7rem); line-height: 1.02; }
    .brand-sub { font-size: 0.95rem; line-height: 1.55; margin-top: 18px; }
    .brand-eyebrow { font-size: 0.66rem; margin-bottom: 18px; }
    .proj-cat { font-size: 1.05rem; }
    .proj-count { font-size: 0.72rem; }
    .proj-title { font-size: clamp(1.6rem, 7.6vw, 2rem); margin-bottom: 14px; }
    .proj-desc { font-size: 0.93rem; line-height: 1.55; margin-bottom: 20px; }
    .proj-cta { font-size: 0.88rem; padding: 10px 18px; }
    .coll-title { font-size: clamp(1.6rem, 8vw, 2.1rem); }
    .coll-desc { font-size: 0.93rem; line-height: 1.55; }
    .fill-head { font-size: clamp(1.8rem, 9vw, 2.3rem); }
    .fill-sub { font-size: 0.98rem; }
    #sobre-mi.coll .about-text { font-size: 1.15rem; }
    .about-quote { font-size: 0.95rem; }
    .contacte-email { font-size: clamp(1.4rem, 7.2vw, 1.9rem); }
    .traj-item .t { font-size: 0.92rem; }
    .mm-links a { font-size: clamp(1.9rem, 9.5vw, 2.5rem); padding: 12px 0; }
}

/* Mòbil: la barra de vidre ja cobreix el nom, no cal el degradat de cantonada */
@media (max-width: 760px) { body.brand::after { display: none; } }

/* ============================================================
   MÒBIL — ritme vertical regular (mateixos espais a totes les seccions)
   ============================================================ */
@media (max-width: 860px) {
    /* Dins de cada bloc: text -> mitjà = 28px, sense marges "sobrants" a l'últim element */
    .proj-grid { gap: 28px; }
    .proj-info > :last-child { margin-bottom: 0; }
    .proj-info .tag-marquee { margin-bottom: 0; }

    /* Projectes (no "què faig"): mateix padding a dalt i a baix */
    .proj:not(.cap) { padding-top: 60px; padding-bottom: 60px; }
    .proj-head { margin-bottom: 26px; }

    /* "Què faig": capçalera sticky -> contingut -> mockup compacte */
    .proj.cap .proj-grid { padding-top: 22px; padding-bottom: 44px; }
    .proj.cap .proj-media > .mock,
    .proj.cap .proj-media > .frame,
    .proj.cap .proj-media > .globe-stage { height: 320px; }

    /* Intros i col·leccions */
    .cap-intro { padding-top: 64px; padding-bottom: 36px; }
    .scroll-intro { padding-top: 24px; padding-bottom: 24px; }
    .coll { padding-top: 60px; padding-bottom: 60px; }
    .coll-head { margin-bottom: 30px; }
}

/* ============================================================
   MÒBIL — Festa Major: els 3 vídeos en línia (es veuen grans en tocar-los)
   ============================================================ */
@media (max-width: 860px) {
    .vert-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: none; margin: 0; }
    .vcard .frame { padding: 5px; border-radius: 12px; box-shadow: none; cursor: pointer; }
    .vcard .frame-media { border-radius: 8px; }
    .vcard .v-info { margin-top: 10px; }
    .vcard .v-info .cat { display: none; }
    .vcard .v-info h3 { font-size: 0.8rem; line-height: 1.25; margin: 0 0 6px; }
    .vcard .v-info .link-arrow { font-size: 0.7rem; gap: 4px; line-height: 1.3; }
}

/* Visor de vídeo (mòbil) */
.vbox {
    position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.vbox.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.vbox video { max-width: 92vw; max-height: 82vh; border-radius: 14px; background: #000; transform: scale(0.94); transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.vbox.open video { transform: none; }
.vbox-x {
    position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer;
}

/* Foto personal a "Sobre mi" */
.about-photo {
    display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%;
    border-radius: 22px; border: 1px solid var(--line); background: #111;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}
@media (min-width: 861px) {
    #sobre-mi .about-grid { grid-template-columns: 176px minmax(0, 1fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
    #sobre-mi.coll .about-text { font-size: clamp(1.5rem, 2.5vw, 2.2rem); max-width: none; line-height: 1.2; margin: 0 0 clamp(20px, 3vh, 30px); letter-spacing: -0.03em; text-wrap: balance; }
    #sobre-mi .about-quote { max-width: 60ch; }
    #sobre-mi .about-body .brand-eyebrow { margin-bottom: 16px; }
}

/* Sobre mi — mòbil: retrat a l'esquerra, títol a la dreta, cita a sota (mateixa lògica que a escriptori) */
@media (max-width: 860px) {
    #sobre-mi .about-grid {
        grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto auto;
        column-gap: 18px; row-gap: 0; align-items: center;
    }
    #sobre-mi .about-body { display: contents; }
    #sobre-mi .about-photo { grid-column: 1; grid-row: 1 / 3; width: 96px; border-radius: 16px; margin: 0; box-shadow: none; }
    #sobre-mi .about-body .brand-eyebrow { grid-column: 2; grid-row: 1; align-self: end; margin: 0 0 8px; }
    #sobre-mi.coll .about-text { grid-column: 2; grid-row: 2; align-self: start; font-size: 1.1rem; line-height: 1.25; max-width: none; margin: 0; letter-spacing: -0.02em; }
    #sobre-mi .about-quote { grid-column: 1 / -1; grid-row: 3; margin-top: 26px; }
}

/* Marquesines més compactes al mòbil (hi caben més opcions a la pantalla) */
@media (max-width: 760px) {
    .brand-marquee { padding: 18px 0; }
    .brand-marquee .track span { font-size: 0.74rem; padding: 0 0.85rem; letter-spacing: 0.05em; }
    .skills { gap: 10px; }
    .skills .track span { font-size: 0.82rem; padding: 0 0.8rem; }
}

/* Mòbil: "Veure projecte" com a enllaç discret (no un botó que ocupi espai) */
@media (max-width: 760px) {
    body.brand a.proj-cta:not(.privat) {
        background: none; color: var(--acc); padding: 0; border-radius: 0;
        font-size: 0.9rem; font-weight: 500; gap: 8px;
    }
    .proj-cta.privat { font-size: 0.8rem; padding: 7px 13px; }
}

/* Contacte: etiqueta a sobre del correu (no en línia) i peu de pàgina ordenat al mòbil */
#contacte .brand-eyebrow { display: block; }
@media (max-width: 760px) {
    #contacte .contacte-email { margin: 4px 0 26px; }
    .contacte-links { gap: 10px; }
    .contacte-links .pill { font-size: 0.82rem; padding: 7px 14px; }
    .brand-footer { padding: 26px var(--gutter) 40px; gap: 6px; font-size: 0.78rem; }
}

/* ============================================================
   SELECTOR D'IDIOMA (CA / ES / EN)
   ============================================================ */
.nav-right { display: flex; align-items: center; gap: 14px; }
.lang-sw { display: flex; align-items: center; gap: 0; font-size: 0.74rem; letter-spacing: 0.1em; }
.lang-sw a { padding: 6px 7px; color: var(--muted-2); transition: color 0.25s ease; }
.lang-sw a:hover { color: var(--text); }
.lang-sw a.on { color: var(--text); }
.lang-sw a + a::before { content: "/"; color: rgba(255, 255, 255, 0.18); margin-right: 14px; margin-left: -7px; }
@media (max-width: 760px) {
    .nav-right { display: none; }
    .mm-foot { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
    .lang-sw-m { font-size: 0.9rem; }
    .lang-sw-m a { padding: 8px 10px 8px 0; }
    .lang-sw-m a + a::before { margin-left: -10px; margin-right: 12px; }
}

/* El nom del compte del Reel no es pot sortir del mòbil */
.reel-cap { overflow-wrap: anywhere; }

/* Text només per a lectors de pantalla */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
