/* Tipografies allotjades al mateix servidor (sense peticions a Google Fonts).
   Fraunces i Plus Jakarta Sans, llicència SIL Open Font License 1.1. Subconjunts latin i latin-ext. */
/* Fraunces · latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-ext-843e59.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Fraunces · latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-8f90dc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fraunces · latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-ext-843e59.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Fraunces · latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-8f90dc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Plus Jakarta Sans · latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-ext-5d8873.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Plus Jakarta Sans · latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-d4d84d.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Plus Jakarta Sans · latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-ext-5d8873.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Plus Jakarta Sans · latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-d4d84d.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Plus Jakarta Sans · latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-ext-5d8873.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Plus Jakarta Sans · latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-d4d84d.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Plus Jakarta Sans · latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-ext-5d8873.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Plus Jakarta Sans · latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../assets/fonts/plus-jakarta-sans-latin-d4d84d.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================
   Soportic · Full d'estils
   Colors corporatius del logotip:
     blau  #009FE3 (bastó d'Asclepi i «Sopor») · gris #616161 (codi i «TIC») · gris clar #EFEFEF
   El blau corporatiu es fa servir en logotips, línies, icones i fons. Per a textos i botons amb
   text blanc s'usen blaus més foscos derivats (#006D9E, #0078AD), que compleixen el contrast AA.
   ========================================================== */

:root {
  --blue: #009fe3;            /* blau corporatiu */
  --grey: #616161;            /* gris corporatiu */
  --grey-light: #efefef;      /* gris clar corporatiu */
  --ink: #26292c;
  --ink-soft: #5b6066;
  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-alt: var(--grey-light);
  --line: #e0e3e6;
  --brand: var(--grey);       /* botons foscos (Panell de client, filtres, idioma) */
  --brand-2: #4c4c4c;
  --accent: var(--blue);
  --accent-ink: #006d9e;      /* text en blau sobre fons clar */
  --accent-btn: #0078ad;      /* fons de botó amb text blanc */
  --accent-btn-hover: #00669a;
  --dark: #303336;            /* seccions fosques (contacte, targeta del hero) */
  --dark-2: #45494d;
  --on-dark: #eceef0;
  --on-dark-soft: #b9c0c6;
  --danger: #c62828;
  --tool: var(--grey);         /* accent dels projectes d'eines (gris del codi) */
  --shadow: 0 1px 2px rgba(38, 41, 44, .06), 0 10px 30px -12px rgba(38, 41, 44, .18);
  --radius: 18px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eceef0;
    --ink-soft: #a7adb3;
    --bg: #17191b;
    --surface: #202326;
    --surface-alt: #1b1e20;
    --line: #33373b;
    --brand: #e0e0e0;
    --brand-2: #ffffff;
    --accent: #22aef0;
    --accent-ink: #5cc4f2;
    --dark: #26292c;
    --dark-2: #3a3e42;
    --danger: #ff6b6b;
    --tool: #a3a8ad;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1, h2 { font-family: var(--display); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.sr-only, .hp {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Botons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 .95rem/1 var(--font);
  padding: .95em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-btn); color: #fff; box-shadow: 0 8px 22px -10px var(--blue); }
.btn-primary:hover { background: var(--accent-btn-hover); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-light { background: #fff; color: #26292c; }
.btn-block { width: 100%; }
.btn-panel { background: var(--brand); color: var(--bg); padding: .75em 1.1em; font-size: .88rem; }
.btn-panel svg { width: 18px; height: 18px; }
.btn-panel:hover { background: var(--brand-2); }

/* ---------- Capçalera ---------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; transition: border-color .2s; }
/* Fons translúcid de la barra en una capa a part: un backdrop-filter a la mateixa capçalera
   faria que el menú lateral del mòbil (position: fixed) quedés tancat dins de la barra */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  transition: opacity .2s;
}
/* Portada: a dalt de tot la barra és transparent i el degradat blau de la capçalera continua per sota.
   En desplaçar-se (.scrolled, des de js/main.js) recupera el fons translúcid. */
body:has(.hero) .site-header:not(.scrolled)::before { opacity: 0; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px; text-decoration: none; flex: none; }
.brand-logo { display: block; height: 34px; width: auto; }
/* «by Octavi Rodríguez» sota el logotip, amb la tipografia dels títols, alineat amb la «S» de Soportic */
.brand-by {
  display: flex; align-items: center; gap: .45em; white-space: nowrap; padding-left: 31%;
  font: 600 13px/1 var(--display); color: var(--ink); letter-spacing: 0;
}
.brand-by i { font-weight: 500; color: var(--ink-soft); }
/* Mòbil: logotip complet, una mica més petit */
@media (max-width: 600px) {
  .site-header .brand-logo { height: 28px; }
  .site-header .brand-by { font-size: 11px; }
}
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav a {
  --pad-x: .85em;
  position: relative; display: inline-block; padding: .5em var(--pad-x); border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); }
