/* =========================================================
   IYAC Bulgaria — "Shevitsa" design system
   Crimson on linen. Embroidery as an accent, depth and
   spring-based motion everywhere else.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --linen: #F2ECE3;
  --linen-2: #E9E1D5;
  --paper: #FBF8F3;
  --red: #8A0019;          /* IYAC logo crimson */
  --red-hover: #A10A26;
  --red-deep: #5C0011;
  --gold: #F0A018;          /* IYAC logo swirl */
  --gold-hover: #F7B23A;
  --ink: #231A18;
  --ink-2: #5E504A;
  --ink-3: #7C6D66;
  --line: rgba(35, 26, 24, 0.1);
  --line-red: rgba(138, 0, 25, 0.2);

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius: 20px;
  --radius-lg: 28px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --section-y: clamp(5.5rem, 12vw, 9.5rem);
  --nav-h: 64px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);

  --weave:
    repeating-linear-gradient(0deg, rgba(110, 80, 50, 0.03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(110, 80, 50, 0.03) 0 1px, transparent 1px 4px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background-color: var(--linen); background-image: var(--weave);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: var(--section-y); }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 300;
  padding: 10px 16px; border-radius: 999px; background: var(--red); color: var(--paper); font-weight: 600;
  transform: translateY(-150%); transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }
.sr-only, .js .stitch-fallback {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Photos fill their frames; focal point is swappable */
.hoop__fabric img, .zoom__img, .collage__item img {
  width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%);
}

/* ---------- Stitches (accent only) ---------- */
.stitch { display: inline-block; line-height: 0; color: var(--red); }
.stitch svg { display: block; width: 100%; height: auto; overflow: visible; }
.stitch path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.stitch.is-sewn path { animation: sew 0.2s var(--d, 0s) cubic-bezier(0.3, 0.7, 0.4, 1) forwards; }
.stitch.is-static path { stroke-dashoffset: 0; animation: none; }
html:not(.js) .stitch { display: none; }
@keyframes sew { to { stroke-dashoffset: 0; } }

/* ---------- Text motion ---------- */
/* Words rise out of a mask */
.mw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.mw > span { display: inline-block; transform: translateY(108%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms); }
.is-in .mw > span { transform: none; }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--red); }
.display-2 {
  font-size: clamp(2.2rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -0.035em;
  font-weight: 700; font-stretch: 86%; text-wrap: balance;
}
.intro {
  margin-top: 18px; max-width: 22ch;
  font-size: clamp(1.75rem, 4vw, 3.1rem); line-height: 1.06; letter-spacing: -0.03em;
  font-weight: 650; font-stretch: 88%; text-wrap: balance;
}
.lede {
  max-width: 34ch;
  font-size: clamp(1.4rem, 2.6vw, 2.15rem); line-height: 1.32; letter-spacing: -0.02em;
  font-weight: 550; color: var(--ink);
}
.section-head { position: relative; z-index: 1; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section-head__sub {
  margin-top: 16px;
  font-size: clamp(2rem, 5vw, 3.9rem); line-height: 1.02; letter-spacing: -0.035em;
  font-weight: 700; font-stretch: 86%; text-wrap: balance;
}
.section-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.95rem; --pad-x: 1.55rem;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  padding: var(--pad-y) var(--pad-x); border-radius: 999px;
  font-weight: 600; font-size: 1rem; letter-spacing: -0.005em; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform 0.5s var(--ease-spring), background-color 0.25s ease, color 0.25s ease, box-shadow 0.35s ease, scale 0.15s ease-out;
}
/* Press feedback on its own property so it never fights the magnetic pull */
.btn:active { scale: 0.96; }
.btn i { line-height: 0; transition: transform 0.45s var(--ease-spring); }
.btn:hover i.bi-arrow-down { transform: translateY(3px); }
.btn:hover i.bi-arrow-up-right { transform: translate(2px, -2px); }
.btn--red { background: var(--red); color: var(--paper); box-shadow: 0 10px 24px -12px rgba(92, 0, 17, 0.7); }
.btn--red:hover { background: var(--red-hover); box-shadow: 0 16px 30px -12px rgba(92, 0, 17, 0.7); }
.btn--linen { background: var(--paper); color: var(--red); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35); }
.btn--sm { --pad-y: 0.55rem; --pad-x: 1.1rem; font-size: 0.875rem; }
.btn--lg { --pad-y: 1.1rem; --pad-x: 1.9rem; font-size: 1.0625rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--paper); color: var(--red); font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px var(--line-red);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.45s var(--ease-spring), background-color 0.2s ease, color 0.2s ease, opacity 0.3s ease;
}
.icon-btn:hover { background: var(--red); color: var(--paper); }
.icon-btn:active { transform: scale(0.9); transition-duration: 0.1s; }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: var(--paper); color: var(--red); }
.icon-btn--sm { width: 40px; height: 40px; font-size: 1rem; }
.icon-btn--linen { background: rgba(251, 248, 243, 0.08); color: var(--paper); box-shadow: inset 0 0 0 1px rgba(251, 248, 243, 0.3); }
.icon-btn--linen:hover { background: var(--paper); color: var(--red-deep); }

