/* =========================================================================
   Portafolis Marta Vila — styles
   Editorial · two-tone (paper + vermell) · Fraunces / Inter
   ========================================================================= */

:root {
  /* palette */
  --bg:        #f4f2ee;
  --bg-deep:   #eae6df;
  --ink:       #1a1613;
  --prose:     #262019;
  --ink-2:     #463f37;
  --muted:     #6c6357;
  --red:       #c5331e;
  --red-deep:  #8c2113;
  --red-ink:   #a82a16;
  --paper:     #faf8f4;
  --cream-line: rgba(26, 22, 19, 0.14);
  --hairline:  rgba(26, 22, 19, 0.12);

  /* type */
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* metrics */
  --measure: 63ch;
  --pad-x: clamp(1.25rem, 5vw, 6rem);
  --shell: 1280px;

  /* z-index scale (semantic) */
  --z-progress: 60;
  --z-header:   70;
  --z-subnav:   80;
  --z-menu:     90;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--prose);
  font-family: var(--sans);
  font-size: clamp(1.02rem, 0.98rem + 0.28vw, 1.18rem);
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--red); color: var(--paper); }

.skip-link {
  position: fixed; top: 0.6rem; left: 0.6rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 8px;
  transform: translateY(-150%); transition: transform 0.2s var(--ease-out);
  z-index: 100; font-size: 0.9rem;
}
.skip-link:focus { transform: translateY(0); }

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

/* ====================== Scroll progress ============================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: var(--z-progress); pointer-events: none;
  background: transparent;
}
.scroll-progress__bar {
  display: block; height: 100%; width: 100%;
  background: var(--red);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ====================== Header ===================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1rem, 2.2vw, 1.6rem) var(--pad-x);
  color: var(--paper);
  background: linear-gradient(180deg, rgba(20,15,12,0.58) 0%, rgba(20,15,12,0.28) 55%, rgba(20,15,12,0) 100%);
  transition: color 0.4s ease, background-color 0.4s ease, padding 0.4s ease;
}
.site-header.is-solid {
  color: var(--ink);
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  padding-top: clamp(0.7rem, 1.4vw, 1rem);
  padding-bottom: clamp(0.7rem, 1.4vw, 1rem);
}

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark__mark {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.15rem; letter-spacing: 0.02em;
  border: 1.5px solid currentColor; border-radius: 50%;
  width: 2.3rem; height: 2.3rem;
  display: inline-grid; place-items: center;
  line-height: 1;
}
.wordmark__name {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.12rem; letter-spacing: 0.01em;
}

.nav { display: block; }
.nav__list { list-style: none; display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.4rem); }
.nav__item { position: relative; }
.nav__link {
  font-size: 0.92rem; font-weight: 500; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0; cursor: pointer;
}
.nav__link .nav__chev { transition: transform 0.3s var(--ease-out); }
.nav__item.has-sub:hover .nav__chev,
.nav__item.has-sub:focus-within .nav__chev { transform: rotate(180deg); }
.nav__link--soon { opacity: 0.55; cursor: default; }
.soon-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); margin-left: 0.5rem;
}

/* dropdown */
.subnav {
  position: absolute; top: calc(100% + 0.6rem); right: 0;
  min-width: 290px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 4px;
  padding: 0.5rem; z-index: var(--z-subnav);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out), visibility 0.28s;
}
/* invisible bridge across the gap between the trigger and the panel,
   so moving the cursor into the menu never drops :hover and closes it */
.subnav::before {
  content: ""; position: absolute;
  left: 0; right: 0; top: -0.7rem; height: 0.7rem;
}
.nav__item.has-sub:hover .subnav,
.nav__item.has-sub:focus-within .subnav { opacity: 1; visibility: visible; transform: translateY(0); }
.subnav__link {
  display: flex; align-items: baseline; gap: 0.7rem;
  padding: 0.75rem 0.85rem; border-radius: 9px;
  font-size: 0.96rem; transition: background 0.2s ease, color 0.2s ease;
}
.subnav__link:hover { background: var(--bg-deep); color: var(--red-ink); }
.subnav__num { font-family: var(--serif); font-size: 0.8rem; color: var(--red); font-weight: 500; }

