/* Project pages and the projects overview. Loaded after home2.css and built on its tokens, type and top bar.
   Photos lead: a full-screen cover, then a large gallery that opens full screen, then the story. */

/* ---------- cover photo ---------- */
.pcover { position: relative; height: 92vh; height: 92svh; min-height: 460px; overflow: hidden; color: #fff; background: var(--forest); }
.pcover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 14, 18, 0.85) 0%, rgba(5, 14, 18, 0.45) 45%, transparent 70%), linear-gradient(180deg, rgba(5, 14, 18, 0.45) 0%, transparent 22%); }
.pcover__copy { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: clamp(36px, 8vh, 80px); max-width: 1100px; }
.crumb { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; text-decoration: none; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55); }
.crumb:hover { text-decoration: underline; text-underline-offset: 4px; }
/* Over a photo the small labels are white with a soft shadow, so they read on bright pictures too. */
.pcover .label { color: #fff; opacity: 0.9; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55); }
.pcover h1 { text-shadow: 0 10px 34px rgba(0, 0, 0, 0.35); }
.pcover h1 { font-size: clamp(2.5rem, min(7.4vw, 11vh), 6.4rem); line-height: 1; letter-spacing: -0.025em; text-wrap: balance; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 0; font-size: clamp(0.98rem, 1.3vw, 1.15rem); color: #e8f0f2; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4); }
.pmeta span + span::before { content: "·"; margin-right: 22px; color: var(--accent-light); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags span { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- lead and facts ---------- */
.pintro { padding: clamp(60px, 8vw, 110px) 0 clamp(40px, 5vw, 70px); }
.pintro__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(36px, 6vw, 100px); align-items: start; }
.plead { margin: 0; font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.3rem); font-weight: 600; line-height: 1.22; letter-spacing: -0.01em; text-wrap: pretty; }
.facts { margin: 0; border-top: 1.5px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding-top: 2px; }
.facts dd { margin: 0; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
/* The EU emblem: required on the pages of EU-funded projects, so only there (not on the homepage). */
.eu-funded { display: block; width: min(260px, 70%); height: auto; margin-top: 26px; }
/* Countries as flags (inline SVG, see FLAGS in tools/build-projects.py). */
.flags { display: flex; flex-wrap: wrap; gap: 8px 10px; padding-top: 1px; }
.flag svg { display: block; width: 30px; height: 20px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(21, 33, 42, 0.14), 0 1px 3px rgba(21, 33, 42, 0.12); }
.facts a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- gallery ---------- */
.pgallery { padding: 0 0 clamp(70px, 9vw, 120px); }
.pgallery__head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.pgallery__head .label { margin: 0; }
.pgallery__count { color: var(--muted); font-size: 0.95rem; }
/* A masonry of the photos at their own proportions. With only a few photos, they get two big columns. */
.photos { columns: 3 300px; column-gap: 14px; }
.photos--few { columns: 2 320px; }
.photos a { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: var(--paper-deep); border-radius: 6px; overflow: hidden; cursor: zoom-in; break-inside: avoid; }
.photos img { width: 100%; height: auto; transition: transform 0.9s var(--ease), opacity 0.4s ease; }
.photos a:hover img { transform: scale(1.03); }
.photos a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.materials { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: clamp(28px, 4vw, 44px); padding-top: 26px; border-top: 1px solid var(--line); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark .btn__arrow { background: #fff; color: var(--ink); }
.btn--dark:hover { background: var(--accent); }

/* ---------- story ---------- */
.pstory__grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(30px, 6vw, 100px); align-items: start; }
.pstory h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.chapters { display: grid; gap: clamp(26px, 3vw, 38px); }
.chapters article { padding-top: 18px; border-top: 1px solid var(--line); }
.chapters h3 { margin-bottom: 10px; }
.chapters p { margin: 0; color: var(--muted); max-width: 40em; }

/* ---------- previous / next ---------- */
/* Room under the row for the treeline of the contact section below, which reaches up into it. */
.pnext-wrap { padding-bottom: calc(clamp(50px, 7vw, 110px) + 28px); }
.pnext { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pnext a { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 20px; padding: clamp(24px, 3vw, 40px) var(--gutter); text-decoration: none; transition: background 0.3s ease; }
.pnext a + a { border-left: 1px solid var(--line); }
.pnext a:hover { background: var(--paper-deep); }
.pnext img { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; }
.pnext small { display: block; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.pnext strong { font-family: var(--display); font-size: clamp(1.15rem, 1.8vw, 1.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.pnext a.is-next { text-align: right; grid-template-columns: minmax(0, 1fr) 120px; }
.pnext a.is-next img { order: 2; }

/* ---------- full-screen photo viewer ---------- */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(4, 9, 11, 0.96); color: #fff; overscroll-behavior: contain; }
.lightbox::backdrop { background: rgba(4, 9, 11, 0.96); }
.lightbox__stage { position: absolute; inset: 64px clamp(8px, 6vw, 96px) 64px; display: grid; place-items: center; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); transition: opacity 0.25s ease; }
.lightbox__bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(12px, 3vw, 28px); }
.lightbox__count { font-size: 0.9rem; color: #c8d4da; font-variant-numeric: tabular-nums; }
.lightbox button { display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #fff; font: 600 1.25rem var(--sans); cursor: pointer; transition: background 0.2s ease; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; margin-top: -23px; z-index: 2; }
.lightbox__prev { left: clamp(6px, 1.6vw, 24px); }
.lightbox__next { right: clamp(6px, 1.6vw, 24px); }
.lightbox__title { font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.is-viewing { overflow: hidden; }

/* ---------- projects overview ---------- */
.phead { background: var(--forest); color: #fff; padding: clamp(130px, 18vw, 210px) 0 clamp(60px, 8vw, 100px); }
.phead h1 { font-size: clamp(2.6rem, 7.4vw, 6.4rem); line-height: 1; letter-spacing: -0.025em; }
.phead .body { max-width: 36rem; margin-top: 26px; }
.plist { display: grid; gap: clamp(60px, 9vw, 130px); }
.prow { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: clamp(28px, 5vw, 70px); align-items: center; text-decoration: none; }
.prow:nth-child(even) { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); }
.prow:nth-child(even) .prow__photos { order: 2; }
/* Each project shows a big photo with two smaller ones beside it: a taste of its gallery. */
.prow__photos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; aspect-ratio: 16 / 9; }
.prow__photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; transition: transform 0.9s var(--ease); }
.prow__photos img:first-child { grid-row: 1 / 3; }
.prow__photos--one { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.prow__photos span { overflow: hidden; border-radius: 6px; display: block; }
.prow__photos span:first-child { grid-row: 1 / 3; }
.prow:hover .prow__photos img { transform: scale(1.035); }
.prow h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); margin: 6px 0 12px; }
.prow__meta { color: var(--muted); margin: 0 0 16px; }
.prow__lead { margin: 0 0 22px; color: var(--ink); max-width: 30em; }
.prow__more { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.prow__count { color: var(--muted); font-size: 0.92rem; }
.prow .link { color: var(--ink); }
.ptags { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.pnextcall { margin-top: clamp(70px, 9vw, 120px); padding: clamp(28px, 4vw, 48px); border: 1.5px dashed rgba(24, 36, 31, 0.32); border-radius: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.pnextcall h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.pnextcall p { margin: 8px 0 0; color: var(--muted); }

/* ---------- about ---------- */
.about__text .body { margin-top: 0; }
.about__text .body + .body { margin-top: 16px; }
.pstory__grid .tools { margin-top: 0; }
.values { list-style: none; margin: clamp(40px, 6vw, 70px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); }
.values li { padding-top: 18px; border-top: 1.5px solid var(--ink); }
.values__no { display: block; font-family: var(--display); font-weight: 600; color: var(--accent); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.values h3 { margin-bottom: 10px; }
.values p { margin: 0; color: var(--muted); }
.values .values__more { margin-top: 14px; }
.team { list-style: none; margin: clamp(40px, 6vw, 70px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 3.4vw, 48px); }
.team img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--paper); }
.team h3 { margin: 18px 0 10px; font-size: 1.6rem; }
.team p:last-child { margin: 0; color: var(--muted); }
.docs__title { font-size: clamp(2rem, 4vw, 3.2rem); }
#documents .body { margin-top: 14px; }
.docs { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 6px; }
.docs .link { color: var(--ink); align-items: baseline; }
.docs__type { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); }

/* ---------- contact ---------- */
/* The email address is the page's headline: big, in the display face, with the @ in the accent blue. */
.mailbox .label { margin-bottom: 14px; }
.mail { display: inline-block; max-width: 100%; font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 7.4vw, 6rem); line-height: 1.05; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat; transition: background-size 0.5s var(--ease); padding-bottom: 6px; }
.mail:hover { background-size: 100% 3px; }
.mail__at { color: var(--accent); }
.mailbox .actions { margin-top: clamp(26px, 3.4vw, 40px); flex-wrap: nowrap; gap: 12px; }
.mailbox .actions .copy { flex: none; }
.mailbox__lead { margin: 0 0 clamp(18px, 2.4vw, 28px); }
/* Copy address: just an icon, which turns into a green tick for a moment once copied. */
.copy { display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border: 1.5px solid var(--ink); border-radius: 10px; background: none; color: var(--ink); cursor: pointer; transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
.copy:hover { background: var(--ink); color: var(--paper); }
.copy svg { grid-area: 1 / 1; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.2s ease, transform 0.3s var(--ease); }
.copy__tick { opacity: 0; transform: scale(0.6); }
.copy.is-copied { border-color: var(--moss); background: var(--moss); color: #fff; }
.copy.is-copied .copy__icon { opacity: 0; transform: scale(0.6); }
.copy.is-copied .copy__tick { opacity: 1; transform: none; }
.copy__done { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mailbox__more { margin-top: clamp(60px, 8vw, 100px); max-width: 560px; }
.mailbox__more .facts a { color: var(--ink); }

/* ---------- Instagram: a phone with the profile and a slowly scrolling feed ---------- */
.ig { position: relative; overflow-x: clip; background: var(--grain), var(--forest); color: #fff; padding: clamp(100px, 12vw, 160px) 0 clamp(90px, 11vw, 150px); }
.ig__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 340px); gap: clamp(40px, 7vw, 110px); align-items: center; }
.ig__text h1, .ig__text h2 { color: #fff; }
/* At the top of the page, under the top bar. */
.ig--top { padding-top: clamp(130px, 15vw, 190px); }
.ig--top h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: 1; letter-spacing: -0.025em; }
/* The forest's treeline sits on the footer here, since the page has no closing band. */
.foot--trees { position: relative; margin-top: clamp(50px, 7vw, 110px); }
.ig__text .actions { margin-top: 34px; }
.ig__phone { position: relative; display: block; aspect-ratio: 9 / 18; border-radius: 42px; padding: 11px; background: linear-gradient(145deg, #1d2b31, #070d10); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5), inset 0 0 0 1.5px rgba(255, 255, 255, 0.12); transform: rotate(-5deg); transition: transform 0.7s var(--ease); text-decoration: none; color: var(--ink); }
.ig__phone:hover, .ig__phone:focus-visible { transform: rotate(-1.5deg) translateY(-8px); }
.ig__screen { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 32px; background: #fff; }
.ig__top { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; font: 600 0.85rem var(--sans); }
.ig__dots { letter-spacing: 1px; color: #8a959c; }
.ig__head { display: flex; align-items: center; gap: 12px; padding: 10px 16px 4px; }
/* The story ring around the logo. */
.ig__avatar { flex: none; width: 64px; height: 64px; padding: 3px; border-radius: 50%; background: conic-gradient(from 200deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); animation: ring 6s linear infinite; }
.ig__avatar img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; background: #fff; animation: ring 6s linear infinite reverse; }
@keyframes ring { to { transform: rotate(360deg); } }
.ig__who { display: grid; gap: 2px; min-width: 0; }
.ig__who strong { font: 700 0.95rem var(--sans); }
.ig__who small { font: 400 0.78rem/1.3 var(--sans); color: #56636b; }
.ig__follow { margin: 10px 16px 12px; padding: 7px 0; border-radius: 8px; background: #0095f6; color: #fff; text-align: center; font: 600 0.82rem var(--sans); }
.ig__feed { position: relative; flex: 1; overflow: hidden; }
.ig__track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; animation: feed 36s linear infinite; }
.ig__track img { width: 100%; aspect-ratio: 1; object-fit: cover; }
@keyframes feed { to { transform: translateY(calc(-50% - 1px)); } }
.ig__phone:hover .ig__track { animation-play-state: paused; }
/* Little hearts floating up beside the phone. */
.ig__heart { position: absolute; right: -14px; bottom: 26%; font-size: 1.5rem; color: #ff3b5c; opacity: 0; animation: heart 4.5s ease-out infinite; text-shadow: 0 4px 14px rgba(255, 59, 92, 0.4); }
.ig__heart--2 { right: -30px; font-size: 1.1rem; animation-delay: 1.5s; }
.ig__heart--3 { right: 4px; font-size: 1.3rem; animation-delay: 3s; }
@keyframes heart { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 15% { opacity: 1; transform: translateY(-20px) scale(1); } 100% { opacity: 0; transform: translateY(-170px) translateX(-16px) scale(0.9); } }

@media (max-width: 980px) {
  .ig__grid { grid-template-columns: 1fr; }
  .ig__phone { width: min(300px, 78vw); margin: 10px auto 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ig__track, .ig__avatar, .ig__avatar img, .ig__heart { animation: none; }
  .ig__phone { transition: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .pintro__grid, .pstory__grid { grid-template-columns: 1fr; }
  .prow, .prow:nth-child(even) { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr; }
  .team { grid-template-columns: 1fr 1fr; }
  .prow:nth-child(even) .prow__photos { order: 0; }
}
@media (max-width: 620px) {
  .pmeta { flex-direction: column; gap: 2px; }
  .pmeta span + span::before { display: none; }
  .photos, .photos--few { columns: 1; }
  .mailbox .actions .btn { width: auto; flex: 1; }               /* the copy icon stays beside it */
  .team { grid-template-columns: 1fr; }
  .pnext { grid-template-columns: 1fr; }
  .pnext a + a { border-left: 0; border-top: 1px solid var(--line); }
  .pnext a, .pnext a.is-next { grid-template-columns: 88px minmax(0, 1fr); text-align: left; }
  .pnext a.is-next img { order: 0; }
  .pnext img { width: 88px; }
  .facts div { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .prow__photos { aspect-ratio: 4 / 3; }
  .lightbox__stage { inset: 60px 6px 60px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 10px; margin-top: 0; }
}
@media (max-height: 520px) {
  .pcover { min-height: 340px; }
  .pcover h1 { font-size: clamp(2.2rem, 12vh, 4rem); }
}
@media (prefers-reduced-motion: reduce) {
  .photos img, .prow__photos img, .lightbox img { transition: none; }
}