/* Línia de subratllat: s'obre des del centre en passar-hi el ratolí i es torna a tancar en sortir */
.nav a::after {
  content: ""; position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: .28em;
  height: 2px; border-radius: 2px; background: var(--blue);
  transform: scaleX(0); transform-origin: center; transition: transform .28s ease;
}
/* Només amb ratolí: a les pantalles tàctils el :hover es queda «enganxat» després de tocar */
@media (hover: hover) { .nav a:hover::after { transform: scaleX(1); } }
.nav a:focus-visible::after { transform: scaleX(1); }
/* Secció on som: pastilla gris clar i text en blau corporatiu */
.nav a[aria-current] { background: var(--grey-light); color: var(--blue); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav a[aria-current] { background: rgba(255, 255, 255, .09); color: var(--accent); }
}
.nav-toggle, .nav-panel, .nav-lang { display: none; }

/* Selector d'idioma */
.lang { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.lang a {
  font: 700 .74rem/1 var(--font); letter-spacing: .06em; text-decoration: none; color: var(--ink-soft);
  padding: .55em .75em; border-radius: 999px; transition: background .2s, color .2s;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--brand); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 88px; position: relative; overflow: hidden; }
/* La capçalera de la portada comença a dalt de tot, per sota de la barra (73 px = 72 de la barra + 1 de vora) */
.site-header + main > .hero:first-child { margin-top: -73px; padding-top: calc(72px + 73px); }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--surface); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 0 var(--blue); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); margin-top: 22px; }
.hero h1 em { font-style: italic; color: var(--accent-ink); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 34px; }
.roles { display: flex; flex-wrap: wrap; gap: 22px; list-style: none; padding: 0; margin: 0; font-weight: 600; font-size: .95rem; }
.roles li { display: inline-flex; align-items: center; gap: 8px; }
/* Icones dels perfils (Tabler Icons, MIT): fonendoscopi, codi i cor amb encaixada de mans */
.role-icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.strip-title .role-icon { width: 26px; height: 26px; }
.r1 { color: var(--blue); }        /* Infermer: blau del bastó d'Asclepi */
.r2 { color: var(--tool); }        /* Desenvolupador: gris del codi */
.r3 { color: var(--accent-ink); }  /* Assessor: blau fosc */