/* mobile menu toggle */
.menu-toggle { display: none; }

/* ====================== Mobile menu =============================== */
.mobile-menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--ink); color: var(--paper);
  padding: clamp(5rem, 14vh, 8rem) var(--pad-x) 3rem;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(-100%);
  transition: transform 0.6s var(--ease-out-soft);
  visibility: hidden;
}
.mobile-menu.is-open { transform: translateY(0); visibility: visible; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.3rem; margin: auto 0; width: 100%; }
.mobile-menu__label {
  font-family: var(--serif); font-size: 0.95rem; color: var(--red);
  margin-bottom: 1rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.mobile-menu__label:not(:first-of-type) { margin-top: 1.8rem; }
.mobile-menu a {
  font-family: var(--serif); font-size: clamp(1.7rem, 7vw, 2.6rem);
  font-weight: 400; padding: 0.55rem 0;
  display: flex; align-items: baseline; gap: 0.9rem;
  border-bottom: 1px solid rgba(250,248,244,0.14);
}
.mobile-menu a.mobile-menu__q {
  font-size: clamp(1.05rem, 4vw, 1.35rem); line-height: 1.25;
  padding: 0.5rem 0;
}
.mobile-menu__num { font-size: 0.9rem; color: var(--red); }
.mobile-menu__soon { margin-top: 1.6rem; color: rgba(250,248,244,0.6); font-size: 0.95rem; }

/* ====================== Hero ====================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad-x);
  padding-bottom: clamp(3.5rem, 9vh, 7rem);
  overflow: hidden;
  color: var(--paper);
}
.hero__media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero__img {
  position: absolute; inset: -4% 0; width: 100%; height: 108%;
  object-fit: cover; object-position: 50% 52%;
  will-change: transform;
}
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,15,12,0.46) 0%, rgba(20,15,12,0.12) 30%, rgba(20,15,12,0.18) 55%, rgba(20,15,12,0.82) 100%);
}
.hero__inner { position: relative; z-index: 1; max-width: var(--shell); width: 100%; margin: 0 auto; }
.hero__eyebrow {
  font-size: 0.98rem; letter-spacing: 0.005em;
  font-weight: 500; margin-bottom: clamp(1rem, 2.5vw, 1.6rem);
  color: color-mix(in oklab, var(--paper) 88%, var(--red) 26%);
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.hero__eyebrow::before {
  content: ""; width: 1.8rem; height: 1px; background: var(--red);
}
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.7rem, 8.4vw, 5.6rem);
  line-height: 1.0; letter-spacing: -0.015em;
  text-wrap: balance;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line__inner { display: block; }
.hero__title .line:last-child .line__inner { color: color-mix(in oklab, var(--paper) 78%, var(--red) 60%); font-style: italic; }

.hero__scroll {
  position: absolute; right: var(--pad-x); bottom: clamp(3.5rem, 9vh, 7rem);
  z-index: 1; display: inline-flex; flex-direction: column; align-items: center; gap: 0.8rem;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
  writing-mode: vertical-rl;
}
.hero__scroll-line { width: 1px; height: 64px; background: currentColor; transform-origin: top; overflow: hidden; position: relative; }
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0; background: var(--red);
  animation: scrollline 2.2s var(--ease-out) infinite;
}
@keyframes scrollline {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  46% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ====================== Shared section frame ====================== */
.section-title, .chapter__title {
  font-family: var(--serif); font-weight: 400;
  letter-spacing: -0.012em; line-height: 1.04; text-wrap: balance;
  color: var(--ink);
}

/* ====================== Punt de partida =========================== */
.start {
  max-width: var(--shell); margin: 0 auto;
  padding: clamp(5rem, 14vh, 11rem) var(--pad-x) clamp(3rem, 7vh, 5rem);
}
.start__grid {
  display: grid; grid-template-columns: 1.5fr 0.9fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.section-title { font-size: clamp(2.3rem, 6.4vw, 4.6rem); }
.start__lead {
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
  max-width: 46ch; font-size: clamp(1.1rem, 1.02rem + 0.4vw, 1.34rem);
  color: var(--ink-2); line-height: 1.6; text-wrap: pretty;
}
.portrait { justify-self: end; max-width: 300px; width: 100%; }
.portrait__frame {
  overflow: hidden; border-radius: 3px;
  border: 1px solid var(--hairline);
  background: var(--bg-deep);
}
.portrait__frame img { width: 100%; aspect-ratio: 364 / 485; object-fit: cover; }
.portrait figcaption {
  margin-top: 0.9rem; font-family: var(--serif); font-size: 1.1rem; color: var(--ink);
  display: flex; flex-direction: column; line-height: 1.3;
}
.portrait figcaption span { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; letter-spacing: 0.01em; }

/* index list */
.index {
  list-style: none; max-width: var(--shell); margin: clamp(3rem, 7vh, 5rem) auto 0;
  border-top: 1px solid var(--cream-line);
}
.index__item { border-bottom: 1px solid var(--cream-line); }
.index__item a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.3rem, 3.2vw, 2.3rem) 0.4rem;
  transition: padding-left 0.4s var(--ease-out), color 0.3s ease;
}
.index__item a:hover { padding-left: 1.4rem; color: var(--red-ink); }
.index__num { font-family: var(--serif); font-size: 0.9rem; color: var(--red); font-weight: 500; }
.index__title { font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2.6rem); font-weight: 400; letter-spacing: -0.01em; }
.index__arrow { font-size: 1.4rem; opacity: 0.4; transition: transform 0.4s var(--ease-out), opacity 0.3s ease; }
.index__item a:hover .index__arrow { opacity: 1; transform: translateX(8px); }

