:root {
  --bg: #fafaf7;
  --bg-1: #f5f5f2;
  --surface: #ffffff;
  --surface-soft: #fbfbf9;
  --surface-darkest: #0a0a0a;
  --surface-accent: #fffdf5;
  --text: #171717;
  --text-strong: #0a0a0a;
  --muted: #525252;
  --muted-strong: #262626;
  --border: rgba(10, 10, 10, 0.10);
  --border-strong: rgba(10, 10, 10, 0.25);
  --accent-sky: #0284c7;
  --accent-amber: #b45309;
  --accent-rose: #be123c;
  --accent-gold: #a16207;
}

html, body { background: var(--bg); color: var(--text); }

html::-webkit-scrollbar, body::-webkit-scrollbar {
  width: 8px;
}
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: rgba(10,10,10,0.12);
  border-radius: 8px;
}
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: transparent; }

.app-bg {
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(253, 230, 138, 0.18), transparent 70%),
    radial-gradient(circle at 12% 20%, rgba(125, 211, 252, 0.10), transparent 50%),
    radial-gradient(circle at 88% 80%, rgba(253, 164, 175, 0.08), transparent 52%),
    linear-gradient(180deg, #fafaf7 0%, #f8f7f2 40%, #faf9f4 100%);
  min-height: 100vh;
}

/* Faint grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(10, 10, 10, 0.010) 0,
      rgba(10, 10, 10, 0.010) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.6;
  mix-blend-mode: multiply;
}

main, header, footer, nav { position: relative; z-index: 1; }

/* ------ Buttons ------ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 0.35rem;
  border: 1px solid #0a0a0a;
  background: #0a0a0a;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.btn-primary:hover { background: #262626; }
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(10,10,10,0.75);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 0.35rem;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 160ms ease, border-color 160ms ease;
}
.btn-ghost:hover { background: rgba(10,10,10,0.05); border-color: rgba(10,10,10,0.4); }
.btn-ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(10,10,10,0.5);
}

/* ------ Typography helpers ------ */
.overline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-amber);
}

.eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-sky { color: #0369a1; }
.eyebrow-amber { color: var(--accent-amber); }
.eyebrow-rose { color: #be123c; }
.eyebrow-dark { color: #737373; }
.eyebrow-inline {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.section-h2 {
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-top: 0.75rem;
}

.section-wrap {
  padding-top: 4.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
@media (min-width: 640px) {
  .section-wrap { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ------ Cards ------ */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(10,10,10,0.03), transparent 60%),
    var(--surface);
  padding: 1.5rem;
  color: var(--text);
  box-shadow: 0 20px 40px -30px rgba(10,10,10,0.18);
}
@media (min-width: 640px) {
  .card { padding: 2rem; }
}

.card-h {
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.25rem, 3.6vw, 3.25rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-top: 0.4rem;
}
.card-h-sm { font-size: clamp(1.4rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: 0.01em; text-transform: none; }

.headline {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  max-width: 52ch;
}
.headline-sm { margin-top: 0.4rem; font-size: 0.95rem; color: var(--muted-strong); }

.prose-block {
  margin-top: 1.25rem;
  color: var(--muted-strong);
  font-size: 1rem;
  line-height: 1.75;
}
.prose-block p + p { margin-top: 0.9rem; }
.prose-block strong { color: var(--text-strong); font-weight: 600; }
.prose-block em { font-style: normal; color: var(--text-strong); }
.prose-on-light { color: #404040; }
.prose-on-light strong { color: #0a0a0a; }
.prose-on-light em { color: #0a0a0a; }

.subblock { border-top: 1px dashed var(--border); padding-top: 0.9rem; }
.subblock > .sub-h { margin-top: 0; }
.sub-h {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: 0.4rem;
}
.subblock p { color: var(--muted-strong); font-size: 0.96rem; line-height: 1.7; }
.subblock .ref { margin-top: 0.5rem; font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.subblock-regne { border-top-color: rgba(161,98,7,0.25); }

/* ------ Quotes ------ */
.quote {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-left: 2px solid rgba(10,10,10,0.25);
  background: rgba(10,10,10,0.03);
  border-radius: 0.25rem;
}
.quote blockquote {
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-strong);
  letter-spacing: 0.005em;
}
.quote figcaption {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-sm blockquote { font-size: 0.95rem; }
.quote-light {
  background: rgba(10,10,10,0.04);
  border-left-color: rgba(10,10,10,0.25);
}
.quote-light blockquote { color: #0a0a0a; }
.quote-light figcaption { color: #525252; }
.quote-inline { padding: 0; background: transparent; border: 0; }
.quote-inline blockquote { font-size: 0.95rem; color: var(--muted-strong); font-style: italic; }
.quote-inline figcaption { margin-top: 0.25rem; }

.card-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* ------ Accent variants ------ */
.card-deu {
  border-color: rgba(2, 132, 199, 0.22);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(2, 132, 199, 0.06), transparent 55%),
    var(--surface);
}

.card-fe {
  border-color: rgba(2, 132, 199, 0.35);
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(2, 132, 199, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(2,132,199,0.04), transparent 80%),
    #f0f9ff;
}
.card-fe .card-h { color: #075985; }

.card-nosaltres {
  border-color: rgba(190, 18, 60, 0.12);
}

.penediment-inset {
  border: 1px solid rgba(180, 83, 9, 0.4);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(252, 211, 77, 0.15), transparent 60%),
    rgba(252, 211, 77, 0.08);
}
.penediment-inset .sub-h { color: #92400e; letter-spacing: 0.04em; text-transform: none; font-size: 1.1rem; font-weight: 600; }

/* Disseny is the LIGHTER card (stays near-white on the light page) */
.card-disseny {
  background:
    linear-gradient(180deg, #ffffff 0%, #fefdfa 100%);
  border: 1px solid rgba(10,10,10,0.08);
  color: #262626;
}
.card-disseny .card-h { color: #0a0a0a; }
.card-disseny .eyebrow-dark { color: #737373; }

/* Pecat stays the DARKEST card on the page — now dark-on-light it's still inverted */
.card-pecat {
  background:
    radial-gradient(100% 60% at 0% 0%, rgba(255,255,255,0.06), transparent 70%),
    #0a0a0a;
  border: 1px solid rgba(10,10,10,0.8);
  color: #e5e5e5;
}
.card-pecat .card-h { color: #ffffff; }
.card-pecat .eyebrow-rose { color: #fda4af; }
.card-pecat .prose-block { color: #d4d4d4; }
.card-pecat .prose-block strong, .card-pecat .prose-block em { color: #ffffff; }
.card-pecat .quote { background: rgba(255,255,255,0.05); border-left-color: rgba(255,255,255,0.3); }
.card-pecat .quote blockquote { color: #ffffff; }
.card-pecat .quote figcaption { color: #a3a3a3; }

.card-creu {
  border-color: rgba(190, 18, 60, 0.20);
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(253, 164, 175, 0.10), transparent 60%),
    var(--surface);
}

.creu-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
}
.creu-left, .creu-right {
  color: var(--muted-strong);
  font-size: 0.96rem;
  line-height: 1.75;
}
.creu-left p + p, .creu-right p + p { margin-top: 0.75rem; }
.creu-center {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}
.creu-center svg { color: #be123c; }
@media (max-width: 640px) {
  .creu-layout { grid-template-columns: 1fr; }
  .creu-center { order: -1; }
  .creu-center svg { height: 5rem; width: 5rem; }
}

.card-bateig {
  border-color: rgba(190, 18, 60, 0.18);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(253, 164, 175, 0.06), transparent 55%),
    var(--surface-soft);
}

.card-judici {
  border-color: rgba(10, 10, 10, 0.14);
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(253, 230, 138, 0.12), transparent 60%),
    var(--surface);
}

.esperit-tab {
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
}

.accordion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(10,10,10,0.03);
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  cursor: pointer;
}
.accordion-btn:hover { background: rgba(10,10,10,0.07); border-color: rgba(10,10,10,0.45); }
.accordion-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(10,10,10,0.55);
}
/* +/- toggle inside accordion buttons */
.accordion-btn { position: relative; }
.accordion-icon {
  display: block;
  transition: opacity 160ms ease;
}
.accordion-icon--minus { display: none; }
.accordion-btn[aria-expanded="true"] .accordion-icon--plus { display: none; }
.accordion-btn[aria-expanded="true"] .accordion-icon--minus { display: block; }

.accordion-pill {
  width: auto;
  height: auto;
  padding: 0.85rem 1.1rem;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 999px;
  display: flex;
  width: 100%;
  text-align: left;
}
.accordion-pill .pill-title {
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Accordion panel */
.accordion-panel[hidden], .accordion-panel.hidden { display: none; }

/* Row-level accordion panel: sits below a sketch-row as its own row,
   with a hand-drawn box aligned under the 1/3 subcard column. */
.sketch-row-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.accordion-row-panel {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 2fr auto 1fr;
  align-items: start;
}
section.section-tight { padding-top: 0.5rem !important; }
.accordion-row-panel--left {
  grid-template-columns: 1fr auto 2fr;
}
.accordion-row-panel-box {
  grid-column: 1 / -1;
  position: relative;
  padding: 2.25rem 2.5rem;
  min-height: 12rem;
  background: #fdf6d8;
}
.accordion-row-panel-box::before,
.accordion-row-panel-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.accordion-row-panel-box::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'><path d='M 8 6 C 70 4, 140 9, 210 5 C 280 3, 340 8, 392 6 C 395 40, 391 80, 394 120 C 396 150, 392 175, 393 194 C 330 196, 260 191, 190 195 C 120 197, 60 192, 7 194 C 5 160, 9 120, 6 80 C 4 50, 8 25, 8 6 Z' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' stroke-dasharray='7 5' vector-effect='non-scaling-stroke'/></svg>");
}
@media (min-width: 769px) {
  .accordion-row-panel { grid-template-columns: 3fr 5fr; }
  .accordion-row-panel--left { grid-template-columns: 5fr 3fr; }
  .accordion-row-panel--right .accordion-row-panel-box { grid-column: 2 / 3; }
  .accordion-row-panel--left  .accordion-row-panel-box { grid-column: 1 / 2; }
}

/* Color match each panel to its subcard — lighter/less vibrant tint */
#fe-panel  .accordion-row-panel-box { background: #eff9ee; }
#pen-panel .accordion-row-panel-box { background: #fdf9e6; }
#es-panel  .accordion-row-panel-box { background: #f3ecfa; }
#cre-panel .accordion-row-panel-box { background: #fdf0e2; }

.accordion-row-panel-box .sketch-card-body { margin: 0; }
.sketch-panel-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sketch-panel-list li {
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.55;
  color: #1a1a1a;
}
.sketch-panel-list li::before {
  content: "·";
  position: absolute;
  left: 0.25rem;
  top: -0.15rem;
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1;
}
.sketch-panel-list li strong { font-weight: 600; }

/* Hide the following swirvy connector when a row-panel is open */
.swirvy-connector.swirvy-hidden {
  visibility: hidden;
  height: 0;
  margin: 0;
}

/* Penediment inset quotes */
.penediment-inset .quote { background: rgba(252,211,77,0.10); border-left-color: rgba(180,83,9,0.55); }

/* ------ Motifs ------ */
.motif {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 1rem;
  border: 1px dashed var(--border);
  background:
    radial-gradient(80% 60% at 50% 50%, rgba(10,10,10,0.02), transparent 70%);
}
.motif-graphic {
  width: clamp(130px, 30vw, 180px);
  height: clamp(130px, 30vw, 180px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.motif-graphic svg { width: 100%; height: 100%; }
.motif-heart { filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.40)); }
.motif-flame { filter: drop-shadow(0 0 22px rgba(245, 158, 11, 0.40)); }

.motif-label {
  margin-top: 1rem;
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-strong);
}
.motif-caption {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}
@keyframes flameFlicker {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  30%      { transform: translateY(-2px) scale(1.02); opacity: 0.95; }
  60%      { transform: translateY(0) scale(0.99); opacity: 1; }
}
.motif-heart svg { animation: heartPulse 3.4s ease-in-out infinite; transform-origin: center; }
.motif-flame svg { animation: flameFlicker 2.8s ease-in-out infinite; transform-origin: center 70%; }

/* ------ Regne panel ------ */
.regne-panel {
  position: relative;
  padding: 2.5rem 2rem;
  border-radius: 1.25rem;
  background:
    radial-gradient(90% 60% at 50% 10%, rgba(253, 230, 138, 0.2), transparent 60%),
    linear-gradient(180deg, #fffaeb 0%, #fef3c7 60%, #fef9e7 100%);
  overflow: hidden;
  border: 1px solid rgba(161,98,7,0.25);
}
@media (min-width: 768px) {
  .regne-panel { padding: 3.5rem 3rem; }
}
.regne-border {
  position: absolute;
  inset: 0.5rem;
  width: calc(100% - 1rem);
  height: calc(100% - 1rem);
  pointer-events: none;
  color: rgba(161, 98, 7, 0.65);
}
.regne-inner { position: relative; z-index: 1; }
.regne-overline {
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #92400e;
}
.regne-note {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 16rem;
  text-align: right;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #78350f;
}
@media (max-width: 640px) {
  .regne-note { position: static; text-align: left; max-width: none; margin-top: 0.5rem; }
}
.regne-h1, .regne-h2, .regne-h3 {
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #451a03;
  line-height: 1.05;
  margin-top: 1rem;
}
.regne-h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-top: 1.75rem; color: #0a0a0a; }
.regne-h2 { font-size: clamp(1.75rem, 4.2vw, 2.75rem); color: #92400e; }
.regne-h3 { font-size: clamp(1.5rem, 3.6vw, 2.25rem); color: #78350f; }

.regne-panel .subblock { border-top-color: rgba(161,98,7,0.25); }
.regne-panel .sub-h { color: #451a03; }
.regne-panel .subblock p { color: #3f2a07; }
.regne-panel .subblock .ref { color: #78350f; }

.quote-regne {
  background: rgba(255,255,255,0.45);
  border-left-color: rgba(161,98,7,0.55);
}
.quote-regne blockquote { color: #3f2a07; }
.quote-regne figcaption { color: #78350f; }

/* ------ Obediència block ------ */
.obediencia-block {
  margin-top: 3rem;
  padding: 2rem;
  border-top: 2px solid rgba(161,98,7,0.35);
}
.obediencia-h {
  font-family: Switzer, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-top: 0.6rem;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent-gold);
  text-underline-offset: 10px;
  display: inline-block;
}
.obediencia-lead {
  margin-top: 1rem;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 60ch;
}

/* ------ Reveal ------ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------ Nav active ------ */
.nav-link[data-active='true'] {
  color: var(--text-strong);
  background: rgba(10,10,10,0.06);
  border-color: rgba(10,10,10,0.2);
}

/* ------ Screen reader only ------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------ Focus visible default for links/buttons ------ */
a:focus-visible, button:focus-visible {
  outline: none;
}

/* ------ Reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .motif-heart svg, .motif-flame svg { animation: none; }
  * { scroll-behavior: auto !important; }
  .accordion-btn svg { transition: none; }
}

/* =====================================================
   SKETCH / WIREFRAME STYLES
   Hand-drawn look matching the paper wireframe.
   ===================================================== */

.font-hand {
  font-family: 'Kalam', 'Caveat', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* Cleaner paper-like background (tone down the gradients) */
.app-bg {
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(10,10,10,0.02), transparent 70%),
    linear-gradient(180deg, #fdfcf7 0%, #faf8f1 100%);
}

/* Sketch card — hand-drawn pencil border via SVG, no shadow, no gradient fills */
.sketch-card {
  position: relative;
  background: #fffefa;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 2rem 2.25rem;
}
@media (min-width: 640px) {
  .sketch-card { padding: 2.5rem 2.75rem; }
}

.sketch-card-body strong { font-weight: 500; }

/* Wobbly hand-drawn rectangle border (single stroke, organic path) */
.sketch-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'><path d='M 8 6 C 70 4, 140 9, 210 5 C 280 3, 340 8, 392 6 C 395 40, 391 80, 394 120 C 396 150, 392 175, 393 194 C 330 196, 260 191, 190 195 C 120 197, 60 192, 7 194 C 5 160, 9 120, 6 80 C 4 50, 8 25, 8 6 Z' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
/* Subtle second stroke for double-line pencil effect */
.sketch-card::after {
  content: '';
  position: absolute;
  inset: 4px;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'><path d='M 6 10 C 80 8, 150 12, 220 7 C 290 4, 350 10, 394 8 C 393 50, 396 90, 392 130 C 390 160, 394 180, 392 192 C 320 194, 250 189, 180 193 C 110 196, 50 190, 8 192 C 10 150, 6 110, 9 70 C 11 45, 7 22, 6 10 Z' fill='none' stroke='%231a1a1a' stroke-width='0.9' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke' opacity='0.45'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.sketch-card-h {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1;
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.sketch-card-body {
  font-size: clamp(1.125rem, 1.6vw, 1.35rem);
  line-height: 1.5;
  color: #1a1a1a;
  margin: 1rem 0 0;
  max-width: 48rem;
}

.sketch-card-body--lead {
  margin-top: 0;
}

#s-creu .sketch-card > .sketch-card-body {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

#s-creu > div > .sketch-card::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900' preserveAspectRatio='none'><path d='M 14 14 C 200 2, 420 20, 620 6 C 820 -2, 1020 18, 1188 4 C 1194 180, 1180 360, 1192 540 C 1200 720, 1184 846, 1189 896 C 980 902, 760 886, 540 896 C 320 906, 140 888, 12 898 C 4 720, 18 540, 6 360 C -2 180, 10 46, 14 14 Z' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>");
}
#s-creu > div > .sketch-card::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900' preserveAspectRatio='none'><path d='M 20 16 C 180 8, 440 20, 600 14 C 840 4, 1000 24, 1184 10 C 1192 180, 1174 360, 1190 540 C 1194 720, 1182 840, 1185 890 C 960 896, 780 880, 520 890 C 340 900, 120 886, 16 892 C 10 720, 20 540, 8 360 C 4 180, 12 52, 20 16 Z' fill='none' stroke='%231a1a1a' stroke-width='0.9' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke' opacity='0.45'/></svg>");
}

#s-creu .sketch-card > .sketch-subcard--nested {
  max-width: 48rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding: 2.25rem 2.75rem;
}
#s-creu .sketch-card > .sketch-subcard--nested::before {
  inset: 10px 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 100' preserveAspectRatio='none'><path d='M 6 5 L 350 4 L 694 5 L 695 50 L 694 95 L 350 96 L 6 95 L 5 50 Z' fill='none' stroke='%231a1a1a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' stroke-dasharray='7 5' vector-effect='non-scaling-stroke'/></svg>");
}

#s-creu .sketch-card > .sketch-card-body:last-of-type {
  margin-bottom: 1rem;
}

.sketch-card-h--inline {
  display: inline;
  margin-right: 0.4em;
  vertical-align: baseline;
  line-height: 1;
}

.sketch-ref {
  color: #2563eb;
  text-decoration: none;
  margin-left: 0.1em;
}
.sketch-ref:hover,
.sketch-ref:focus-visible {
  text-decoration: underline;
}
.sketch-ref sup {
  font-size: 0.55em;
  color: #2563eb;
}

.sketch-subcard {
  padding: 0.85rem 1.1rem;
  max-width: 22rem;
  background: #fdf6d8;
}
.sketch-subcard-num {
  position: absolute;
  top: 1.75rem;
  left: 2rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent-amber);
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><g fill='none' stroke='%231a1a1a' stroke-linecap='round' stroke-linejoin='round'><path d='M 21 4 C 28 3.6, 35.6 8.4, 36.8 16.4 C 38.2 25, 33 33, 24.5 35.4 C 15.5 38, 6 33.4, 4.2 24.8 C 2.6 16.6, 8.2 7.8, 16.6 4.8 C 18 4.3, 19.5 4.1, 21 4' stroke-width='2'/><path d='M 19 5.5 C 12 7, 6.4 12.5, 5.6 19.5 C 4.6 27.8, 11 34.6, 19.4 35.8 C 28.2 37, 35.8 31, 36.6 23 C 37.2 16.5, 33 10, 26.8 7' stroke-width='1.3' opacity='0.75'/></g></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.sketch-subcard--clickable {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.sketch-subcard--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(10,10,10,0.35);
}

/* Fe — soft pastel green, same tone/saturation as Penediment's yellow */
.sketch-subcard[aria-labelledby="h-fe"] {
  background: #dff3de;
}

/* Bateig — soft pastel blue, same tone/saturation as Penediment's yellow */
.sketch-subcard[aria-labelledby="h-bat"] {
  background: #dce9f7;
}

/* Esperit Sant — soft pastel purple */
.sketch-subcard[aria-labelledby="h-es"] {
  background: #e7dcf5;
}

/* Crèixer — soft pastel orange */
.sketch-subcard[aria-labelledby="h-cre"] {
  background: #fbe4cf;
}

/* Subcards that use only the thicker border — hide the skinny inner one */
.sketch-subcard[aria-labelledby="h-fe"]::after,
.sketch-subcard[aria-labelledby="h-pen"]::after,
.sketch-subcard[aria-labelledby="h-bat"]::after,
.sketch-subcard[aria-labelledby="h-es"]::after,
.sketch-subcard[aria-labelledby="h-cre"]::after {
  display: none;
}

.sketch-subcard--stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 1.75rem;
}

/* Full-width subcard: same dashed-border treatment but spans the row (e.g. Crèixer) */
.sketch-subcard--full {
  max-width: none;
}

.sketch-subcard-h--center {
  text-align: center;
}

.sketch-sprout {
  width: clamp(4.5rem, 8vw, 6rem);
  height: auto;
  display: block;
}

.sketch-undo {
  width: clamp(4.5rem, 8vw, 6rem);
  height: auto;
  display: block;
}

.sketch-pool {
  width: clamp(4.5rem, 8vw, 6rem);
  height: auto;
  display: block;
}

.sketch-fire {
  width: clamp(4.5rem, 8vw, 6rem);
  height: auto;
  display: block;
}

.sketch-parent {
  width: clamp(5rem, 10vw, 7rem);
  height: auto;
  display: block;
}

/* Bigger parent+child sketch for the full-width Crèixer row */
.sketch-parent--big {
  width: clamp(8rem, 18vw, 14rem);
}

/* Crèixer full-width layout: sketch on the left, wavy text block on the right */
.creixer-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 768px) {
  .creixer-layout { grid-template-columns: 1fr; gap: 1.25rem; }
}
.creixer-text { margin-top: 0; }

.sketch-chevron--center {
  margin: 0 auto;
}

/* Dashed hand-drawn border for subcards (Fe, Penediment, Bateig, Esperit Sant, Crèixer) */
.sketch-subcard::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'><path d='M 8 6 C 70 4, 140 9, 210 5 C 280 3, 340 8, 392 6 C 395 40, 391 80, 394 120 C 396 150, 392 175, 393 194 C 330 196, 260 191, 190 195 C 120 197, 60 192, 7 194 C 5 160, 9 120, 6 80 C 4 50, 8 25, 8 6 Z' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' stroke-dasharray='7 5' vector-effect='non-scaling-stroke'/></svg>");
}
.sketch-subcard::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'><path d='M 6 10 C 80 8, 150 12, 220 7 C 290 4, 350 10, 394 8 C 393 50, 396 90, 392 130 C 390 160, 394 180, 392 192 C 320 194, 250 189, 180 193 C 110 196, 50 190, 8 192 C 10 150, 6 110, 9 70 C 11 45, 7 22, 6 10 Z' fill='none' stroke='%231a1a1a' stroke-width='0.9' stroke-linecap='round' stroke-linejoin='round' stroke-dasharray='5 4' vector-effect='non-scaling-stroke' opacity='0.45'/></svg>");
}

.sketch-eyebrow {
  font-size: 0.8rem;
  color: rgba(26, 26, 26, 0.65);
  margin: 0 0 0.15rem 0;
  line-height: 1;
}

/* Nosaltres internal layout: wavy text (left) + nested Penediment (right) */
.nosaltres-layout {
  display: grid;
  grid-template-columns: 2fr minmax(14rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .nosaltres-layout { grid-template-columns: 1fr; }
}

/* Sub-card variant when nested inside another sketch-card */
.sketch-subcard--nested {
  max-width: none;
  align-self: start;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
/* When a subcard is nested inside a main card, lay its title/icon/+ out
   horizontally so it doesn't eat vertical space. Title left, icon centered,
   + on the right. The accordion panel (if any) still drops below as its own
   row via flex-basis: 100%. */
.sketch-subcard--nested.sketch-subcard--stacked {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 2rem;
}
.sketch-subcard--nested.sketch-subcard--stacked > .sketch-subcard-h {
  text-align: left;
  justify-self: start;
}
.sketch-subcard--nested.sketch-subcard--stacked > svg {
  width: clamp(3rem, 6vw, 4.5rem);
  justify-self: center;
  flex-shrink: 0;
}
.sketch-subcard--nested.sketch-subcard--stacked > .sketch-chevron {
  margin: 0;
  justify-self: end;
}
.sketch-subcard--nested.sketch-subcard--stacked > .accordion-panel {
  grid-column: 1 / -1;
}
/* The default dashed border is drawn for a ~2:1 card. A nested horizontal row
   is more like 10:1, so stretching that path produces long lazy arcs on top
   and bottom. Swap in a wide-aspect path so the wobble stays proportional. */
.sketch-subcard--nested.sketch-subcard--stacked::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'><path d='M 10 8 C 120 5, 260 11, 400 7 C 540 4, 680 10, 820 6 C 900 5, 970 8, 992 7 C 993 25, 990 50, 994 72 C 996 85, 992 95, 993 96 C 880 97, 740 93, 600 97 C 460 99, 320 94, 180 97 C 100 98, 40 95, 8 96 C 6 75, 10 50, 7 28 C 5 18, 9 12, 10 8 Z' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' stroke-dasharray='7 5' vector-effect='non-scaling-stroke'/></svg>");
}

/* Creu row: main card on the left, Bateig/Esperit Sant column on the right */
.creu-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: stretch;
}
.creu-subcards-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.creu-subcards-col > .sketch-subcard { flex: 1; }
@media (max-width: 768px) {
  .creu-row { grid-template-columns: 1fr; gap: 2.5rem; }
  .creu-subcards-col { gap: 1rem; }
}

/* Sub-cards row: Bateig+Esperit Sant stacked (1/3) | Crèixer (2/3) with a gap */
.subcards-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2.5rem;
  align-items: stretch;
}
.subcards-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sketch-subcard--row {
  max-width: none;
  align-self: stretch;
  justify-self: stretch;
}
@media (max-width: 768px) {
  .subcards-row { grid-template-columns: 1fr; gap: 1rem; }
}

.sketch-subcard-h {
  font-size: 1.4rem;
  line-height: 1;
  color: #1a1a1a;
  margin: 0;
}

/* Cluster: main card on top, dashed connector, sub-card below */
.sketch-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.sketch-cluster > .sketch-card:first-child { width: 100%; max-width: 64rem; }

.dashed-connector {
  width: 0;
  height: 2.25rem;
  border-left: 2px dashed rgba(26, 26, 26, 0.55);
  margin: 0.25rem 0;
}

/* Swirvy dashed connector between main narrative cards (Déu → Nosaltres → Creu → Judici → Regne) */
.swirvy-connector {
  display: block;
  width: 100%;
  max-width: 72rem;
  height: 6rem;
  margin: -0.25rem auto -2.75rem;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.swirvy-connector .swirvy-line {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
@media (max-width: 640px) {
  .swirvy-connector { height: 4.5rem; margin: -0.25rem auto -2.5rem; }
}

/* Horizontal row: main card (2/3) ←dashed→ sub-card (1/3) */
.sketch-row {
  display: grid;
  grid-template-columns: 2fr auto 1fr;
  align-items: stretch;
  gap: 0;
}
/* Reversed sketch-row: side card on the left, main card on the right */
.sketch-row.sketch-row--reverse {
  grid-template-columns: 1fr auto 2fr;
}
.sketch-row-main { min-width: 0; max-width: none; }
.sketch-row-side {
  min-width: 0;
  max-width: none;
  align-self: stretch;
  justify-self: stretch;
}
.dashed-connector--h {
  height: 0.5rem;
  width: 2.5rem;
  border: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 8' preserveAspectRatio='none'><path d='M 2 4 C 6 3, 10 5, 14 4 M 22 4 C 26 3, 30 5, 34 4 M 42 4 C 46 3, 50 5, 54 4 M 62 4 C 66 3, 70 5, 74 4' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin: 0;
  align-self: center;
  justify-self: stretch;
}
@media (max-width: 768px) {
  .sketch-row {
    grid-template-columns: 2fr auto 1fr;
    gap: 0;
  }
  .sketch-row.sketch-row--reverse {
    grid-template-columns: 1fr auto 2fr;
  }
  .dashed-connector--h {
    width: 0.5rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 80' preserveAspectRatio='none'><path d='M 4 2 C 3 6, 5 10, 4 14 M 4 22 C 3 26, 5 30, 4 34 M 4 42 C 3 46, 5 50, 4 54 M 4 62 C 3 66, 5 70, 4 74' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round'/></svg>");
    margin: 0;
  }
}

/* The little X-square icon-box from the sketch — hand-drawn square with diagonals */
.sketch-icon-box {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  position: relative;
  flex: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 2 3 C 8 2, 16 3, 22 2 C 22 8, 21 16, 22 22 C 16 22, 8 21, 2 22 C 3 16, 2 8, 2 3 Z M 3 3 L 22 22 M 22 3 L 3 22' fill='none' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  vertical-align: middle;
}

/* Sub-card toggle — bare +/- with no circle */
.sketch-chevron {
  width: 2rem;
  height: 2rem;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  border-radius: 0;
  color: #1a1a1a;
}
.sketch-chevron:hover { color: #000; }

/* WAVY-LINE placeholder — single hand-drawn squiggle */
.wavy-line {
  width: 100%;
  height: 0.7rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'><path d='M0 4 Q 10 0 20 4 T 40 4 T 60 4 T 80 4 T 100 4 T 120 4 T 140 4 T 160 4 T 180 4 T 200 4' fill='none' stroke='%231a1a1a' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.78;
}
.wavy-medium { width: 75%; }
.wavy-short  { width: 45%; }

.wavy-stack {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Vary line widths organically per nth-child */
.wavy-stack .wavy-line:nth-child(3n+1) { width: 96%; }
.wavy-stack .wavy-line:nth-child(3n+2) { width: 88%; }
.wavy-stack .wavy-line:nth-child(3n+3) { width: 92%; }
.wavy-stack .wavy-line.wavy-medium { width: 72%; }
.wavy-stack .wavy-line.wavy-short  { width: 42%; }

/* Creu equation: cross = heart */
.creu-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: #1a1a1a;
}
.creu-equation-cross svg {
  height: 8rem;
  width: 8rem;
  display: block;
}
.creu-equation-sign {
  font-size: 3rem;
  line-height: 1;
  color: #1a1a1a;
}
.creu-equation-heart {
  width: clamp(120px, 18vw, 180px);
  color: #d94a3d;
}
.creu-equation-heart svg { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) {
  .creu-equation { gap: 0.75rem; }
  .creu-equation-cross svg { height: 5.5rem; width: 5.5rem; }
  .creu-equation-sign { font-size: 2.25rem; }
  .creu-equation-heart { width: clamp(90px, 22vw, 130px); }
}

/* Tighter section spacing for the wireframe rhythm */
.section-wrap { padding-top: 2.5rem; }
@media (min-width: 768px) { .section-wrap { padding-top: 3rem; } }

/* Header tweaks for sketch nav */
.nav-link { font-family: 'Kalam', ui-sans-serif, system-ui, sans-serif; }
.nav-link[data-active='true'],
.nav-filter[aria-pressed='true'] {
  border-color: rgba(26,26,26,0.55);
  background: transparent;
  border-style: dashed;
}
.nav-filter { cursor: pointer; }
.nav-filter[aria-pressed='true'] { color: #0a0a0a; }

/* Nav filter: fade the "other half" when one of the two filter buttons is pressed.
   saber → dim the 5 supporting subcards (Fe, Penediment, Bateig, Esperit Sant, Crèixer).
   fer   → dim the 5 main narrative cards (Déu, Nosaltres, Creu, Judici, Regne) and the swirvy connectors between them, while expanding all subcard accordions.
   Note: opacity on a parent forces all descendants to render with that alpha,
   so we can't simply fade the Creu <article> (which now contains the nested
   Bateig subcard). Instead we fade Creu's own border pseudos + its direct
   children, but exclude the nested subcard. */
.card.sketch-card,
.swirvy-connector {
  transition: opacity 0.35s ease;
}
body.nav-filter-saber .sketch-subcard,
body.nav-filter-fer .swirvy-connector {
  opacity: 0.18;
  pointer-events: none;
}
/* Déu, Nosaltres, Judici, Regne — fade the whole card */
body.nav-filter-fer #s-deu .card.sketch-card:not(.sketch-subcard),
body.nav-filter-fer #s-nosaltres .card.sketch-card:not(.sketch-subcard),
body.nav-filter-fer #s-judici .card.sketch-card:not(.sketch-subcard),
body.nav-filter-fer #s-regne .card.sketch-card:not(.sketch-subcard) {
  opacity: 0.18;
  pointer-events: none;
}
/* Creu card contains nested Bateig — fade only its own content + hand-drawn border, leave Bateig clear */
body.nav-filter-fer #s-creu > div > article > :not(.sketch-subcard) {
  opacity: 0.18;
  transition: opacity 0.35s ease;
}
body.nav-filter-fer #s-creu > div > article::before,
body.nav-filter-fer #s-creu > div > article::after {
  opacity: 0.18;
  transition: opacity 0.35s ease;
}
body.nav-filter-fer #s-creu > div > article {
  pointer-events: none;
}
body.nav-filter-fer #s-creu > div > article > .sketch-subcard {
  pointer-events: auto;
}