.hero-visual { position: relative; }
.ecg-card {
  background: var(--dark); color: var(--on-dark); border-radius: 26px; padding: 26px;
  box-shadow: 0 30px 60px -25px rgba(38, 41, 44, .55); transform: rotate(-1.5deg);
}
.ecg-head { display: flex; align-items: center; gap: 10px; font-size: .8rem; }
.chip { border: 1px solid rgba(255,255,255,.25); padding: 5px 12px; border-radius: 999px; }
.chip-solid { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.arrow { opacity: .6; }
.ecg { width: 100%; height: 110px; margin: 18px 0; }
.ecg path {
  fill: none; stroke: #33b6ec; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 2.6s ease-out forwards, glow 2.6s 2.6s ease-in-out infinite alternate;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { to { filter: drop-shadow(0 0 6px #33b6ec); } }
.code-block {
  font: 500 .85rem/1.7 ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(0,0,0,.22); border-radius: 14px; padding: 16px 18px;
}
.c-k { color: #7fcdf1; } .c-s { color: #e0e0e0; } .c-b { color: #33b6ec; }
.float-badge {
  position: absolute; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 16px; font-size: .85rem; box-shadow: var(--shadow); font-weight: 500;
}
.float-badge strong { color: var(--accent-ink); font-size: 1.1rem; }
.fb1 { left: -28px; bottom: -22px; }
.fb2 { right: -14px; top: -18px; }

/* ---------- Franja de perfils ---------- */
.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.strip-grid article { padding: 36px 32px; }
.strip-grid article + article { border-left: 1px solid var(--line); }
.strip-title { font: 700 1.1rem/1.2 var(--font); display: flex; align-items: center; gap: 10px; letter-spacing: 0; }
.strip-grid p { color: var(--ink-soft); margin: 0; font-size: .97rem; }

/* ---------- Seccions ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--surface-alt); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: .8em; }
.section-sub { color: var(--ink-soft); font-size: 1.08rem; }

/* Serveis */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.service p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.service-ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink);
}
.service-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Projectes */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: 600 .88rem/1 var(--font); padding: .7em 1.1em; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); transition: all .2s;
}
.filter:hover { color: var(--ink); }
.filter.is-active { background: var(--brand); color: var(--bg); border-color: var(--brand); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project {
  --p: var(--accent);
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s, opacity .3s;
}
.project::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--p); }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--p) 45%, var(--line)); }
.project.is-hidden { display: none; }
.project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.project-ico {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex: none;
  background: color-mix(in srgb, var(--p) 15%, transparent); color: var(--p);
}
.project-logo {
  width: 48px; height: 48px; border-radius: 12px; flex: none; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line), 0 6px 14px -8px rgba(38, 41, 44, .35);
}
.project-type { font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.project h3 { font-size: 1.35rem; }
.project p { color: var(--ink-soft); font-size: .96rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 4px 0 0; }
.tags li { font-size: .76rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--ink-soft); }
.project-link { margin-top: 18px; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--accent-ink); }
.project-link:hover { text-decoration: underline; }
/* Escriptori: graella de 6 columnes. Les dues destacades (Torns i SysRevAI) ocupen la meitat cadascuna
   i la resta, un terç. Si l'última fila queda incompleta, l'última targeta n'omple el buit. */
@media (min-width: 1025px) {
  .projects { grid-template-columns: repeat(6, 1fr); }
  .projects > .project { grid-column: span 2; }
  .projects > .project-featured { grid-column: span 3; }
  .projects > .project:last-child:nth-child(3n + 1) { grid-column: span 4; }
  .projects > .project:last-child:nth-child(3n) { grid-column: 1 / -1; }
}
/* Tauleta: dues columnes; si n'hi ha un nombre senar, l'última ocupa tota la fila */
@media (min-width: 601px) and (max-width: 1024px) {
  .projects > .project:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.project-featured { background: linear-gradient(135deg, var(--surface) 55%, color-mix(in srgb, var(--accent) 12%, var(--surface))); }

/* Mètode */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; }
.steps li { position: relative; padding-top: 28px; border-top: 2px solid var(--line); }
.steps li::before { content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 2px; background: var(--accent); }
.step-n { font: 600 2.2rem/1 var(--display); color: var(--accent-ink); display: block; margin-bottom: 14px; }
.steps p { color: var(--ink-soft); font-size: .95rem; }

