/* ==========================================================================
   FOREIGN GROUNDS — COMPONENTS
   nav pill · footer · image placeholder · facts · tiles ·
   filter · accordion · contact block
   ========================================================================== */

/* ---------- NAV — fixed pill, bottom centre (as on Patina) -------------- */

.nav {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-bottom) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: var(--z-nav);
  max-width: calc(100vw - 2 * var(--space-4));
}
.nav__list {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  height: var(--nav-height);
  padding: var(--nav-padding-y) var(--nav-padding-x);
  border: var(--nav-border);
  border-radius: var(--nav-radius);
  background: var(--nav-fill);
  -webkit-backdrop-filter: blur(var(--nav-blur));
  backdrop-filter: blur(var(--nav-blur));
  white-space: nowrap;
}
.nav__brand,
.nav__link {
  display: inline-block;
  font-size: var(--text-nav);
  line-height: 1;
  letter-spacing: var(--tracking-nav);
  padding-block: var(--space-1);
  text-decoration: underline;
  text-decoration-thickness: var(--rule-width);
  text-underline-offset: 0.3em;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--duration-fast) var(--ease-out);
}
.nav__brand { display: inline-flex; align-items: center; text-decoration: none; }
/* Links in the bar turn brand red on hover and on the page you are on — no underline.
   (The F_G mark keeps its own hover: the line stretches.) */
.nav__link { text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--color-accent); }
.nav__lang { font: inherit; font-size: var(--text-nav); letter-spacing: var(--tracking-nav); line-height: 1; cursor: pointer; }

@media (max-width: 30em) {
  .nav__list { gap: var(--nav-gap-mobile); padding-inline: var(--nav-padding-x-mobile); }
  .nav__link, .nav__lang { font-size: var(--text-nav-mobile); }
}

/* ---------- WORDMARK — FOREIGN___GROUNDS / F_G, set in live type ------ */
/* Built from text (not an image), so every letter and the line can move.
   Proportions measured against the logo files Alex sent (29.09.2026). */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-logo);
  font-weight: var(--wordmark-weight);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.wordmark__word { letter-spacing: var(--wordmark-tracking); }
.wordmark__word:last-child .ch:last-child { letter-spacing: 0; }   /* no trailing gap */
.ch { display: inline-block; }
.wordmark__line {
  display: inline-block;
  position: relative;
  top: calc(var(--wordmark-stroke) * 0.3);   /* straddles the baseline a little, as in the logo */
  width: var(--wordmark-line);
  height: var(--wordmark-stroke);
  margin-left: var(--wordmark-line-before);
  margin-right: var(--wordmark-line-after);
  background: currentColor;
  transform-origin: left center;
}

/* The small mark in the bar: F_G, heavier and tight; the line stretches on hover */
.wordmark--mark {
  --wordmark-weight: var(--mark-weight);
  font-size: var(--logo-nav-size);
  letter-spacing: 0;
}
.wordmark--mark .wordmark__line {
  top: calc(var(--mark-stroke) + 0.02em);     /* a real underscore: just below the baseline */
  width: var(--mark-line);
  height: var(--mark-stroke);
  margin: 0 0.07em 0 0.01em;
  transition: width var(--duration-base) var(--ease-out);
}
.nav__brand:hover .wordmark__line { width: var(--mark-line-hover); }

/* ---------- FOOTER ------------------------------------------------------ */

.footer {
  margin-top: auto;
  padding-top: var(--space-5);
  border-top: var(--rule-width) solid var(--color-rule);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.footer a.meta { transition: color var(--duration-fast) var(--ease-out); }
.footer a.meta:hover { color: var(--color-ink); }

/* ---------- IMAGE PLACEHOLDER ------------------------------------------ */
/* <figure class="ph" style="--ratio: 4 / 5"><span class="ph__label">Bild · …</span></figure>
   When real photos arrive: put an <img> inside the figure, the label goes. */

.ph {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio, 16 / 9);
  overflow: hidden;
  background: var(--color-paper-3);
}
.ph::before {                                 /* the tone breathes very slowly */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-paper-4);
  opacity: 0;
  animation: ph-breathe var(--media-pulse) var(--ease-in-out) infinite alternate;
}
@keyframes ph-breathe { to { opacity: 0.7; } }
.ph > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph__label {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  right: var(--space-3);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  line-height: var(--leading-normal);
  color: var(--color-media-label);
}

