/* teamportraits.ch — custom styles (animations, 3D flip, smooth scroll) */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
  /* ~30% smaller than the previous 18.5/21/22.5 scale so laptops keep a usable viewport */
  font-size: 16px;
}

@media (min-width: 1536px) {
  html {
    font-size: 17px;
  }
}

#solution,
#interactive-wall,
#guide,
#story,
#packages,
#faq,
#contact {
  scroll-margin-top: 4rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Watercolor paper grain — behind text and paint, photos sit above it */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../img/aquarelle/paper-grain.jpg");
  background-repeat: repeat;
  background-size: 440px;
  opacity: 0.4;
  mix-blend-mode: multiply;
}

/* Watercolor trail + rare splat stamps: above paper, holes punched over photos */
.aquarelle-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: multiply;
}

img,
.gallery-item,
.zoom-lens-wrap,
#interactive-wall {
  position: relative;
  z-index: 1;
}

body {
  font-family: Imprima, "Segoe UI", sans-serif;
  color: #2d2d2d;
  background-color: #f9f7f2;
  font-size: 1.125rem;
  line-height: 1.75;
  letter-spacing: 0.012em;
  /* Subpixel rendering keeps thin fonts from looking washed-out */
  -webkit-font-smoothing: auto;
}

h1,
h2,
h3 {
  line-height: 1.28;
}

p,
li {
  line-height: 1.75;
}

strong {
  font-weight: 700;
  color: inherit;
}

.font-display {
  font-family: "Chelsea Market", cursive;
}

.font-accent {
  font-family: Ruluko, sans-serif;
}

/* Primary buttons stay large enough to read on phones */
a.bg-agnes-red,
a.border-agnes-gold {
  font-size: 1.125rem;
}

/* Compact sticky header — must stay thin on small laptop screens */
.site-header .header-bar {
  min-height: 3.15rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.site-header .header-brand,
.site-header .header-nav {
  font-size: 0.95rem;
}

/* Language switch: real DE/EN URLs, ~20% larger and gold-outlined so it is easy to find */
.site-header .lang-switch {
  border: 2px solid #d5a954;
}

.site-header .lang-btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.24rem 0.66rem;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  color: #2d2d2d;
  background-color: #f9f7f2;
}

.site-header .lang-btn + .lang-btn {
  border-left: 2px solid #d5a954;
}

.site-header a.lang-btn:hover {
  background-color: rgba(213, 169, 84, 0.18);
}

.site-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(45, 45, 45, 0.12);
}

/* Language toggle active state */
.lang-btn.is-active {
  color: #d5a954;
  border-color: #d5a954;
  background-color: rgba(213, 169, 84, 0.12);
}

/* Hero title rotator — letter-by-letter fade, words stay wrap-friendly */
.hero-title {
  min-height: 3.75em;
}

.hero-title-word {
  display: inline-block;
  white-space: nowrap;
}

.hero-title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.28em);
  animation: hero-char-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-title-char.is-out {
  animation-name: hero-char-out;
  animation-duration: 0.48s;
  animation-timing-function: ease;
}