/* Sobre mi */
.about { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: center; }
/* Foto amb un marc desplaçat en el blau corporatiu */
.about-photo { position: relative; margin: 0 14px 14px 0; aspect-ratio: 4/5; }
.about-photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; border-radius: 28px;
  border: 2px solid var(--blue); opacity: .55;
}
.about-photo img {
  position: relative; display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: 28px; box-shadow: var(--shadow); background: var(--surface-alt);
}
.about-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.about-copy p { color: var(--ink-soft); }
.about-copy .lead { color: var(--ink); font-weight: 500; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: .92rem; color: var(--ink-soft); }
.facts strong { display: block; color: var(--ink); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
/* Botó del perfil de LinkedIn (color de marca de LinkedIn a la icona) */
.btn-linkedin { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-linkedin svg { width: 20px; height: 20px; color: #0a66c2; flex: none; }
.btn-linkedin:hover { border-color: #0a66c2; color: #0a66c2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-linkedin svg { color: #70b5f9; }
  :root:not([data-theme="light"]) .btn-linkedin:hover { border-color: #70b5f9; color: #70b5f9; }
}

/* Botons de «Sobre mi» i biografia en finestra modal */
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.bio {
  width: min(760px, calc(100% - 32px)); max-height: min(86vh, 900px); max-height: min(86dvh, 900px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
  overflow: hidden; flex-direction: column;
}
.bio[open] { display: flex; animation: bio-in .25s ease-out; }
.bio::backdrop { background: rgba(20, 22, 24, .55); backdrop-filter: blur(3px); }
.bio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 32px 18px; border-bottom: 1px solid var(--line); }
.bio-head .kicker { margin-bottom: .4em; }
.bio-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.bio-close {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; transition: border-color .2s, color .2s;
}
.bio-close:hover { border-color: var(--accent); color: var(--accent-ink); }
.bio-close svg { width: 20px; height: 20px; }
.bio-body { padding: 22px 32px 32px; overflow-y: auto; overscroll-behavior: contain; }
.bio-body p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.7; margin: 0 0 1.05em; }
.bio-body p:first-child { color: var(--ink); font-size: 1.1rem; font-weight: 500; }
.bio-body p:last-child { margin-bottom: 0; }
html:has(.bio[open]) { overflow: hidden; }
@keyframes bio-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 600px) {
  .bio-head { padding: 22px 20px 14px; }
  .bio-body { padding: 18px 20px 24px; }
  .about-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .bio[open] { animation: none; }
  .nav ul, .nav::before, .nav-toggle svg { transition: none !important; }
}

/* Contacte */
.contact-section { background: var(--dark); color: var(--on-dark); }
.contact-section .kicker { color: #7fcdf1; }
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.contact-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); color: #fff; }
.contact-copy > p { color: var(--on-dark-soft); font-size: 1.08rem; }
.panel-cta { margin-top: 36px; padding: 26px; border-radius: var(--radius); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); }
.panel-cta p { color: var(--on-dark-soft); font-size: .96rem; }
.panel-cta strong { color: #fff; }

.form { background: var(--surface); color: var(--ink); border-radius: 24px; padding: 34px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea {
  font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .8em .95em; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--ink-soft); margin: 6px 0 22px; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.check.invalid span { color: var(--danger); }
/* Pregunta de seguretat */
.captcha-q { color: var(--accent-ink); }
.captcha-row { display: flex; align-items: center; gap: 12px; }
.captcha-row input { width: 110px; flex: none; }
.captcha-new {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font: 600 .85rem var(--font);
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
}
.captcha-new:hover { color: var(--ink); }
.form-note { font-size: .88rem; color: var(--danger); margin: 0 0 16px; }
.form-status { margin: 14px 0 0; font-size: .92rem; font-weight: 500; min-height: 1.4em; }
.form-status.ok { color: var(--accent-ink); }
.form-status.err { color: var(--danger); }

/* Peu */
/* Entitats que han confiat en Soportic (logotips en gris, fons transparent) */
.trust { padding: 72px 0; }
.trust-title { font: 700 .8rem/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); text-align: center; margin: 0 0 36px; }
.trust-logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 32px 40px; }
.trust-logos img { display: block; height: calc(var(--h, 44px) * .95); width: auto; max-width: 100%; opacity: .85; transition: opacity .2s; }
.trust-logos li:hover img { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .trust-logos img { filter: invert(1) brightness(.85); }
}
@media (max-width: 600px) {
  .trust { padding: 56px 0; }
  .trust-logos { gap: 28px 36px; }
  .trust-logos img { height: calc(var(--h, 44px) * .78); }
}

.site-footer { padding: 44px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.footer-tag { color: var(--ink-soft); font-size: .9rem; margin: 10px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer nav a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; }
.site-footer nav a:hover { color: var(--ink); }
.footer-link { font: inherit; font-size: .92rem; color: var(--ink-soft); background: none; border: 0; padding: 0; cursor: pointer; }
.footer-link:hover { color: var(--ink); text-decoration: underline; }
.copy { color: var(--ink-soft); font-size: .85rem; margin: 0; width: 100%; }

/* Animació d'entrada */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

/* Amplades intermèdies (tauletes): el menú complet hi cap si el botó del panell es fa curt */
@media (max-width: 960px) {
  .btn-panel .label-long { display: none; }
  .nav ul { gap: 0; }
  .nav a { --pad-x: .6em; }
}

@media (max-width: 880px) {
  /* Menú del mòbil: botó a la dreta de tot i plafó que surt de la dreta */
  .nav { order: 10; margin-left: auto; }
  /* Pàgines amb menú: el botó del Panell i el selector d'idioma passen al peu del plafó lateral */
  .site-header:has(.nav-toggle) .header-inner > .lang,
  .site-header:has(.nav-toggle) .header-inner > .btn-panel { display: none; }
  .nav .nav-panel { display: block; margin-top: auto; padding: 18px 0 6px; border-top: 1px solid var(--line); }
  .nav .nav-panel .btn-panel {
    display: inline-flex; width: 100%; padding: .9em 1.2em; font: 600 .95rem/1 var(--font);
    color: var(--bg); background: var(--brand);
  }
  .nav .nav-panel .btn-panel:hover { background: var(--brand-2); color: var(--bg); }
  .nav .nav-panel .btn-panel::after { display: none; }
  .nav .nav-lang { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 14px 4px; }
  .nav-lang-label { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
  .nav .nav-lang .lang a { display: inline-block; padding: .65em 1.1em; font: 700 .8rem/1 var(--font); letter-spacing: .02em; }
  .nav .nav-lang .lang a::after { display: none; }
  .nav .nav-lang .lang a:not([aria-current]) { background: none; color: var(--ink-soft); }
  .nav .nav-lang .lang a[aria-current] { background: var(--brand); color: var(--bg); font-weight: 700; }
  .nav-toggle {
    position: relative; z-index: 3; display: inline-grid; place-items: center;
    width: 42px; height: 42px; margin-right: -9px; border: 0; border-radius: 10px; background: transparent;
    color: var(--ink); cursor: pointer; padding: 0;
  }
  .nav-toggle svg { width: 24px; height: 24px; grid-area: 1 / 1; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s, transform .2s; }
  .nav-toggle .icon-close { opacity: 0; transform: rotate(-90deg); }
  .nav-toggle[aria-expanded="true"] .icon-open { opacity: 0; transform: rotate(90deg); }
  .nav-toggle[aria-expanded="true"] .icon-close { opacity: 1; transform: none; }
  .nav ul {
    position: fixed; z-index: 2; top: 0; right: 0; bottom: 0; width: min(320px, 82vw);
    display: flex; flex-direction: column; gap: 4px; padding: 92px 18px 24px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface); border-left: 1px solid var(--line); box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .35);
    transform: translateX(100%); visibility: hidden; transition: transform .3s ease, visibility 0s .3s;
  }
  .nav ul.open { transform: none; visibility: visible; transition: transform .3s ease; }
  .nav ul a { display: block; padding: 12px 14px; font-size: 1.08rem; --pad-x: 14px; }
  .nav ul a::after { right: auto; width: 2.4em; transform-origin: left; }
  /* Plafó lateral: la secció on som només es destaca amb el color del text, sense pastilla */
  :root .nav ul a[href^="#"][aria-current] { background: none; }
  /* Enfosquiment de la resta de la pàgina; en fer-hi clic es tanca el menú (js/main.js) */
  .nav::before {
    content: ""; position: fixed; inset: 0; z-index: 1; background: rgba(20, 22, 24, .45);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
    touch-action: none; /* sense desplaçar la pàgina de sota (un overflow: hidden a <html> trencaria la barra fixa) */
  }
  .nav:has(ul.open)::before { opacity: 1; visibility: visible; transition: opacity .3s; }
  .header-inner { gap: 12px; }
  .hero-grid, .contact, .about { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding: 48px 0 64px; }
  .site-header + main > .hero:first-child { padding-top: calc(48px + 73px); }
  .hero-visual { max-width: 460px; }
  .strip-grid { grid-template-columns: 1fr; }
  .strip-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .about-photo { max-width: 260px; }
  .section { padding: 72px 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .header-inner { gap: 8px; }
  .btn-panel { padding: .7em .85em; }
  .btn-panel .label-long { display: none; }
  .services, .projects, .steps, .field-row { grid-template-columns: 1fr; }
  .fb1 { left: 8px; bottom: -18px; }
  .fb2 { right: 8px; }
  .form { padding: 24px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ecg path { stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Pàgina d'agraïment ---------- */
.thanks-page { min-height: 100vh; display: flex; flex-direction: column; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.thanks {
  flex: 1; display: grid; place-items: center; padding: 56px 16px 80px; position: relative; overflow: hidden;
}
.thanks::before {
  content: ""; position: absolute; width: 760px; height: 760px; border-radius: 50%; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%);
  pointer-events: none;
}
.thanks-card {
  position: relative; max-width: 620px; width: 100%; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  padding: 52px 40px 40px; box-shadow: var(--shadow);
}
.thanks-emoji { font-size: 4.5rem; line-height: 1; margin-bottom: 18px; display: inline-block; animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(0) rotate(-25deg); } to { transform: none; } }
.thanks h1 { font-size: clamp(2.3rem, 6vw, 3.2rem); }
.thanks .lead { margin-inline: auto; font-size: 1.25rem; color: var(--ink); font-weight: 500; }
.thanks-note { color: var(--ink-soft); font-size: .95rem; max-width: 44ch; margin: 0 auto 28px; }
.thanks-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.thanks-sign { margin: 30px 0 0; font-size: .85rem; color: var(--ink-soft); font-weight: 600; letter-spacing: .02em; }
@media (max-width: 600px) { .thanks-card { padding: 40px 22px 30px; } }

/* ---------- Pàgines legals ---------- */
.legal { padding: 56px 0 88px; }
.legal-article { max-width: 780px; }
.legal-back { display: inline-block; font-weight: 600; font-size: .92rem; text-decoration: none; margin-bottom: 22px; }
.legal-back:hover { text-decoration: underline; }
.legal h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); margin-bottom: .3em; }
.legal-updated { color: var(--ink-soft); font-size: .9rem; margin-bottom: 2.2em; }
.legal h2 { font: 700 1.3rem/1.3 var(--font); letter-spacing: -.01em; margin: 2.2em 0 .7em; padding-top: .9em; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.legal h3 { font-size: 1.05rem; margin: 1.6em 0 .5em; }
.legal h4 { font-size: .98rem; margin: 1.3em 0 .4em; color: var(--accent-ink); }
.legal p, .legal li { color: var(--ink-soft); font-size: 1rem; }
.legal ul { padding-left: 1.2em; margin: 0 0 1em; }
.legal li { margin-bottom: .4em; }
.legal strong { color: var(--ink); }
.legal a { word-break: break-word; }
.legal-id { list-style: none; padding: 18px 22px !important; border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--line); }
.legal-id li { margin: .2em 0; }
.legal-table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: 14px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.legal-table th, .legal-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.legal-table th { background: var(--surface-alt); color: var(--ink); font-weight: 700; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table code { font-size: .85rem; color: var(--ink); word-break: break-all; }
.site-footer nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Avís de galetes ---------- */
.cookie-notice {
  position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 16px; margin-inline: auto; max-width: 760px;
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px 16px 22px; box-shadow: 0 18px 50px -18px rgba(38, 41, 44, .45);
  animation: notice-in .35s ease-out both; transition: opacity .3s, transform .3s;
}
.cookie-notice p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.cookie-notice a { font-weight: 600; }
.cookie-actions { display: flex; gap: 10px; flex: none; }
.cookie-notice .btn { flex: none; padding: .8em 1.3em; min-width: 7.5em; }
.cookie-notice.is-hidden { opacity: 0; transform: translateY(12px); }
@keyframes notice-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .cookie-notice { flex-direction: column; align-items: stretch; text-align: left; gap: 12px; padding: 16px; }
  .cookie-actions { width: 100%; }
  .cookie-notice .btn { flex: 1; min-width: 0; }
}
@media print { .cookie-notice { display: none; } }