/* ---------- Navigation (frosted linen) ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; padding-top: env(safe-area-inset-top); transition: background-color 0.35s ease, box-shadow 0.35s ease; }
.nav.is-scrolled, .nav.is-open {
  background: rgba(242, 236, 227, 0.72);
  -webkit-backdrop-filter: saturate(170%) blur(20px); backdrop-filter: saturate(170%) blur(20px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 16px; height: var(--nav-h); max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.nav__logo { display: block; width: 46px; height: 46px; transition: transform 0.45s var(--ease-spring); }
.nav__logo:hover { transform: rotate(-4deg) scale(1.04); }
.nav__logo:active { transform: scale(0.92); transition-duration: 0.1s; }
.nav__logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 4px 12px -4px rgba(92, 0, 17, 0.35); }
.nav__menu { position: relative; margin-left: auto; }
.nav__menu ul { display: flex; gap: 6px; }
.nav__menu a { position: relative; display: block; padding: 10px 14px; font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); transition: color 0.2s ease; }
.nav__menu a:hover, .nav__menu a.is-active { color: var(--red); }
.nav__seam {
  position: absolute; left: 0; bottom: 4px; height: 2px; width: 0; border-radius: 2px; background: var(--red);
  opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--ease-spring), width 0.5s var(--ease-spring), opacity 0.2s ease;
}
.only-mobile { display: none; }
.nav__progress { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; pointer-events: none; }
.nav__progress span { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--p, 0)); }
.nav__toggle { display: none; position: relative; width: 44px; height: 44px; margin-right: -8px; -webkit-tap-highlight-color: transparent; }
.nav__toggle span { position: absolute; left: 11px; width: 22px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 0.5s var(--ease-spring); }
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 767px) {
  .nav__cta, .nav__seam { display: none; }
  .nav__toggle { display: block; margin-left: auto; }
  .only-mobile { display: list-item; }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 4px var(--gutter) 28px;
    background: var(--linen); background-image: var(--weave);
    box-shadow: 0 30px 50px -20px rgba(35, 26, 24, 0.35);
    transform-origin: top right; transform: translateY(-10px); opacity: 0; visibility: hidden;
    transition: transform 0.45s var(--ease-out), opacity 0.25s ease, visibility 0s linear 0.45s;
  }
  .nav.is-open .nav__menu { transform: none; opacity: 1; visibility: visible; transition: transform 0.55s var(--ease-out), opacity 0.25s ease, visibility 0s; }
  .nav__menu ul { flex-direction: column; gap: 0; }
  .nav__menu li { border-bottom: 1px solid var(--line); }
  .nav__menu a {
    padding: 18px 0; font-size: 1.875rem; font-weight: 700; font-stretch: 88%; letter-spacing: -0.03em; color: var(--ink);
    transform: translateX(-12px); opacity: 0; transition: transform 0.55s var(--ease-spring), opacity 0.35s ease, color 0.2s;
  }
  .nav.is-open .nav__menu a { transform: none; opacity: 1; }
  .nav.is-open .nav__menu li:nth-child(2) a { transition-delay: 0.05s; }
  .nav.is-open .nav__menu li:nth-child(3) a { transition-delay: 0.1s; }
  .nav.is-open .nav__menu li:nth-child(4) a { transition-delay: 0.15s; }
  body::after { content: ""; position: fixed; inset: 0; z-index: 99; background: rgba(35, 26, 24, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
  body:has(.nav.is-open)::after { opacity: 1; pointer-events: auto; }
}

/* ---------- Language switch (EN | BG) ---------- */
.lang {
  display: inline-flex; gap: 2px; padding: 3px; margin-left: 10px; border-radius: 999px;
  background: rgba(35, 26, 24, 0.05); box-shadow: inset 0 0 0 1px var(--line);
}
.lang__opt {
  display: grid; place-items: center; min-width: 40px; height: 36px; padding: 0 10px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, background-color 0.25s ease, transform 0.45s var(--ease-spring);
}
.lang__opt:hover { color: var(--red); }
.lang__opt:active { transform: scale(0.92); transition-duration: 0.1s; }
.lang__opt.is-active { background: var(--red); color: var(--paper); box-shadow: 0 4px 10px -4px rgba(92, 0, 17, 0.5); }
@media (max-width: 767px) {
  .lang { margin-left: auto; }
  .nav .nav__toggle { margin-left: 6px; }
}

/* Bulgarian pages: a Cyrillic font with the same width axis */
:root:lang(bg) { --font: "Roboto Flex", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + clamp(28px, 6vw, 72px)) 0 clamp(64px, 9vw, 110px); }
.hero__grid { position: relative; display: grid; gap: clamp(48px, 6vw, 72px); align-items: center; }
@media (min-width: 720px) { .hero__grid { grid-template-columns: 1.05fr 1fr; } }
@media (min-width: 720px) and (max-width: 959px) {
  .hero__grid { gap: 36px; }
  .hero__tagline { font-size: 1.2rem; }
  .hoop__hint { font-size: 0.75rem; padding: 8px 12px; }
}
@media (min-width: 720px) and (max-height: 820px) and (orientation: landscape) {
  .hoop { width: min(100%, 72vh); }
}
.hero__copy { will-change: transform, opacity; }
.hero__title { display: flex; flex-direction: column; gap: 14px; }
.stitch--hero { width: min(100%, 470px); touch-action: pan-y; cursor: crosshair; }
.hero__country { font-size: clamp(3.4rem, 10vw, 6.6rem); line-height: 0.9; letter-spacing: -0.045em; font-weight: 700; font-stretch: 85%; color: var(--ink); }
.hero__tagline { max-width: 24ch; margin-top: 22px; font-size: clamp(1.3rem, 2.3vw, 1.65rem); line-height: 1.35; letter-spacing: -0.012em; color: var(--ink-2); }
.u-stitch { position: relative; color: var(--red); font-weight: 600; white-space: nowrap; }
.u-stitch svg { position: absolute; left: -2px; bottom: -0.32em; width: calc(100% + 4px); height: 0.5em; overflow: visible; }
.u-stitch path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.u-stitch.is-sewn path { transition: stroke-dashoffset 1.1s cubic-bezier(0.5, 0, 0.2, 1); stroke-dashoffset: 0; }
.hero__actions { margin-top: clamp(28px, 4vw, 40px); }

/* Embroidery hoop */
.hoop { position: relative; width: min(100%, 560px); margin-inline: auto; aspect-ratio: 1; will-change: transform; }
.hoop__fabric {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: var(--paper);
  box-shadow: 0 0 0 10px var(--red), 0 0 0 13px var(--red-deep), 0 0 0 16px var(--red), 0 50px 80px -30px rgba(92, 0, 17, 0.55);
  touch-action: pan-y;
}
.hoop__fabric img, .hoop__stitches { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (hover: hover) and (pointer: fine) { .hoop__stitches { cursor: none; } }
.hoop__brush {
  position: absolute; z-index: 3; top: 0; left: 0;
  width: var(--bs, 120px); height: var(--bs, 120px);
  margin: calc(var(--bs, 120px) / -2) 0 0 calc(var(--bs, 120px) / -2);
  border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 1.5px var(--red), 0 6px 20px rgba(92, 0, 17, 0.25);
  opacity: 0; scale: 0.6;
  transition: opacity 0.25s ease, scale 0.4s var(--ease-spring);
}
.hoop.is-brushing .hoop__brush { opacity: 1; scale: 1; }
.hoop__clasp {
  position: absolute; top: -34px; left: 50%; width: 44px; height: 30px; margin-left: -22px;
  border-radius: 6px 6px 3px 3px; background: var(--red-deep); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}
.hoop__clasp::before { content: ""; position: absolute; top: -12px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--red); box-shadow: inset 0 0 0 4px var(--red-deep); }
.hoop__hint {
  position: absolute; z-index: 4; left: 50%; bottom: -16px; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; background: var(--paper); color: var(--red);
  box-shadow: 0 10px 24px -12px rgba(92, 0, 17, 0.5), inset 0 0 0 1px var(--line-red);
  font-size: 0.8125rem; font-weight: 600;
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out);
}
.hoop.is-unstitched .hoop__hint { opacity: 0; transform: translateY(8px); }
.no-stitchfx .hoop__stitches, .no-stitchfx .hoop__hint, .no-stitchfx .hoop__brush { display: none; }