/* ---------- FACTS — small definition list next to prose ---------------- */

.facts { display: grid; gap: 0; border-top: var(--rule-width) solid var(--color-rule); }
.facts__item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: var(--rule-width) solid var(--color-rule);
}
.facts dt { padding-top: 0.15em; }
.facts dd { line-height: var(--leading-normal); }

/* ---------- TILES — image + caption, used for case studies ------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-grid-row) var(--space-grid);
}
@media (max-width: 60em) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tile { display: grid; gap: var(--space-caption); align-content: start; }
.tile .ph { transition: transform var(--duration-base) var(--ease-out); }
.tile__caption { display: grid; gap: var(--space-1); }
.tile__name { font-size: var(--text-title); font-weight: var(--font-weight-medium); line-height: var(--leading-snug); letter-spacing: var(--tracking-title); }
.tile__sub { color: var(--color-ink-2); font-size: var(--text-small); }
.tile.is-hidden { display: none; }

/* ---------- FILTER — quiet chips over the case-study grid ------------- */

.filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.filter__chip {
  padding: var(--space-2) var(--space-4);
  border: var(--rule-width) solid var(--color-rule);
  border-radius: var(--nav-radius);
  font-size: var(--text-small);
  line-height: 1.2;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}
.filter__chip:hover { border-color: var(--color-rule-strong); }
.filter__chip[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }

/* ---------- ACCORDION (FAQ) ------------------------------------------- */

.faq { border-top: var(--rule-width) solid var(--color-rule); max-width: 48rem; margin-inline: auto; }
.faq__item { border-bottom: var(--rule-width) solid var(--color-rule); }
.faq__q {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-5);
  padding-block: var(--space-5);
  cursor: pointer;
  list-style: none;
  font-size: var(--text-title);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-title);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__sign {
  flex: none;
  width: 0.8em; height: 0.8em;
  position: relative;
  transition: transform var(--duration-base) var(--ease-out);
}
.faq__sign::before, .faq__sign::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1.5px solid currentColor;
}
.faq__sign::after { transform: rotate(90deg); transition: transform var(--duration-base) var(--ease-out); }
.faq__item[open] .faq__sign::after { transform: rotate(0deg); }
.faq__a { overflow: hidden; }
.faq__a > div { padding-bottom: var(--space-6); max-width: var(--text-max); color: var(--color-ink-2); }
.faq__a p + p { margin-top: var(--space-3); }

/* ---------- CONTACT BLOCK — closes most pages ------------------------- */

.contact {
  display: grid;
  justify-items: center;
  gap: var(--space-5);
  text-align: center;
}
.contact__mail {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-statement);
  font-size: var(--text-row);
  line-height: var(--leading-tight);
  text-decoration: underline;
  text-decoration-thickness: var(--rule-width);
  text-underline-offset: 0.18em;
  color: var(--color-accent);
  text-decoration-color: currentColor;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.contact__mail:hover { opacity: 0.75; }

/* "Anfragen" under each service: italic, turns red, opens a mail with the right subject */
.inquire {
  display: inline-block;
  margin-top: var(--space-5);
  font-style: italic;
  font-size: var(--text-lead);
  letter-spacing: var(--tracking-statement);
  transition: color var(--duration-fast) var(--ease-out);
}
.inquire::after { content: " →"; font-style: normal; }
.inquire:hover { color: var(--color-accent); }

/* Filter change: the grid dips out, re-orders, the tiles rise in again */
.tiles { transition: opacity var(--duration-fast) var(--ease-in-out); }
.tiles.is-fading { opacity: 0; transition-duration: 260ms; }

/* Tiles are links to their case study: the image draws back a touch on hover */
.js a.tile:hover .ph.is-visible { transform: scale(0.985); transition-duration: var(--duration-base); transition-delay: 0ms; }
a.tile:hover .tile__name { text-decoration: underline; text-decoration-thickness: var(--rule-width); text-underline-offset: 0.2em; }

/* Real media inside a placeholder: fills the box, cropped to its ratio */
.ph > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph.has-media::before { display: none; }