/* ====================== Chapters ================================== */
.chapter {
  max-width: var(--shell); margin: 0 auto;
  padding: clamp(4.5rem, 12vh, 9rem) var(--pad-x);
}
.chapter__head {
  display: grid; gap: 0.8rem; margin-bottom: clamp(2.4rem, 5vw, 4rem);
  border-bottom: 1px solid var(--cream-line); padding-bottom: clamp(1.6rem, 3vw, 2.4rem);
}
.chapter__title { font-size: clamp(2rem, 5.6vw, 4rem); }

.prose { max-width: var(--measure); margin: 0 auto; }
.prose p {
  font-size: clamp(1.06rem, 1rem + 0.34vw, 1.28rem);
  line-height: 1.68; color: var(--prose);
  text-align: justify; text-justify: inter-word;
  hyphens: auto; -webkit-hyphens: auto;
}
.prose p + p { margin-top: 1.4em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose cite { font-style: italic; }
.prose a {
  color: var(--red-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in oklab, var(--red-ink) 55%, transparent);
  overflow-wrap: anywhere;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.prose a:hover { color: var(--red-deep); text-decoration-color: currentColor; }

/* ====================== Reflexió (subsections) ==================== */
.reflexio__q { max-width: var(--measure); margin-inline: auto; }
.reflexio__q + .reflexio__q { margin-top: clamp(2.6rem, 6vw, 4.4rem); }
.subsection-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2.05rem);
  line-height: 1.14; letter-spacing: -0.01em;
  color: var(--ink); text-wrap: balance;
  margin-bottom: clamp(1.1rem, 2.4vw, 1.6rem);
}

/* ====================== Pràctiques ================================ */
.practiques { border-top: 1px solid var(--cream-line); }
.subnav__link--nested { padding: 0.45rem 0.85rem 0.45rem 2.6rem; font-size: 0.88rem; color: var(--ink-2); }
.mobile-menu a.mobile-menu__q--nested { padding-left: 1.6rem; opacity: 0.85; }
.chapter__eyebrow {
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500; color: var(--red-ink);
}
.index--sub { max-width: var(--measure); margin: 0 auto clamp(3rem, 7vw, 5rem); }
.index--sub .index__item a { padding: clamp(0.9rem, 2vw, 1.3rem) 0.4rem; }
.index--sub .index__title { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.index--mini { margin-bottom: clamp(2rem, 5vw, 3rem); }
.index--mini .index__title { font-size: clamp(1.05rem, 1.8vw, 1.3rem); }

.pending {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.95rem !important; color: var(--muted) !important; font-style: italic;
  padding: 0.6rem 1rem; border: 1px dashed var(--cream-line); border-radius: 4px;
  text-align: left !important;
}
.pending::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

.evidence { margin-top: clamp(2.4rem, 5vw, 3.6rem); scroll-margin-top: 5rem; }
.evidence__title {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem); color: var(--red-ink);
  margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--cream-line);
}
.evidence .prose p { text-align: left; }