/* ---------- Folk band ---------- */
.band { position: relative; height: 72px; background: var(--red); overflow: hidden; color: var(--paper); }
.band__track { position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% + 240px); background-repeat: repeat-x; background-position: 0 50%; will-change: transform; }

/* ---------- Numbers ---------- */
.stats { padding-block: clamp(4rem, 10vw, 8rem); background: var(--paper); overflow: clip; }
.stats__grid { display: flex; justify-content: center; }
.stat { display: grid; gap: 14px; justify-items: center; align-items: center; }
.stat__num {
  grid-row: 2; color: var(--red);
  font-size: clamp(4.5rem, 13vw, 10rem); font-weight: 700; font-stretch: 80%; line-height: 0.9; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat__label { grid-row: 3; font-size: clamp(0.8125rem, 1.3vw, 0.9375rem); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.stat__label:first-child { grid-row: 1; }
.odo { display: inline-flex; align-items: flex-start; overflow: hidden; height: 0.9em; vertical-align: top; }
.odo__col { display: flex; flex-direction: column; will-change: transform; }
.odo__col span { display: block; height: 0.9em; line-height: 0.9; }

/* ---------- Values ---------- */
.values__grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .values__grid { grid-template-columns: repeat(3, 1fr); align-items: start; } }
@media (min-width: 600px) and (max-width: 899px) {
  .vcard { display: grid; grid-template-columns: 64px 1fr; column-gap: 28px; align-items: start; }
  .vcard__icon { grid-row: span 2; margin: 4px 0 0; }
}
.vcard {
  position: relative; padding: clamp(28px, 3.4vw, 40px);
  border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -40px rgba(35, 26, 24, 0.35);
  transition: box-shadow 0.4s ease;
}
@media (hover: hover) { .vcard:hover { box-shadow: 0 1px 0 var(--line), 0 40px 70px -36px rgba(92, 0, 17, 0.4); } }
.vcard__icon { width: 60px; margin-bottom: 26px; }
.vcard h3 { font-size: clamp(1.35rem, 1.9vw, 1.6rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; font-stretch: 92%; margin-bottom: 14px; text-wrap: balance; }
.vcard p { color: var(--ink-2); font-size: 1rem; line-height: 1.65; }

/* ---------- About: photo zoom-through ---------- */
.about { overflow: clip; }
.zoom { position: relative; padding-inline: var(--gutter); }
.zoom__stage { position: relative; max-width: var(--maxw); margin-inline: auto; }
.zoom__frame { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); background: var(--linen-2); }
.zoom__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(35, 8, 12, 0) 35%, rgba(35, 8, 12, 0.8) 100%); opacity: 0; }
.zoom__caption { padding-top: 28px; }
.zoom__kicker { display: none; }

.has-scrollfx .zoom { height: 230vh; padding: 0; }
.has-scrollfx .zoom__stage { position: sticky; top: 0; height: 100vh; height: 100svh; max-width: none; }
.has-scrollfx .zoom__frame { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; will-change: clip-path; }
.has-scrollfx .zoom__img { will-change: transform; }
.has-scrollfx .zoom__caption { position: absolute; left: 0; right: 0; bottom: clamp(40px, 10vh, 110px); padding: 0; color: var(--paper); }
.has-scrollfx .zoom__caption .display-2 { max-width: 15ch; }
.has-scrollfx .zoom__kicker { display: block; margin-bottom: 14px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(251, 248, 243, 0.8); }

.about__story { margin-top: var(--section-y); display: grid; gap: clamp(40px, 6vw, 64px); }
.checks { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .checks { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) and (max-width: 959px) { .checks li { padding: 22px; font-size: 1rem; } }
.checks li {
  display: flex; flex-direction: column; gap: 18px; padding: 26px;
  border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 1px 0 var(--line);
  font-weight: 600; font-size: 1.0625rem; line-height: 1.45;
}
.checks__i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: var(--paper); font-size: 1.2rem; }