@keyframes hero-char-in {
  from {
    opacity: 0;
    transform: translateY(0.28em);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes hero-char-out {
  to {
    opacity: 0;
    transform: translateY(-0.18em);
    filter: blur(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title-char,
  .hero-title-char.is-out {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }
}

/* FAQ accordion — compact rows, clean open/close */
.faq-trigger {
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 0.7rem 0.9rem;
}

.faq-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.28s ease;
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-panel-inner p {
  padding: 0 1.05rem 0.95rem;
  font-size: 1.1875rem;
  line-height: 1.75;
  color: rgba(45, 45, 45, 0.92);
}

.faq-panel-inner strong {
  font-weight: 700;
  color: #2d2d2d;
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-item:not(.is-open) .faq-panel-inner {
  visibility: hidden;
}

/* Image lightbox (gallery) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(45, 45, 45, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

/* Circular mouse loupe for the large team collage */
.zoom-lens-wrap {
  position: relative;
}

.zoom-lens-wrap.is-zooming {
  cursor: none;
}

.zoom-lens-wrap .zoom-lens-img {
  display: block;
  width: 100%;
  height: auto;
}

.zoom-lens {
  position: absolute;
  top: 0;
  left: 0;
  width: 13rem;
  height: 13rem;
  border-radius: 50%;
  border: 3px solid #d5a954;
  box-shadow: 0 10px 28px rgba(45, 45, 45, 0.35),
    inset 0 0 0 1px rgba(249, 247, 242, 0.55);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 3;
  background-repeat: no-repeat;
}

.zoom-lens.is-on {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 639px) {
  .zoom-lens {
    width: 9.5rem;
    height: 9.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zoom-lens {
    display: none;
  }
}

.lightbox__img {
  max-width: min(1100px, 96vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  border: 2px solid #d5a954;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: #f9f7f2;
  color: #2d2d2d;
  font-size: 1.5rem;
  line-height: 1;
  border: 2px solid #d5a954;
  cursor: pointer;
}

.gallery-item {
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

/* Small event-photo thumbs — click opens the existing lightbox */
/* Workflow step icons — large enough to fill the lower part of the card */
.step-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 1.2rem;
  min-height: 6.75rem;
}

.step-icon {
  width: 2.85rem;
  height: 2.85rem;
  color: #d5a954;
  flex-shrink: 0;
}

/* Only the workflow cards get the large icons; Kapital tiles keep the compact size */
.step-icons .step-icon {
  width: 5.5rem;
  height: 5.5rem;
}

@media (min-width: 768px) {
  .step-icons .step-icon {
    width: 6.5rem;
    height: 6.5rem;
  }
}

/* 3×3 box table — nine Kapital points, one tile each */
.capital-symbols {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.capital-symbols li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(45, 45, 45, 0.07);
}

@media (min-width: 768px) {
  .capital-symbols {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.illu-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.illu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (min-width: 640px) {
  .illu-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

.illu-strip .gallery-item {
  width: 4.6rem;
  height: 4.6rem;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 0.4rem;
  border: 1px solid #c3c3c3;
}

@media (min-width: 768px) {
  .illu-strip .gallery-item {
    width: 5.5rem;
    height: 5.5rem;
  }
}

/* Onboarding + ROI boxes: larger thumbs, contain so originals are not cropped to a square */
.illu-strip--boxes {
  gap: 0.7rem;
  margin-top: 1.15rem;
  align-items: stretch;
}

.illu-strip.illu-strip--boxes .gallery-item {
  flex: 1 1 0;
  width: auto;
  height: 12rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.illu-strip.illu-strip--boxes .gallery-item:hover,
.illu-strip.illu-strip--boxes .gallery-item:focus-visible {
  border: 0;
}

.illu-strip.illu-strip--boxes img {
  object-fit: contain;
  object-position: center;
  border-radius: 0.4rem;
}

@media (min-width: 768px) {
  .illu-strip.illu-strip--boxes .gallery-item {
    height: 15rem;
  }
}

.illu-grid .gallery-item {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.4rem;
  border: 1px solid #c3c3c3;
}

.illu-strip img,
.illu-grid img,
.ref-grid img,
.package-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.4s ease, filter 0.4s ease;
}

/* Full-width photo on top of each package column */
.package-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: none;
  border-radius: 0;
}

/* Hover zoom stays inside the rounded frame; click still opens the lightbox */
.illu-strip .gallery-item:hover img,
.illu-strip .gallery-item:focus-visible img,
.illu-grid .gallery-item:hover img,
.illu-grid .gallery-item:focus-visible img,
.ref-grid .gallery-item:hover img,
.ref-grid .gallery-item:focus-visible img,
.package-photo:hover img,
.package-photo:focus-visible img {
  transform: scale(1.14);
}

.illu-strip .gallery-item:hover,
.illu-strip .gallery-item:focus-visible,
.illu-grid .gallery-item:hover,
.illu-grid .gallery-item:focus-visible,
.ref-grid .gallery-item:hover,
.ref-grid .gallery-item:focus-visible {
  border-color: #d5a954;
}

/* 2x2 column beside long copy — fills the empty gap instead of tiny thumbs */
.illu-strip--fill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0;
  width: 100%;
  align-content: start;
}

.illu-strip.illu-strip--fill .gallery-item {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

/* Four thumbs in one row, same total width as the Brinks collage above them */
.illu-strip--span {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  gap: 0.55rem;
}

.illu-strip.illu-strip--span .gallery-item {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

/* Desktop: greyscale + soft contrast at rest. Full colour returns on hover. Touch stays colour. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .illu-strip--span .gallery-item img {
    filter: grayscale(1) contrast(0.68) brightness(1.08);
  }

  .illu-strip--span .gallery-item:hover img,
  .illu-strip--span .gallery-item:focus-visible img {
    filter: none;
  }
}

/* Centered row of larger thumbs under a full-width text block */
.illu-strip--row {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
  gap: 0.55rem;
}

.illu-strip.illu-strip--row .gallery-item {
  width: 8.5rem;
  height: 8.5rem;
}

@media (min-width: 768px) {
  .illu-strip.illu-strip--row .gallery-item {
    width: 10rem;
    height: 10rem;
  }
}

.illu-strip--on-dark .gallery-item {
  border-color: #d5a954;
}

/* FAQ thumbs — same overall width as the accordion under them */
.illu-strip--faq {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 0.5rem;
  margin-top: 0;
}

.illu-strip.illu-strip--faq .gallery-item {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

/* Workflow step painting — matches the larger step icons, sits in leftover card space */
.illu-strip--step {
  justify-content: center;
  margin-top: auto;
  padding-top: 1.2rem;
}

.illu-strip.illu-strip--step .gallery-item {
  width: 9rem;
  height: 9rem;
}

@media (min-width: 768px) {
  .illu-strip.illu-strip--step .gallery-item {
    width: 10.5rem;
    height: 10.5rem;
  }
}

/*
 * Full standing shot of Agnes with framed team portraits.
 * Contain + max-height keeps her head, body and all six frames in view
 * (the old square object-cover crop cut her at the neck).
 */
.featured-agnes {
  display: flex;
  justify-content: center;
  width: 100%;
  background: #f9f7f2;
  /* A little paper mat above and below so the gold frame is not flush with the photo */
  padding: 0.6rem 0;
}

.featured-agnes img {
  width: auto;
  height: auto;
  max-width: 100%;
  /* Leave room for the sticky header so the full figure fits on first view */
  max-height: min(calc(100vh - 8rem), 26rem);
  object-fit: contain;
  display: block;
}

/* Larger 2x3 references gallery — landscape event photos */
.ref-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .ref-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .ref-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ref-grid .gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid #c3c3c3;
}

.ref-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

/* 3D flip cards — minigame */
.flip-grid {
  perspective: 1200px;
}

.flip-card {
  aspect-ratio: 3 / 4;
  cursor: pointer;
  outline: none;
}

.flip-card:focus-visible {
  box-shadow: 0 0 0 3px #d5a954;
  border-radius: 0.75rem;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: 0.75rem;
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid #c5a059;
}

.flip-face--back {
  transform: rotateY(180deg);
}

.flip-face--bad {
  background: #c8c8c8;
  padding: 0;
  text-align: center;
}

.fake-portrait {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 3.2rem;
  width: 100%;
  height: calc(100% - 3.2rem);
  background: #9aa3ad;
}

.fake-portrait-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.4rem 0.5rem 0.5rem;
  line-height: 1.3;
  font-size: 1.05rem;
  background: #ececec;
}

.game-replay-btn {
  cursor: pointer;
  background: transparent;
}

.flip-face--good {
  background: #f9f7f2;
}

.flip-face--good img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9f7f2;
}

/* Victory banner */
.victory-banner {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease,
    visibility 0s linear 0.5s;
}

.victory-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  max-height: 32rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease,
    visibility 0s;
}

/* Default gallery hover (framed thumbs only; Agnes stays uncropped) */
.gallery-item img {
  display: block;
  width: 100%;
}

/* Must follow .gallery-item img so width:auto wins — never crop Agnes */
.gallery-item.featured-agnes img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(calc(100vh - 8rem), 26rem);
  object-fit: contain;
  border-radius: 0.9rem;
  transform: none;
  transition: none;
}

.gallery-item.featured-agnes:hover img,
.gallery-item.featured-agnes:focus-visible img {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .illu-strip img,
  .illu-grid img,
  .ref-grid img,
  .package-photo img {
    transition: none;
  }

  .illu-strip .gallery-item:hover img,
  .illu-strip .gallery-item:focus-visible img,
  .illu-grid .gallery-item:hover img,
  .illu-grid .gallery-item:focus-visible img,
  .ref-grid .gallery-item:hover img,
  .ref-grid .gallery-item:focus-visible img,
  .package-photo:hover img,
  .package-photo:focus-visible img {
    transform: none;
  }
}

/* Minimal privacy notice (footer button, no external privacy page) */
#privacy-open {
  font: inherit;
}

.privacy-popup {
  z-index: 210;
}

.privacy-popup__panel {
  position: relative;
  max-width: 36rem;
  width: 100%;
  background: #f9f7f2;
  color: #2d2d2d;
  border: 2px solid #d5a954;
  border-radius: 0.9rem;
  padding: 2.35rem 1.75rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.privacy-popup .lightbox__close {
  top: 0.7rem;
  right: 0.7rem;
}

.process-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .process-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
  }
}

.process-card {
  background: #fff;
  border: 1px solid #c3c3c3;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem 1.1rem;
}

.process-card__title {
  font-family: Ruluko, sans-serif;
  color: #c5a059;
  font-size: 1.3rem;
  margin: 0 0 0.65rem;
}

.process-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.process-list li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.75rem;
  font-family: Ruluko, sans-serif;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #2d2d2d;
  border-bottom: 1px solid rgba(195, 195, 195, 0.55);
}

.process-list li:last-child {
  border-bottom: none;
}

.process-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: #d5a954;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.25rem;
  text-align: center;
}

.process-list--inline li {
  padding-left: 1.75rem;
}

.guide-accordions {
  max-width: 48rem;
}

.guide-accordions .faq-item {
  margin-bottom: 0.35rem;
}

/* Leitfaden — readable accordion body copy */
.guide-accordions .faq-trigger {
  padding: 1rem 1.25rem;
  line-height: 1.45;
  font-size: 1.25rem;
}

.guide-accordions .faq-item.is-open .faq-panel-inner {
  visibility: visible;
  padding-bottom: 0.25rem;
}

.guide-accordions .faq-panel-inner p {
  padding: 0.7rem 1.25rem 1rem;
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.75;
  color: rgba(45, 45, 45, 0.92);
}

.guide-accordions .faq-panel-inner p + p {
  padding-top: 0.15rem;
}

.guide-accordions .faq-panel-inner p:first-child {
  padding-top: 0.85rem;
}

.guide-accordions .faq-panel-inner strong {
  font-weight: 700;
  color: #2d2d2d;
}

.guide-prose p {
  font-size: 1.25rem;
  line-height: 1.75;
  margin: 0;
  padding: 0 0.15rem;
}

.guide-prose p + p {
  margin-top: 1rem;
}

.guide-prose strong {
  font-weight: 700;
  color: #2d2d2d;
}

.guide-prose {
  max-width: 42rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .flip-card-inner {
    transition-duration: 0.01ms;
  }
}