.letter {
  margin-top: 1.6rem;
  background: var(--paper); border: 1px solid var(--hairline);
  border-left: 3px solid var(--red);
  border-radius: 3px;
  padding: clamp(1.3rem, 3vw, 2.2rem) clamp(1.2rem, 3.4vw, 2.4rem);
  font-family: var(--serif); font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem);
  line-height: 1.7; color: var(--prose);
}
.letter p + p { margin-top: 0.9em; }
.letter__heading { font-weight: 600; color: var(--ink); }
.letter__sign { font-style: italic; }
.letter-sep {
  display: flex; justify-content: center; gap: 1.1rem;
  margin: clamp(1.8rem, 4vw, 2.6rem) 0 0.4rem;
  color: var(--red); font-size: 0.85rem;
}

/* ---- Graella de planificació ---- */
.plan-head { margin-bottom: 1.6rem; }
.plan-head__kicker { font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-ink); font-weight: 500; }
.plan-head__title { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); color: var(--ink); line-height: 1.1; font-style: italic; }
.plan-context { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--cream-line); border: 1px solid var(--cream-line); border-radius: 4px; overflow: hidden; margin-bottom: 1.6rem; }
.plan-context > div { background: var(--paper); padding: 0.9rem 1.1rem; }
.plan-context dt, .act__grid dt { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 0.25rem; }
.plan-context dd { font-size: 0.98rem; color: var(--ink); line-height: 1.45; }
.plan-box { background: var(--paper); border: 1px solid var(--hairline); border-radius: 4px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; font-size: 1rem; line-height: 1.6; }
.plan-box__label { font-family: var(--serif); font-weight: 600; color: var(--red-ink); font-size: 1.08rem; }
.plan-box__label:not(:first-child) { margin-top: 1.1rem; }
.plan-box__note { font-size: 0.86rem; color: var(--muted); font-style: italic; }
.plan-box ul, .act__desc ul, .report__block ul { padding-left: 1.2rem; margin-top: 0.4rem; }
.plan-box li + li, .act__desc li + li, .report__block li + li { margin-top: 0.35rem; }
.plan-session { font-family: var(--serif); font-weight: 500; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); color: var(--ink); margin: clamp(2.4rem, 5vw, 3.4rem) 0 1rem; padding: 0.7rem 1rem; background: var(--bg-deep); border-radius: 4px; }

.act { border: 1px solid var(--hairline); border-radius: 4px; background: var(--paper); margin-top: 1rem; overflow: hidden; font-size: 0.98rem; line-height: 1.6; }
.act--task { border-color: color-mix(in oklab, var(--red) 45%, transparent); }
.act__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; padding: 0.8rem 1.2rem; border-bottom: 1px solid var(--hairline); background: color-mix(in oklab, var(--bg-deep) 55%, var(--paper)); }
.act--task .act__head { background: color-mix(in oklab, var(--red) 10%, var(--paper)); }
.act__num { font-family: var(--serif); font-weight: 600; color: var(--red-ink); }
.act__type { color: var(--ink-2); font-size: 0.9rem; flex: 1 1 12rem; }
.act__time { font-family: var(--serif); font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--hairline); border-radius: 999px; padding: 0 0.6rem; font-size: 0.88rem; }
.act__desc { padding: 1rem 1.2rem 0.4rem; color: var(--prose); }
.act__desc p + p { margin-top: 0.6rem; }
.act__desc a, .report a { color: var(--red-ink); text-decoration: underline; text-underline-offset: 0.18em; }
.act__img { max-width: 320px; width: 100%; border-radius: 3px; margin: 0.8rem 0; border: 1px solid var(--hairline); }
.act__aside { font-style: italic; color: var(--muted); font-size: 0.92rem; }
.act__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem 1.4rem; padding: 0.8rem 1.2rem 1.1rem; }
.act__grid dd { font-size: 0.93rem; color: var(--prose); line-height: 1.5; }
.act__comment { margin: 0 1.2rem 1.1rem; padding: 0.8rem 1rem; border-left: 3px solid var(--red); background: var(--bg); font-size: 0.93rem; line-height: 1.55; font-style: italic; color: var(--ink-2); }
.act__comment span { display: block; font-style: normal; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red-ink); font-weight: 600; margin-bottom: 0.2rem; }