/* ---------- Projects: patches on a washing line ---------- */
.projects { overflow: clip; }
.carousel { position: relative; z-index: 1; }
.carousel__viewport { position: relative; overflow: hidden; padding: 30px 0 52px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.carousel.is-dragging .carousel__viewport { cursor: grabbing; }
.carousel__cord {
  position: absolute; left: 0; right: 0; top: 22px; height: 3px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--red) 0 4px, var(--red-deep) 4px 8px);
  box-shadow: 0 2px 3px rgba(35, 26, 24, 0.15);
}
.carousel__track { position: relative; display: flex; align-items: flex-start; gap: clamp(18px, 2.4vw, 30px); width: max-content; padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); will-change: transform; }
.patch { position: relative; flex: none; width: clamp(250px, 72vw, 330px); transform-origin: 50% -14px; transform: rotate(var(--swing, 0deg)); will-change: transform; }
.patch__peg { position: absolute; z-index: 2; top: -18px; left: 50%; width: 14px; height: 34px; margin-left: -7px; border-radius: 4px; background: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(35, 26, 24, 0.2), 0 3px 6px rgba(35, 26, 24, 0.2); }
.patch__peg::after { content: ""; position: absolute; left: 3px; right: 3px; top: 15px; height: 4px; border-radius: 2px; background: var(--red); }
.patch__link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--paper); border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 44px -28px rgba(35, 26, 24, 0.55), 0 1px 0 rgba(35, 26, 24, 0.06);
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  transition: transform 0.5s var(--ease-spring), box-shadow 0.4s ease;
}
.patch__link:active { transform: scale(0.97); transition-duration: 0.12s; }
/* Posters are shown whole, at their own shape (patches on a line can differ in height) */
.patch__media { position: relative; background: var(--linen-2); }
.patch__media img { width: 100%; height: auto; pointer-events: none; }
.patch__body { position: relative; flex: 1; padding: 20px 20px 24px; }
.patch__meta { display: inline-block; margin-bottom: 8px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.patch h3 { font-size: 1.45rem; line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; font-stretch: 90%; margin-bottom: 10px; padding-right: 44px; }
.patch p { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); }
.patch__go { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-red); color: var(--red); transition: transform 0.5s var(--ease-spring), background 0.25s ease, color 0.25s ease; }
@media (hover: hover) {
  .patch__link:hover { box-shadow: 0 36px 54px -28px rgba(92, 0, 17, 0.5); }
  .patch__link:hover .patch__go { background: var(--red); color: var(--paper); transform: rotate(45deg); }
}
.carousel__controls { display: flex; gap: 10px; flex: none; }
.carousel__progress { margin-top: 8px; height: 3px; border-radius: 3px; background: var(--line-red); overflow: hidden; }
.carousel__progress span { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--p, 0)); }
.carousel.is-native .carousel__viewport { overflow-x: auto; cursor: auto; touch-action: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); }
.carousel.is-native .carousel__viewport::-webkit-scrollbar { display: none; }
.carousel.is-native .patch { scroll-snap-align: start; }
html:not(.js) .carousel__viewport { overflow-x: auto; touch-action: auto; }
html:not(.js) .carousel__controls { display: none; }
@media (max-width: 767px) { .carousel__controls { display: none; } }

/* ---------- Call to action: photos floating at different depths ---------- */
.cta { overflow: hidden; isolation: isolate; text-align: center; background: var(--red); color: var(--paper); min-height: 100vh; min-height: 100svh; display: grid; align-items: center; }
.collage { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.collage__item {
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  aspect-ratio: 4 / 3; padding: 6px; background: var(--paper); border-radius: 6px;
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.5);
  rotate: var(--r, 0deg);
  will-change: transform;
}
.collage__item img { border-radius: 3px; }
.collage__item:nth-child(1) { --x: 3%;  --y: 9%;  --w: 21%; }
.collage__item:nth-child(2) { --x: 74%; --y: 6%;  --w: 20%; }
.collage__item:nth-child(3) { --x: 84%; --y: 44%; --w: 15%; }
.collage__item:nth-child(4) { --x: 67%; --y: 72%; --w: 22%; }
.collage__item:nth-child(5) { --x: 5%;  --y: 68%; --w: 20%; }
.collage__item:nth-child(6) { --x: -3%; --y: 39%; --w: 13%; }
@media (max-width: 899px) {
  .cta { padding-block: 56vw; }
  .collage__item:nth-child(1) { --x: -6%; --y: 3%;  --w: 44%; }
  .collage__item:nth-child(2) { --x: 60%; --y: 1%;  --w: 42%; }
  .collage__item:nth-child(4) { --x: 56%; --y: 82%; --w: 46%; }
  .collage__item:nth-child(5) { --x: -5%; --y: 84%; --w: 42%; }
  .collage__item:nth-child(3), .collage__item:nth-child(6) { display: none; }
}
.cta__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.cta__title { max-width: 11ch; font-size: clamp(3rem, 9vw, 7.4rem); line-height: 0.92; letter-spacing: -0.045em; font-weight: 700; font-stretch: 80%; text-wrap: balance; }
.cta__text { max-width: 36ch; margin: 26px auto 38px; font-size: clamp(1.0625rem, 1.6vw, 1.3rem); color: rgba(251, 248, 243, 0.88); }

/* ---------- Contact ---------- */
.contact { overflow: clip; }
.contact__grid { position: relative; z-index: 1; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .contact__grid { grid-template-columns: 1fr 1fr; } .social { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .contact__grid { grid-template-columns: 1fr 1fr 2fr; } .social { grid-column: auto; } }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  /* the top padding keeps room for the icon, so the text never reaches it */
  min-height: clamp(170px, 22vw, 220px); padding: calc(28px + 50px + 20px) 28px 28px; border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 1px 0 var(--line);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.55s var(--ease-spring), box-shadow 0.4s ease;
}
@media (hover: hover) { .tile:hover { transform: translateY(-5px); box-shadow: 0 30px 50px -30px rgba(92, 0, 17, 0.4); } }
a.tile:active, .tile:has(.tile__hit:active) { transform: scale(0.98); transition-duration: 0.12s; }
.tile__hit { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.tile__icon { position: absolute; top: 28px; left: 28px; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--red); color: var(--paper); font-size: 1.25rem; }
.tile__label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.tile__value { font-size: clamp(1.25rem, 2.1vw, 1.55rem); font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
/* The email always fits on one line: its size follows the card's width
   (the address is about 11.8em wide; 56px is the card's side padding) */
.tile { container-type: inline-size; }
.tile__value--email {
  white-space: nowrap; overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis;
  font-size: clamp(0.95rem, calc((100cqi - 56px) / 12.2), 1.55rem);
}
.tile__copy { position: absolute; top: 28px; right: 24px; z-index: 2; }
.tile__copy .bi-check2 { display: none; }
.tile__copy.is-done { background: var(--red); color: var(--paper); }
.tile__copy.is-done .bi-copy { display: none; }
.tile__copy.is-done .bi-check2 { display: block; }
/* Social: Instagram and Facebook as embroidery hoops on crimson */
.social {
  position: relative; display: flex; flex-direction: column; gap: 18px; padding: 26px 28px 30px;
  border-radius: var(--radius); background: var(--red); color: var(--paper); overflow: hidden; isolation: isolate;
  box-shadow: 0 30px 50px -30px rgba(92, 0, 17, 0.6);
}
.social::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--weave); opacity: 0.6; mix-blend-mode: overlay; }
.social__label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.social__hoops { --ring: clamp(108px, 30vw, 150px); position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
/* The thread that runs from one hoop to the other */
.social__thread { position: absolute; left: 0; width: 100%; top: calc(6px + var(--ring) * 0.62); height: calc(var(--ring) * 0.42); z-index: 0; overflow: visible; pointer-events: none; }
.social__thread path { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.03 0.02; vector-effect: non-scaling-stroke; opacity: 0.85; }
.hooplink { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; border-radius: 16px; text-align: center; -webkit-tap-highlight-color: transparent; }
.hooplink__ring {
  position: relative; display: grid; place-items: center; width: var(--ring); aspect-ratio: 1; margin-bottom: 10px;
  border-radius: 50%; background-color: var(--linen); background-image: var(--weave);
  /* inner and outer wooden rings */
  box-shadow: inset 0 0 0 5px #C9965A, inset 0 0 0 7px #A8743C, inset 0 0 0 11px #D9AE74, 0 18px 30px -16px rgba(0, 0, 0, 0.55);
  transition: transform 0.7s var(--ease-spring);
}
/* the hoop's brass clasp */
.hooplink__ring::before { content: ""; position: absolute; top: -9px; left: 50%; width: 20px; height: 14px; margin-left: -10px; border-radius: 4px; background: linear-gradient(#E9C27A, #B8873C); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3); }
.hooplink__icon { width: 48%; color: var(--red); }
.hooplink__name { display: inline-flex; align-items: center; gap: 6px; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.hooplink__name i { line-height: 0; font-size: 0.85em; transition: transform 0.45s var(--ease-spring); }
.hooplink__handle { font-size: 0.875rem; color: rgba(251, 248, 243, 0.75); }
.hooplink:active .hooplink__ring { transform: scale(0.95); transition-duration: 0.12s; }
.hooplink:focus-visible { outline-color: var(--gold); }
@media (hover: hover) {
  .hooplink:hover .hooplink__ring { transform: rotate(-8deg) translateY(-4px); }
  .hooplink:nth-child(2):hover .hooplink__ring { transform: rotate(8deg) translateY(-4px); }
  .hooplink:hover .hooplink__name i { transform: translate(2px, -2px); }
}
@media (prefers-reduced-motion: reduce) { .hooplink__ring { transition: none; } .hooplink:hover .hooplink__ring, .hooplink:nth-child(2):hover .hooplink__ring { transform: none; } }

/* ---------- Footer ---------- */
.footer { position: relative; background: var(--red-deep); color: var(--paper); padding-bottom: calc(32px + env(safe-area-inset-bottom)); font-size: 0.9375rem; }
.footer .container { padding-top: clamp(3.5rem, 7vw, 5rem); }
.footer__grid { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; }
@media (min-width: 992px) { .footer__grid { grid-template-columns: 4fr 2fr 3fr 4fr; } }
.footer__about, .footer__social { grid-column: 1 / -1; }
@media (min-width: 992px) { .footer__about, .footer__social { grid-column: auto; } }
.footer__brand { display: inline-block; padding: 6px 0; }
.footer__brand .sitename { font-size: 2.2rem; font-weight: 700; font-stretch: 85%; letter-spacing: -0.035em; }
.footer__about p { margin-top: 14px; color: rgba(251, 248, 243, 0.78); }
.footer__about p a { display: inline-block; padding: 8px 0; color: var(--paper); text-decoration: underline; text-decoration-color: rgba(251, 248, 243, 0.4); text-underline-offset: 4px; }
.footer h4 { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(251, 248, 243, 0.6); margin-bottom: 16px; }
.footer__links li + li { margin-top: 2px; }
.footer__links a { display: inline-block; padding: 7px 0; color: rgba(251, 248, 243, 0.85); transition: color 0.2s ease; }
.footer__links a:hover { color: #fff; }
.footer__social p { color: rgba(251, 248, 243, 0.78); max-width: 34ch; }
.footer__icons { display: flex; gap: 10px; margin-top: 18px; }
.footer__bottom { margin-top: 56px; padding-top: 22px; border-top: 1px solid rgba(251, 248, 243, 0.18); color: rgba(251, 248, 243, 0.6); font-size: 0.8125rem; }
.footer__bottom strong { color: var(--paper); font-weight: 600; }

/* ---------- Back to top (the logo's marigold) ---------- */
.to-top {
  position: fixed; z-index: 90; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 52px; height: 52px; font-size: 1.35rem;
  background: var(--gold); color: #fff;
  box-shadow: 0 12px 26px -10px rgba(92, 0, 17, 0.45);
  opacity: 0; transform: translateY(16px) scale(0.85); pointer-events: none;
}
.to-top:hover { background: var(--gold-hover); color: #fff; }
/* A slightly heavier arrow with a soft shadow keeps white readable on marigold */
.to-top i { -webkit-text-stroke: 0.6px currentColor; text-shadow: 0 1px 2px rgba(92, 0, 17, 0.35); }
.to-top i { transition: transform 0.45s var(--ease-spring); }
.to-top:hover i { transform: translateY(-3px); }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top.is-visible:active { transform: scale(0.9); }

/* =========================================================
   Project pages
   ========================================================= */

/* ---------- Language switch (EN | BG) ---------- */
.lang {
  display: inline-flex; gap: 2px; padding: 3px; margin-left: 10px; border-radius: 999px;
  background: rgba(35, 26, 24, 0.05); box-shadow: inset 0 0 0 1px var(--line);
}
.lang__opt {
  display: grid; place-items: center; min-width: 40px; height: 36px; padding: 0 10px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, background-color 0.25s ease, transform 0.45s var(--ease-spring);
}
.lang__opt:hover { color: var(--red); }
.lang__opt:active { transform: scale(0.92); transition-duration: 0.1s; }
.lang__opt.is-active { background: var(--red); color: var(--paper); box-shadow: 0 4px 10px -4px rgba(92, 0, 17, 0.5); }
@media (max-width: 767px) {
  .lang { margin-left: auto; }
  .nav .nav__toggle { margin-left: 6px; }
}

/* Bulgarian pages: a Cyrillic font with the same width axis */
:root:lang(bg) { --font: "Roboto Flex", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ---------- Hero ---------- */
.phero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + clamp(24px, 5vw, 56px)) 0 clamp(64px, 9vw, 110px); }
.phero__grid { display: grid; gap: clamp(48px, 7vw, 80px); align-items: center; }
@media (min-width: 820px) { .phero__grid { grid-template-columns: 1.25fr 1fr; } }

.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.875rem; font-weight: 600; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-red); }
.crumbs a { color: var(--red); display: inline-block; padding: 10px 0; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }

.phero__title {
  margin-top: clamp(16px, 3vw, 28px);
  font-size: clamp(3.6rem, 12vw, 9rem); line-height: 0.88; letter-spacing: -0.05em;
  font-weight: 700; font-stretch: 80%; color: var(--red);
}
.phero__tag {
  max-width: 20ch; margin-top: clamp(18px, 2.6vw, 28px);
  font-size: clamp(1.4rem, 2.8vw, 2.2rem); line-height: 1.12; letter-spacing: -0.025em;
  font-weight: 650; font-stretch: 90%; color: var(--ink);
}

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin: clamp(28px, 4vw, 40px) 0 0;
  border-top: 1px solid var(--line);
}
.facts div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts div:nth-child(even) { padding-left: 16px; }
.facts dt { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.facts dd { margin: 6px 0 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
@media (min-width: 1100px) {
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts div { border-right: 1px solid var(--line); padding: 16px; }
  .facts div:first-child { padding-left: 0; }
  .facts div:last-child { border-right: 0; }
}

.phero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: clamp(28px, 4vw, 40px); }
.phero__label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }

/* Poster hanging from a peg on its own little line */
.phero__poster { position: relative; width: min(100%, 400px); margin-inline: auto; padding-top: 34px; }
.phero__cord {
  position: absolute; top: 20px; left: -24px; right: -50vw; height: 3px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--red) 0 4px, var(--red-deep) 4px 8px);
  box-shadow: 0 2px 3px rgba(35, 26, 24, 0.15);
}
.phero__swing {
  position: relative; transform-origin: 50% -14px; transform: rotate(var(--swing, 0deg));
  will-change: transform; touch-action: pan-y;
}
.phero__swing img {
  width: 100%; height: auto; border-radius: 14px; background: var(--paper);
  box-shadow: 0 40px 70px -36px rgba(92, 0, 17, 0.6), 0 1px 0 rgba(35, 26, 24, 0.08);
}
.phero__swing .patch__peg { top: -18px; }