/* ---- Graella: rèplica del document Word (A4 apaïsat, Calibri 11) ---- */
.word-scroll {
  --ww: min(1180px, calc(100vw - 2 * var(--pad-x)));
  width: var(--ww); margin-left: calc(50% - var(--ww) / 2);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 4px 14px;
}
.word-page {
  width: 842pt; min-width: 842pt; margin: 0 auto; box-sizing: border-box;
  background: #fff; color: #000;
  padding: 56.7pt 56.7pt 56.7pt 70.85pt;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.08);
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  font-size: 11pt; line-height: 1.2; text-align: left;
  -webkit-font-smoothing: auto;
}
.word-page p { margin: 0; }
.word-page b { font-weight: 700; }
.word-page a { color: #0563c1; text-decoration: underline; }
.word-page img { display: inline-block; vertical-align: bottom; }
.word-page .wt { border-collapse: collapse; table-layout: fixed; margin: 0; }
.word-page .wt td { border: 1px solid #000; padding: 0 5.75pt; overflow-wrap: break-word; }
.word-page .wt + p, .word-page p + .wt { margin-top: 0; }
.word-page .wl { position: relative; padding-left: 36pt; }
.word-page .wl__m { position: absolute; left: 18pt; }
.word-hint { display: none; font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 0.4rem; }
@media (max-width: 1240px) { .word-hint { display: block; } }

/* ---- Informe del tutor: rèplica del PDF (A4 vertical) ---- */
.word-scroll--a4 { --ww: min(860px, calc(100vw - 2 * var(--pad-x))); }
.word-page--a4 { width: 595pt; min-width: 595pt; min-height: 842pt; padding: 50pt 52pt 50pt 64pt; }
.word-page--a4 + .word-page--a4 { margin-top: 18px; }
@media (min-width: 900px) { .word-scroll--a4 + .word-hint { display: none; } }
.pdf-informe { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 11pt; line-height: 1.2; }
.pi-logos { display: flex; align-items: center; justify-content: center; gap: 10pt; margin: 0 0 12pt; }
.pi-logos img { height: auto; display: block; }
.pi-c { text-align: center; }
.pi-b { font-weight: 700; }
.pi-title { text-align: center; font-weight: 700; font-size: 14pt; margin: 30pt 0 10pt !important; }
.pi-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pi-t td { border: 1px solid #000; padding: 3pt 5pt; vertical-align: top; }
.pi-info { margin-bottom: 40pt; }
.pi-info td { font-size: 11.5pt; padding: 4pt 6pt; }
.pi-score { margin-bottom: 22pt; }
.pi-h td { text-align: center; font-weight: 700; font-size: 11.5pt; vertical-align: middle; padding: 6pt 5pt; }
.pi-h .pi-hl { background: #d9d9d9; line-height: 1.1; }
.pi-just { text-align: justify !important; }
.pi-ok { background: #92d050; }
.pi-crit { font-size: 10pt; text-align: justify; padding-bottom: 12pt !important; }
.pi-com { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.25; }
.pi-sec { text-align: center; font-weight: 700; text-decoration: underline; font-size: 12pt; margin: 16pt 0 4pt !important; }
.pi-box { border: 1px solid #000; padding: 6pt; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 1.25; }
.pi-box--just p { text-align: justify; }
.pi-sign { width: 100%; margin-top: 18pt; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
.pi-sign td { padding: 7pt 0; vertical-align: middle; width: 50%; }
.pi-sigbox { display: inline-block; font-family: Calibri, Carlito, sans-serif; font-size: 8pt; line-height: 1.15; padding-left: 8pt; border-left: 1px solid #b9b2e0; }

/* ---- Observació: apartats dins de cada curs ---- */
.obs-part + .obs-part { margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.obs-title {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(1.12rem, 1rem + 0.6vw, 1.38rem); color: var(--red-ink);
  margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--cream-line);
}

/* ---- Evidències: PDF incrustat ---- */
.pdf-embed { border: 1px solid var(--hairline); border-radius: 4px; overflow: hidden; background: var(--bg-deep); }
.pdf-embed object { display: block; width: 100%; height: min(85vh, 1000px); }
.pdf-embed__fallback { padding: 1.2rem; font-size: 0.95rem; }
.pdf-embed__link { margin-top: 0.6rem; font-size: 0.92rem; }
.pdf-embed__link a, .pdf-embed__fallback a { color: var(--red-ink); text-decoration: underline; text-underline-offset: 0.18em; }
.pdf-embed__link span { color: var(--muted); }

/* ---- Evidències: fitxes escanejades ---- */
.ev-group { font-family: var(--serif); font-size: 1.08rem; color: var(--ink); margin: 1.6rem 0 0.7rem; }
.ev-group:first-of-type { margin-top: 0.4rem; }
.ev-group span { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.ev-sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 1rem; }
.ev-sheets a { display: block; background: #fff; border: 1px solid var(--hairline); border-radius: 3px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.08); transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease; }
.ev-sheets a:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.ev-sheets img { width: 100%; height: auto; }
.ev-hint { margin-top: 0.8rem; font-size: 0.85rem; color: var(--muted); font-style: italic; }

/* ---- Posada en pràctica: fotos ---- */
.photo-pair {
  --pw: min(1100px, calc(100vw - 2 * var(--pad-x)));
  width: var(--pw); margin-left: calc(50% - var(--pw) / 2);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.8rem, 2vw, 1.4rem);
}
.photo-pair figure { margin: 0; }
.photo-pair img { width: 100%; aspect-ratio: 1400 / 1054; object-fit: cover; }
@media (max-width: 700px) { .photo-pair { grid-template-columns: 1fr; } }

/* ---- Materials de classe (fitxes) ---- */
.sheet { background: var(--paper); border: 1px solid var(--hairline); border-radius: 4px; padding: clamp(1.2rem, 3vw, 2rem); margin-top: 1.2rem; font-size: 1rem; line-height: 1.6; box-shadow: 0 1px 0 var(--hairline); }
.sheet + .sheet { margin-top: 1.6rem; }
.sheet__title { font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); font-weight: 500; color: var(--ink); margin-bottom: 0.9rem; }
.sheet__instr { font-weight: 500; color: var(--ink); }
.sheet__instr + * { margin-top: 0.8rem; }
.sheet__example { margin-top: 0.7rem; padding: 0.6rem 0.9rem; background: var(--bg); border-radius: 3px; font-size: 0.95rem; }
.sheet__example--center { text-align: center; }
.sheet__cols { columns: 2 16rem; column-gap: 2.4rem; font-family: var(--serif); font-size: 1.05rem; }
.verse { break-inside: avoid; margin-bottom: 1rem; line-height: 1.55; }
.sheet__list { padding-left: 1.4rem; margin-top: 0.8rem; }
.sheet__list li + li { margin-top: 0.45rem; }
.sheet__bullets { padding-left: 1.2rem; margin-top: 0.8rem; }
.sheet__bullets ul { padding-left: 1.2rem; margin-top: 0.3rem; font-style: italic; }
.sheet__blank { margin-top: 1rem; border: 1px solid var(--cream-line); border-radius: 3px; min-height: 9rem; padding: 0.9rem 1rem; font-family: var(--serif); background: repeating-linear-gradient(transparent 0 1.9rem, var(--cream-line) 1.9rem calc(1.9rem + 1px)); background-position: 0 2.4rem; }
.mindmap { display: grid; grid-template-columns: 1fr minmax(0, 2fr) 1fr; grid-template-rows: repeat(3, auto); gap: 0.8rem 1rem; align-items: center; margin-top: 1rem; }
.mindmap img { grid-column: 2; grid-row: 1 / span 3; width: 100%; border-radius: 3px; border: 1px solid var(--hairline); }
.mindmap span { font-style: italic; font-family: var(--serif); padding: 0.5rem 0.7rem; border: 1px dashed var(--cream-line); border-radius: 999px; text-align: center; }
.mindmap span:nth-of-type(odd) { grid-column: 1; }
.mindmap span:nth-of-type(even) { grid-column: 3; }
.table-wrap { overflow-x: auto; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.sheet-table th { background: var(--bg-deep); font-weight: 600; padding: 0.6rem; border: 1px solid var(--cream-line); }
.sheet-table td { padding: 0.75rem 0.8rem; border: 1px solid var(--cream-line); vertical-align: top; width: 50%; }
.sheet-table small { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.82rem; }
.match { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1rem 2rem; margin-top: 0.8rem; }
.match ul { list-style: none; display: grid; gap: 0.5rem; }
.match li { padding: 0.45rem 0.8rem; border: 1px solid var(--cream-line); border-radius: 3px; background: var(--bg); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 1rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; border: 1px solid var(--hairline); }
.gallery--cast img { aspect-ratio: 4 / 4.2; object-position: 50% 25%; }
.gallery figcaption { margin-top: 0.4rem; font-family: var(--serif); font-size: 0.95rem; text-transform: none; color: var(--ink); }
.scene-intro { display: grid; grid-template-columns: minmax(0, 0.8fr) 1.2fr; gap: 1.2rem; align-items: start; }
.scene-intro img { width: 100%; border-radius: 3px; border: 1px solid var(--hairline); }
.script { margin-top: 1.4rem; font-family: var(--serif); font-size: 1.04rem; line-height: 1.55; display: grid; gap: 0.9rem; }
.script .who { display: block; font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--red-ink); }
.script .who small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 0.82rem; }

/* ---- Informe del tutor ---- */
.report { max-width: 52rem; margin: 0 auto; }
.report__top { text-align: center; margin-bottom: 1.6rem; color: var(--ink-2); font-size: 0.95rem; }
.report__doc { margin-top: 0.6rem; font-family: var(--serif); font-size: 1.3rem; color: var(--ink); font-weight: 500; }
.score { border: 1px solid var(--hairline); border-radius: 4px; background: var(--paper); padding: 1.1rem 1.3rem; margin-top: 1rem; font-size: 0.97rem; line-height: 1.55; }
.score__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.score__head h4 { font-family: var(--serif); font-weight: 500; font-size: 1.12rem; color: var(--ink); line-height: 1.25; }
.score__val { flex: none; font-family: var(--serif); color: var(--muted); font-size: 0.95rem; background: color-mix(in oklab, var(--red) 9%, var(--paper)); border: 1px solid color-mix(in oklab, var(--red) 30%, transparent); border-radius: 999px; padding: 0.15rem 0.75rem; }
.score__val b { color: var(--red-ink); font-size: 1.2rem; }
.score ul { padding-left: 1.1rem; color: var(--ink-2); }
.score__note { margin-top: 0.9rem; padding: 0.8rem 1rem; border-left: 3px solid var(--red); background: var(--bg); font-style: italic; }
.report__block { margin-top: 2rem; }
.report__block h4 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem); color: var(--ink); margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--cream-line); }
.report__block p { font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem); line-height: 1.68; }
.report__block p + p, .report__block ul + p { margin-top: 0.9em; }
.report__sign { margin-top: 2.2rem; text-align: right; font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.report__sign span { font-style: normal; font-size: 0.92rem; color: var(--muted); }

@media (max-width: 640px) {
  .mindmap { grid-template-columns: 1fr 1fr; }
  .mindmap img { grid-column: 1 / -1; grid-row: 1; }
  .mindmap span:nth-of-type(odd), .mindmap span:nth-of-type(even) { grid-column: auto; }
  .scene-intro, .match { grid-template-columns: 1fr; }
}

/* figures */
.figure { margin: clamp(2.6rem, 6vw, 4.5rem) auto; }
.figure__frame {
  overflow: hidden; border-radius: 3px;
  border: 1px solid var(--hairline);
}
.figure__frame img { width: 100%; }
.figure figcaption {
  margin-top: 1rem; font-size: 0.88rem; color: var(--muted);
  text-align: center; font-style: italic; max-width: 52ch; margin-inline: auto;
}
.figure--classe { max-width: 440px; }
.figure--draw {
  max-width: 600px;
}
.figure--draw .figure__frame {
  background: #e9eef9; padding: 0;
  border-color: rgba(40,55,95,0.22);
}
.figure--draw .figure__frame img { aspect-ratio: 678 / 952; object-fit: cover; }

/* ====================== Quote band =============================== */
.quote-band {
  background: var(--red); color: var(--paper);
  padding: clamp(5rem, 14vh, 9rem) var(--pad-x);
  position: relative; overflow: hidden;
}
.quote-band::before {
  content: "“"; position: absolute; top: -0.18em; left: 0.1em;
  font-family: var(--serif); font-size: clamp(12rem, 30vw, 26rem);
  line-height: 1; color: color-mix(in oklab, var(--paper) 12%, transparent);
  pointer-events: none;
}
.quote { max-width: 19ch; margin: 0 auto; text-align: center; position: relative; }
.quote p {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(1.9rem, 5.4vw, 3.7rem); line-height: 1.16;
  letter-spacing: -0.01em; text-wrap: balance;
}

/* ====================== Footer =================================== */
.site-footer {
  background: var(--ink); color: var(--paper);
  padding: clamp(2.5rem, 6vh, 4rem) var(--pad-x);
}
.site-footer__top { max-width: var(--shell); margin: 0 auto; }
.site-footer__big {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(2.6rem, 9vw, 6rem); line-height: 1.02; letter-spacing: -0.015em;
}
.site-footer__meta {
  max-width: var(--shell); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  color: rgba(250,248,244,0.78); font-size: 0.92rem;
}
.site-footer__meta .wordmark__mark { width: 2.1rem; height: 2.1rem; font-size: 1rem; }
.site-footer__soon { margin-left: auto; color: var(--red); font-weight: 500; }

/* ====================== Reveal base (JS-driven) ================== */
/* Content is fully visible by default; JS sets hidden start-states only
   when it will actually animate, so no-JS / headless renders stay visible. */
.word, .char { display: inline-block; }
.split-line { display: block; overflow: hidden; }

/* ====================== Responsive =============================== */
@media (max-width: 860px) {
  .nav { display: none; }
  .menu-toggle {
    display: inline-flex; flex-direction: column; gap: 6px;
    background: none; border: 0; cursor: pointer; padding: 0.4rem; color: inherit;
  }
  .menu-toggle span { width: 28px; height: 2px; background: currentColor; transition: transform 0.4s var(--ease-out), opacity 0.3s ease; }
  .menu-toggle.is-open span:first-child { transform: translateY(8px) rotate(45deg); }
  .menu-toggle.is-open span:last-child { transform: translateY(-0px) rotate(-45deg); }

  .start__grid { grid-template-columns: 1fr; align-items: start; }
  .portrait { justify-self: start; order: -1; max-width: 240px; }
  .start__lead { max-width: none; }
}

/* Mobile hero: show the full photo (everyone visible) with the title below it */
@media (max-width: 700px) {
  .hero {
    min-height: auto; display: block; overflow: visible;
    padding: 0 0 clamp(2rem, 8vw, 3.5rem);
    color: var(--ink);
  }
  .hero__media {
    position: relative; inset: auto;
    width: 100%; aspect-ratio: 2000 / 1506;
  }
  .hero__img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-position: 50% 50%; transform: none !important;
  }
  .hero__scrim { display: none; }
  .hero__scroll { display: none; }
  .hero__inner { margin-top: clamp(1.4rem, 6vw, 2.2rem); padding-inline: var(--pad-x); }
  .hero__eyebrow { color: var(--red-ink); }
  .hero__eyebrow::before { background: var(--red); }
  .hero__title { color: var(--ink); }
  .hero__title .line:last-child .line__inner { color: var(--red-ink); }
}

@media (max-width: 560px) {
  .wordmark__name { display: none; }
  .figure--classe { max-width: 320px; }
}

/* ====================== Reduced motion ========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .soon-dot, .hero__scroll-line::after { animation: none !important; }
}