/* ---------- Story ---------- */
.story { padding-block: var(--section-y); display: grid; gap: clamp(28px, 4vw, 44px); }
.story__col { max-width: calc(68ch + 2 * var(--gutter)); }
.story__col p { font-size: clamp(1.0625rem, 1.25vw, 1.1875rem); line-height: 1.75; color: var(--ink-2); }
.story__col b { color: var(--ink); font-weight: 650; }
.story__col .story__lede { font-size: clamp(1.45rem, 2.7vw, 2.15rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 550; color: var(--ink); }
.story__lede b { color: var(--red); font-weight: 650; }

.story__wide { margin-block: clamp(12px, 3vw, 32px); padding-inline: var(--gutter); }
.story__photo { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--linen-2); }
.story__photo img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.story__wide .story__photo { max-width: var(--maxw); margin-inline: auto; aspect-ratio: 16 / 9; }
.story__duo { max-width: calc(980px + 2 * var(--gutter)); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2.5vw, 28px); align-items: start; margin-block: clamp(12px, 3vw, 32px); }
.story__duo .story__photo { aspect-ratio: 3 / 4; }
.story__duo > div:last-child { margin-top: clamp(40px, 9vw, 120px); }

/* The menu: one card per country, flag embroidered */
.menu { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; max-width: var(--maxw); margin: clamp(8px, 2vw, 20px) auto; }
/* An odd last dish spans the row on phones; on computers every dish shares one row */
@media (max-width: 899px) { .dish:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 900px) { .menu { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; } }
.dish {
  display: flex; flex-direction: column; gap: 18px; padding: clamp(20px, 2.6vw, 28px);
  border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 30px 50px -40px rgba(35, 26, 24, 0.4);
  transition: transform 0.6s var(--ease-spring), box-shadow 0.4s ease;
}
.dish:nth-child(odd) { rotate: -1.2deg; }
.dish:nth-child(even) { rotate: 1deg; }
@media (hover: hover) { .dish:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 1px 0 var(--line), 0 34px 54px -36px rgba(92, 0, 17, 0.45); } }
.dish__flag { width: 84px; padding: 8px; border-radius: 10px; background: var(--linen-2); }
.dish__name { font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 650; line-height: 1.25; letter-spacing: -0.015em; }

/* Highlights: the original bullet lists, as three numbered cards */
.highlights { list-style: none; margin: clamp(8px, 2vw, 20px) auto; padding: 0; max-width: var(--maxw); display: grid; gap: 14px; grid-template-columns: 1fr; counter-reset: none; }
@media (min-width: 720px) { .highlights { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.highlights li {
  display: flex; flex-direction: column; gap: 14px; padding: clamp(22px, 2.8vw, 30px);
  border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 30px 50px -40px rgba(35, 26, 24, 0.4);
  font-size: 1.0625rem; font-weight: 600; line-height: 1.45;
}
.highlights__n { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 700; font-stretch: 80%; line-height: 1; letter-spacing: -0.04em; color: var(--red); }
.highlights a { color: var(--red); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* Impacts and results (2026 projects) */
.outcomes { padding-top: 0; }
.outcomes__results { margin-top: clamp(3rem, 7vw, 5rem); }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 72ch; }
.results li {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px;
  border-radius: var(--radius); background: var(--paper); box-shadow: 0 1px 0 var(--line);
  font-size: 1.0625rem; line-height: 1.55;
}
.results i { flex: none; margin-top: 1px; font-size: 1.35rem; line-height: 1; color: var(--red); }

/* Embroidered flags beside the countries */
.facts__flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.facts__flag { width: 34px; padding: 3px; border-radius: 5px; background: var(--linen-2); }

/* ---------- Skills ---------- */
.skills { background: var(--red); color: var(--paper); }
.skills__text { max-width: 36ch; font-size: clamp(1.45rem, 2.9vw, 2.35rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 550; }
.skills__text b { font-weight: 700; }
.skills__text .sw { color: var(--paper); }

/* ---------- Gallery (masonry, opens full screen) ---------- */
.gallery__grid { columns: 3 280px; column-gap: 16px; }           /* fallback without JS */
.gallery__grid.is-masonry { columns: auto; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
.gallery__col { display: grid; gap: 16px; }
.gtile {
  display: block; width: 100%; margin: 0 0 16px; padding: 0; border-radius: 16px; overflow: hidden;
  background: var(--linen-2); cursor: zoom-in; break-inside: avoid;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 24px 40px -30px rgba(35, 26, 24, 0.45);
  transition: transform 0.5s var(--ease-spring), box-shadow 0.4s ease;
}
.is-masonry .gtile { margin: 0; }
.gtile img { width: 100%; height: auto; transition: transform 0.9s var(--ease-out); }
@media (hover: hover) { .gtile:hover img { transform: scale(1.04); } .gtile:hover { box-shadow: 0 30px 50px -30px rgba(92, 0, 17, 0.5); } }
.gtile:active { transform: scale(0.97); transition-duration: 0.12s; }
.gtile.is-hidden img { visibility: hidden; }

/* ---------- Funding ---------- */
.funding { padding-bottom: var(--section-y); }
.funding__inner { display: grid; gap: 24px; align-items: center; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); background: var(--paper); box-shadow: 0 1px 0 var(--line); }
@media (min-width: 820px) { .funding__inner { grid-template-columns: minmax(220px, 320px) 1fr; gap: 40px; } }
.funding__inner img { width: 100%; max-width: 320px; height: auto; }
.funding__inner p { font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 500; }
.lightbox[hidden] { display: none; }
.lightbox__scrim { position: absolute; inset: 0; background: rgba(28, 8, 12, 0.92); opacity: 0; }
.lightbox__img {
  position: absolute; left: 0; top: 0; border-radius: 10px;
  transform-origin: 50% 50%; will-change: transform;
  touch-action: none; user-select: none; -webkit-user-drag: none; cursor: grab;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
}
.lightbox.is-dragging .lightbox__img { cursor: grabbing; }
.lightbox__bar {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0;
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 999px;
  background: rgba(251, 248, 243, 0.12);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: inset 0 0 0 1px rgba(251, 248, 243, 0.18);
  opacity: 0; transition: opacity 0.3s ease;
}
.lightbox.is-open .lightbox__bar { opacity: 1; }
.lightbox__count { min-width: 56px; font-size: 0.9375rem; font-weight: 600; color: var(--paper); font-variant-numeric: tabular-nums; }
.lightbox__btn { background: rgba(251, 248, 243, 0.14); color: var(--paper); box-shadow: none; }
.lightbox__btn:hover { background: var(--paper); color: var(--red-deep); }
.lightbox__btn:disabled { background: rgba(251, 248, 243, 0.08); color: var(--paper); }
@media (prefers-reduced-transparency: reduce) { .lightbox__bar { background: #2a1015; -webkit-backdrop-filter: none; backdrop-filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .dish, .gtile { transition-property: box-shadow; }
  .dish:hover, .gtile:hover img { transform: none; }
}

/* ---------- Depth (driven by GSAP through CSS variables) ---------- */
[data-parallax], .gallery__col { translate: 0 var(--py, 0px); }
.collage__item { translate: var(--mx, 0px) calc(var(--py, 0px) + var(--my, 0px)); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(36px) scale(0.98); transition: opacity 0.9s var(--ease-out), transform 1.2s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* =========================================================
   Projects index: every poster, grouped by year
   ========================================================= */
.phero--index { padding-bottom: clamp(48px, 7vw, 80px); }
.pindex__intro { max-width: 30ch; color: var(--ink-2); }
.pfilter { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(28px, 4vw, 44px); }
.chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px 8px 18px;
  border-radius: 999px; background: var(--paper); color: var(--red); font-size: 0.9375rem; font-weight: 650;
  box-shadow: inset 0 0 0 1px var(--line-red), 0 8px 20px -14px rgba(92, 0, 17, 0.5);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.45s var(--ease-spring);
}
.chip:active { transform: scale(0.96); }
.chip__n { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: rgba(138, 0, 25, 0.08); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--red); color: var(--paper); box-shadow: 0 12px 26px -14px rgba(92, 0, 17, 0.8); }
.chip[aria-pressed="true"] .chip__n { background: rgba(251, 248, 243, 0.18); }
@media (hover: hover) { .chip[aria-pressed="false"]:hover { background: #fff; } }
/* Phones: the filters stay on one swipeable row instead of stacking */
@media (max-width: 559px) {
  .pfilter { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 16px; scrollbar-width: none; }
  .pfilter::-webkit-scrollbar { display: none; }
  .chip { flex: none; font-size: 0.875rem; padding-left: 14px; }
}

/* Hero: copy on the left, the newest posters fanned out on the right */
.pindex__hero { display: grid; gap: 48px; align-items: center; }
.pfan { display: none; }
@media (min-width: 960px) {
  .pindex__hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .pfan { display: block; position: relative; height: clamp(360px, 34vw, 460px); }
  .pfan__p { position: absolute; top: 50%; left: 50%; width: 46%; height: auto; border-radius: 12px; box-shadow: 0 30px 50px -26px rgba(35, 26, 24, 0.6); }
  .pfan__p:nth-child(1) { z-index: 2; transform: translate(-108%, -46%) rotate(-7deg); }
  .pfan__p:nth-child(2) { z-index: 3; transform: translate(-50%, -54%) scale(1.06); }
  .pfan__p:nth-child(3) { z-index: 1; transform: translate(8%, -46%) rotate(7deg); }
}

/* One year per block: the year as a heading row, the posters in an even grid */
.pyear { padding-block: clamp(56px, 8vw, 96px) 0; }
.pyear:last-child { padding-bottom: var(--section-y); }
.pyear.is-empty { display: none; }
.pyear__head { display: flex; align-items: flex-end; gap: 16px 20px; margin-bottom: clamp(36px, 5vw, 56px); }
.pyear__head::after { content: ""; flex: 1; height: 1px; margin-bottom: 0.9em; background: var(--line-red); }
.pyear__year {
  font-size: clamp(3.6rem, 10vw, 6.5rem); line-height: 0.8; letter-spacing: -0.05em; font-weight: 700; font-stretch: 80%;
  color: transparent; -webkit-text-stroke: 2px var(--red); font-variant-numeric: tabular-nums;
}
.pyear__count { order: 2; flex: none; margin-bottom: 0.55em; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.pyear__head::after { order: 1; }

/* 1 column on phones, 2 on small tablets, 3 on tablets, 4 on computers */
.pgrid { display: grid; grid-template-columns: 1fr; gap: 44px 24px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 880px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 52px 28px; } }
@media (min-width: 1180px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard[hidden] { display: none; }
.pcard__link {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--paper); border-radius: 18px;
  box-shadow: 0 26px 44px -30px rgba(35, 26, 24, 0.55), 0 1px 0 rgba(35, 26, 24, 0.06);
  transition: transform 0.6s var(--ease-spring), box-shadow 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}
.pcard__link:active { transform: scale(0.97); transition-duration: 0.12s; }
/* Every poster sits whole on the same-sized linen board, so the cards line up */
.pcard__poster {
  position: relative; display: grid; place-items: center; aspect-ratio: 5 / 6; padding: 26px 22px 20px;
  border-radius: 18px 18px 0 0; background-color: var(--linen-2); background-image: var(--weave);
}
.pcard__poster img {
  width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 6px;
  box-shadow: 0 18px 30px -18px rgba(35, 26, 24, 0.55), 0 2px 4px rgba(35, 26, 24, 0.12);
  transform-origin: 50% 0; transition: transform 0.7s var(--ease-spring);
}
.pcard__poster .patch__peg { top: 8px; }
.pcard__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 20px 20px 22px; }
.pcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pcard__kind { padding: 4px 10px; border-radius: 999px; background: rgba(138, 0, 25, 0.08); color: var(--red); }
.pcard__when { color: var(--ink-3); }
.pcard__title { font-size: 1.4rem; line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; font-stretch: 90%; }
.pcard__flags { display: flex; flex-wrap: wrap; gap: 5px; }
.pcard__flag { width: 28px; padding: 3px; border-radius: 5px; background: var(--linen-2); }
.pcard__text { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); }
.pcard__go { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font-size: 0.9375rem; font-weight: 700; color: var(--red); }
.pcard__go i { line-height: 0; transition: transform 0.45s var(--ease-spring); }
@media (hover: hover) {
  .pcard__link:hover { transform: translateY(-6px); box-shadow: 0 40px 60px -32px rgba(92, 0, 17, 0.5); }
  .pcard__link:hover .pcard__poster img { transform: rotate(-2deg); }
  .pcard:nth-child(even) .pcard__link:hover .pcard__poster img { transform: rotate(2deg); }
  .pcard__link:hover .pcard__go i { transform: translateX(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .pcard__link, .pcard__poster img, .chip { transition-property: background-color, color, box-shadow; }
  .pcard__link:hover, .pcard__link:hover .pcard__poster img, .pcard:nth-child(even) .pcard__link:hover .pcard__poster img { transform: none; }
}
@media (prefers-contrast: more) { .pcard__link, .chip { box-shadow: inset 0 0 0 1px var(--line); } }

/* "All projects" links under the washing line */
.carousel__all { display: flex; justify-content: center; margin-top: clamp(28px, 4vw, 40px); }

/* ---------- SAFE CLICK: a card in "terminal" mode ---------- */
.patch__link--cyber, .pcard[data-kind="partnership"] .pcard__link {
  --cy-term: #170A0D; --cy-muted: rgba(242, 236, 227, 0.68);
  background: var(--cy-term); color: var(--linen);
  box-shadow: 0 30px 50px -28px rgba(60, 0, 12, 0.85), 0 0 0 1px rgba(138, 0, 25, 0.4);
}
.patch__link--cyber .patch__media { background: var(--cy-term); }
.patch__link--cyber .patch__body, .pcard[data-kind="partnership"] .pcard__body {
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(240, 160, 24, 0.06) 47% 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(240, 160, 24, 0.06) 47% 53%, transparent 54%);
  background-size: 14px 14px;
}
.patch__link--cyber .patch__meta { color: var(--gold); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0.06em; }
.patch__link--cyber h3 { color: var(--gold); letter-spacing: 0.02em; }
.patch__link--cyber p, .pcard[data-kind="partnership"] .pcard__text { color: var(--cy-muted); }
.patch__link--cyber .patch__go { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(240, 160, 24, 0.45); }
.patch__status { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font: 600 0.75rem/1 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.patch__led { width: 8px; height: 8px; border-radius: 50%; background: #2FB84F; box-shadow: 0 0 0 3px rgba(47, 184, 79, 0.2); }
@media (prefers-reduced-motion: no-preference) {
  .patch__led { animation: patch-led 2s ease-in-out infinite; }
  @keyframes patch-led { 50% { box-shadow: 0 0 0 7px rgba(47, 184, 79, 0); } }
}
@media (hover: hover) {
  .patch__link--cyber:hover { box-shadow: 0 40px 60px -28px rgba(60, 0, 12, 0.9), 0 0 0 1px var(--gold); }
  .patch__link--cyber:hover .patch__go { background: var(--gold); color: #170A0D; }
  .pcard[data-kind="partnership"] .pcard__link:hover { box-shadow: 0 40px 60px -32px rgba(60, 0, 12, 0.9), 0 0 0 1px var(--gold); }
}
.pcard[data-kind="partnership"] .pcard__poster { background-color: #221015; background-image: none; }
.pcard[data-kind="partnership"] .pcard__kind { background: rgba(240, 160, 24, 0.14); color: var(--gold); }
.pcard[data-kind="partnership"] .pcard__when { color: var(--cy-muted); }
.pcard[data-kind="partnership"] .pcard__title, .pcard[data-kind="partnership"] .pcard__go { color: var(--gold); }
.pcard[data-kind="partnership"] .pcard__flag { background: rgba(242, 236, 227, 0.1); }

/* =========================================================
   Accessibility preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transform: none; transition: opacity 0.4s ease; transition-delay: 0s; }
  .mw > span { transform: none; transition: none; }
  .btn, .icon-btn, .patch__link, .tile, .vcard, .nav__seam, .nav__toggle span, .nav__logo { transition-property: opacity, background-color, color, box-shadow; }
  .nav__menu, .nav__menu a { transform: none !important; }
  .patch { transform: none; }
  .tile:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav.is-scrolled, .nav.is-open { background: var(--linen); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --ink-2: #3d322e; --ink-3: #4e423d; --line: rgba(35, 26, 24, 0.35); --line-red: rgba(138, 0, 25, 0.6); }
  .vcard, .tile, .checks li, .patch__link { box-shadow: inset 0 0 0 1px var(--line); }
}
