/* components.css — Reusable UI patterns plus page-specific section styles.
 * Buttons, cards, badges, header, footer, hero, services, about, team,
 * values, references, contact and legal pages. */

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition),
              color var(--transition),
              border-color var(--transition),
              box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-bg-alt);
  border-color: var(--color-accent);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: var(--color-bg-alt);
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */

/*
 * .card — Shared base for all card components.
 *
 * All cards across the site (services, team, values,
 * references, contact) use this base for consistent
 * borders, radius, padding and background. Variants
 * add their own internal layout on top.
 *
 * Interactive cards (clickable, link to a detail view)
 * also get .card--interactive which adds hover effects.
 * Non-interactive cards omit this modifier so the page
 * does not invite clicks where nothing happens.
 */
.card {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
  transition: transform var(--transition),
              box-shadow var(--transition),
              border-color var(--transition);
}

/*
 * Interactive card variant — only applied where the card
 * is genuinely clickable. Hover signals to the user that
 * interaction is possible.
 */
.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

/*
 * Compact variant — same visual style but less padding.
 * Used for content-light cards where the default padding
 * feels too generous.
 */
.card--compact {
  padding: var(--space-6);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

/*
 * Transparent floating header.
 * The header floats over whatever section is beneath it, with a
 * subtle backdrop blur to keep navigation readable over any content.
 *
 * On scroll, a faint glass tint and soft shadow are added so the
 * header separates from the content without a harsh divider line.
 */
.op-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: transparent;
  border-bottom: none;
  transition: background var(--transition), box-shadow var(--transition);
  overflow: visible;
}

/*
 * When scrolled, add a faint theme-aware tint (--glass-bg) and a soft
 * shadow so navigation stays readable over light content areas without
 * a hard divider line.
 */
.op-header.is-scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

.op-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.op-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.op-header__logo-img {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 8px;
  padding: 4px;
  transform-origin: center;
  will-change: transform, background, box-shadow;
}

/* Inline-SVG logo fills — theme-aware via tokens. Transition smooths the
 * crossover when the hero-morph override is removed. */
.op-logo__mountain     { fill: var(--color-accent);  transition: fill 0.2s ease; }
.op-logo__mountain-alt { fill: var(--color-primary); opacity: 0.4; transition: fill 0.2s ease; }
.op-logo__text         { fill: var(--color-primary); transition: fill 0.2s ease; }

/* While the logo sits on its white morph-card (hero top), force light-mode
 * colours regardless of the active theme — the hero background is the same
 * dark navy in both themes, and the card mimics a light-mode header. JS
 * toggles data-logo-on-card based on morph progress. */
.op-header[data-logo-on-card="1"] .op-logo__mountain     { fill: #4a9eba; }
.op-header[data-logo-on-card="1"] .op-logo__mountain-alt { fill: #1a2e4a; }
.op-header[data-logo-on-card="1"] .op-logo__text         { fill: #1a2e4a; }

/* Overlay topbar logo uses the inline SVG include with its own sizing. */
.op-overlay__logo {
  height: 44px;
  width: auto;
  display: block;
}

/*
 * Temporary text wordmark in the header.
 * Replaces a logo image until the final logo is available.
 * Uses brand colors and DM Serif Display font for a
 * distinctive, professional appearance.
 */
.header-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--transition), opacity var(--transition-slow);
}

/* Living topographic logo mark (see js/logo-mark.js). */
.header-mark {
  width: 44px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #0f1724;
  border: 1px solid rgba(74, 158, 186, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.header-wordmark:hover {
  color: var(--color-accent);
}

/* In dark mode, the wordmark uses the lighter text color */
[data-theme="dark"] .header-wordmark {
  color: var(--color-text);
}

/*
 * At the very top of the home page the hero already shows the FIRNTEC
 * tagline, so the header wordmark is hidden and fades in once the user
 * scrolls (header gains .is-scrolled). The light colour applies during
 * the fade while the header still floats over the dark hero. Legal pages
 * always carry .is-scrolled, so the wordmark stays visible there.
 */
.op-header:not(.is-scrolled) .header-wordmark {
  color: #fff;
  opacity: 0;
}

.op-header:not(.is-scrolled) .header-wordmark:hover {
  color: var(--color-accent);
}

.op-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ─── Language switcher ──────────────────────────────────────────────────── */

.op-header__lang {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.op-header__lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.2s, background 0.15s;
}

.op-header__lang-link.is-active {
  color: var(--color-primary);
}

.op-header__lang-link:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.op-header:not(.is-scrolled) .op-header__lang-link {
  color: rgba(255, 255, 255, 0.6);
}

.op-header:not(.is-scrolled) .op-header__lang-link.is-active,
.op-header:not(.is-scrolled) .op-header__lang-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.op-header__lang-sep {
  color: var(--color-text-muted);
  opacity: 0.4;
  font-size: 11px;
}

.op-header:not(.is-scrolled) .op-header__lang-sep {
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Menu (hamburger) button ────────────────────────────────────────────── */

/*
 * Hamburger menu toggle.
 *
 * Uses inline SVG with stroke-linecap: round for crisp
 * line ends on all screen densities. Integer viewBox
 * coordinates prevent subpixel blur. Stroke width 2 at
 * 24x24 viewBox gives clear lines at typical 36px button
 * size without needing fractional pixels.
 */
.op-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--border-radius);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition),
              color var(--transition);
}

.op-menu-btn:hover {
  background: var(--color-border);
  color: var(--color-accent);
}

.op-menu-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

/*
 * When the header sits over the dark hero (not scrolled),
 * the icon stroke is light. The SVG inherits currentColor,
 * so we only override the button's color here.
 */
.op-header:not(.is-scrolled) .op-menu-btn {
  color: rgba(255, 255, 255, 0.85);
}

/* ─── Fullscreen menu overlay ────────────────────────────────────────────── */

.op-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #1a2e4a;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.35s ease, clip-path 0.45s cubic-bezier(0.77, 0, 0.175, 1);
}

.op-overlay.is-open {
  opacity: 1;
  pointer-events: all;
  clip-path: inset(0 0 0% 0);
}

.op-overlay__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-6) 0;
}

.op-overlay__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: calc((100% - min(1200px, 100% - 2 * var(--space-6))) / 2 + var(--space-6));
  height: 64px;
  flex-shrink: 0;
}

.op-overlay__topbar img {
  height: 44px;
  width: auto;
}

.op-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-2);
  border-radius: 4px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.op-close-btn:hover { color: #fff; }

.op-overlay__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.op-overlay__link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-3) var(--space-8);
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  opacity: 0;
  transform: translateY(8px);
}

.op-overlay.is-open .op-overlay__link {
  opacity: 1;
  transform: translateY(0);
  transition: color 0.2s, background 0.2s, opacity 0.35s ease, transform 0.35s ease;
}

.op-overlay__link:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.op-overlay__link.is-active { color: #fff; }

/* Staggered entry */
.op-overlay.is-open .op-overlay__link:nth-child(1) { transition-delay: 0ms; }
.op-overlay.is-open .op-overlay__link:nth-child(2) { transition-delay: 60ms; }
.op-overlay.is-open .op-overlay__link:nth-child(3) { transition-delay: 120ms; }
.op-overlay.is-open .op-overlay__link:nth-child(4) { transition-delay: 180ms; }
.op-overlay.is-open .op-overlay__link:nth-child(5) { transition-delay: 240ms; }
.op-overlay.is-open .op-overlay__link:nth-child(6) { transition-delay: 300ms; }

.op-overlay__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding-inline: calc((100% - min(1200px, 100% - 2 * var(--space-6))) / 2 + var(--space-6));
  padding-block: var(--space-6);
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.op-overlay__bottom-text {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(120% 90% at 70% 20%, #16263e 0%, #0f1724 60%, #0b121d 100%);
}

/* Full-bleed topographic canvas (see js/topo.js) behind the hero text. */
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  animation: heroFadeUp 1000ms ease 150ms forwards;
}

/* Frosted scrim that keeps the hero text legible over the animation.
 * Strong on the left (blurring the canvas), fading out toward the right
 * so the topographic map stays crisp where there is no text. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  background: linear-gradient(to right,
    rgba(15, 23, 36, 0.6) 0%,
    rgba(15, 23, 36, 0.36) 46%,
    rgba(15, 23, 36, 0) 72%);
  -webkit-mask-image: linear-gradient(to right, #000 48%, transparent 72%);
  mask-image: linear-gradient(to right, #000 48%, transparent 72%);
}

@media (max-width: 768px) {
  .hero__scrim {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(15, 23, 36, 0.48);
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-24) var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .hero__content {
    min-height: auto;
    padding-top: calc(var(--header-height, 64px) + var(--space-16));
    padding-bottom: var(--space-16);
  }
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 600px;
}

.hero__text h1 { margin: 0; }

@media (max-width: 640px) {
  .hero__text {
    align-items: center;
    text-align: center;
  }
}

.hero__tagline {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.15em;
  margin: 0 0 var(--space-4);
}

.hero__title {
  display: block;
  font-family: var(--font-family);
  font-size: var(--font-size-hero);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.1;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp 600ms ease forwards;
}

.hero__title--1 { animation-delay: 0ms; }
.hero__title--2 { animation-delay: 150ms; }
.hero__title--3 { animation-delay: 300ms; }

.hero__subtitle {
  margin-top: var(--space-6);
  font-size: var(--font-size-lg);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  max-width: 480px;
  opacity: 0;
  animation: heroFadeUp 600ms ease 450ms forwards;
}

.hero__actions {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeUp 600ms ease 550ms forwards;
}

@media (max-width: 640px) {
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

.hero__btn-outline {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero__btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--color-bg-alt);
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  animation: scrollBounce 2s ease-in-out infinite;
}

/* ─── Section intro ──────────────────────────────────────────────────────── */

.op-section-intro {
  text-align: center;
  margin-bottom: var(--space-12);
}

.op-section-intro__title {
  font-family: var(--font-family);
  font-size: var(--font-size-hero);
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
}

.op-section-intro__sub {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin-inline: auto;
  line-height: 1.75;
  margin-top: 0;
}

/*
 * Services grid — three equal cards on desktop,
 * single column on mobile/tablet.
 * Each card holds an icon, number, title and description.
 */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-12);
}

@media (max-width: 968px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/*
 * Individual service card. Base visual style (background, border,
 * radius, padding) comes from .card. Service cards are NOT
 * interactive, so they get no hover lift.
 */
.service-card {
  display: flex;
  flex-direction: column;
}

/*
 * Icon container at the top of each card.
 * Uses accent colour and a soft background tint
 * to make the icon a focal point.
 */
.service-card__icon {
  width: 56px;
  height: 56px;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.service-card__icon svg {
  width: 28px;
  height: 28px;
}

.service-card h3 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.3;
}

.service-card p {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 0;
}

/* ─── About ──────────────────────────────────────────────────────────────── */

.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  margin-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .about-intro {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.about-story {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about-story-figure {
  margin: 0;
}

.about-story-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-lg);
}

.about-story-figure figcaption {
  margin-top: var(--space-2);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  text-align: right;
}

/* ─── Team ───────────────────────────────────────────────────────────────── */

/* Same full-width 2-column system as .values-grid below — the team
 * grid previously used a one-off 720px cap that left the cards far
 * narrower than every other card row in this section. */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-12);
}

@media (max-width: 768px) {
  .team-grid { grid-template-columns: 1fr; }
}

/* Base card styles come from .card. Not interactive — no hover.
 * Left-aligned vertical stack (avatar top-left, text below) — mirrors
 * the .value-card structure so both card rows in this section read the
 * same. Stays robust at every card width, unlike a photo-beside-text
 * layout which would need the grid to collapse earlier than .values-grid. */
.team-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: var(--space-3);
}

.team-card__photo {
  width: 128px;
  height: 128px;
  flex-shrink: 0;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--color-bg-alt);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--color-bg-alt);
}

.team-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card__name {
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-primary);
  margin: 0;
}

.team-card__role {
  font-size: var(--font-size-sm);
  color: var(--color-accent);
  font-weight: 500;
  margin: 0;
}

.team-card__bio {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ─── Values ─────────────────────────────────────────────────────────────── */

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-12);
}

@media (max-width: 768px) {
  .values-grid {
    grid-template-columns: 1fr;
  }
}

/* .value-card needs no own box styles — base comes from .card.
 * Not interactive, so no hover. */

.value-card__icon {
  width: 48px;
  height: 48px;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--color-accent);
}

.value-card__icon svg {
  width: 24px;
  height: 24px;
}

.value-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
}

.value-card p {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 0;
}

/* ─── References ─────────────────────────────────────────────────────────── */

.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

@media (max-width: 768px) {
  .ref-grid { grid-template-columns: 1fr; }
}

/* Full-width call-to-action closing the references grid — invites the
 * visitor to become the next reference. Spans both grid columns. */
.ref-cta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-8);
  border: 1px solid var(--color-card-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--border-radius-lg);
  background: rgba(var(--color-accent-rgb), 0.05);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.ref-cta:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.ref-cta__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.ref-cta__title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  color: var(--color-text);
  line-height: 1.2;
}
.ref-cta__sub {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}
.ref-cta__btn {
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .ref-cta { flex-direction: column; align-items: flex-start; }
  .ref-cta__btn { width: 100%; justify-content: center; }
}

/* Base card styles come from .card; hover lift from .card--interactive.
 * Override padding to 0 — the accent bar is full-bleed and the inner
 * .ref-card__body supplies the padding. overflow:hidden clips the
 * accent bar and gallery image to the rounded corners. */
.ref-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ref-card__accent-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary-light));
}

/*
 * Interactive reference cards open an image gallery on click. A subtle
 * arrow in the bottom-right corner signals the whole card is clickable;
 * it shifts right and turns accent-coloured on hover. It sits in the
 * card's bottom-right padding, clear of the preview image and its badge.
 */
.ref-card.card--interactive {
  position: relative;
}

.ref-card.card--interactive::after {
  content: "→";
  position: absolute;
  bottom: var(--space-6);
  right: var(--space-6);
  font-size: var(--font-size-xl);
  line-height: 1;
  color: var(--color-text-muted);
  opacity: 0.6;
  transition: color var(--transition),
              transform var(--transition),
              opacity var(--transition);
  pointer-events: none;
}

.ref-card.card--interactive:hover::after {
  color: var(--color-accent);
  transform: translateX(4px);
  opacity: 1;
}

/* Cards whose click target is the gallery image already signal that they
 * are clickable through the thumbnail itself. The bare corner arrow would
 * overlap the image's bottom-right corner, so suppress it on those cards. */
.ref-card.card--interactive:has(.ref-card__gallery)::after {
  content: none;
}

.ref-card__body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}

.ref-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background-color: rgba(var(--color-accent-rgb), 0.1);
  border: 1px solid rgba(var(--color-accent-rgb), 0.25);
  border-radius: 9999px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-accent);
  width: fit-content;
}

.ref-card__title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0;
}

.ref-card__text {
  color: var(--color-text-muted);
  line-height: 1.75;
  margin: 0;
}

.ref-card__techs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/*
 * Optional image gallery inside a reference card.
 * Shows a single cover image with a count badge — clicking opens
 * the full-screen lightbox where the rest can be navigated.
 */
.ref-card__gallery {
  /* Pin the cover image to the card's bottom edge so both reference
   * cards' images line up even when their tech-tag rows differ in height.
   * The flex container's gap keeps the minimum spacing above it. */
  margin-top: auto;
}

.ref-image-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.ref-image-thumb:hover,
.ref-image-thumb:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ref-image-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.ref-image-thumb__count {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.ref-image-data { display: none; }

/* ─── Lightbox ────────────────────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.lightbox[hidden] { display: none; }

.lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--border-radius);
  background: #000;
}

/* Zoom mode — tap on image switches to native pixel size with the
 * lightbox itself acting as the scroll container so the user can pan
 * around the full-resolution screenshot on mobile. */
.lightbox.is-zoomed {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.lightbox.is-zoomed .lightbox__figure {
  max-width: none;
  max-height: none;
}

.lightbox.is-zoomed .lightbox__img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  border-radius: 0;
  cursor: zoom-out;
}

/* Hide secondary chrome in zoom mode: caption + counter clutter the
 * pannable view, and prev/next sit where the user pans with their
 * thumb. Close stays so there's always an explicit exit. */
.lightbox.is-zoomed .lightbox__caption,
.lightbox.is-zoomed .lightbox__counter,
.lightbox.is-zoomed .lightbox__prev,
.lightbox.is-zoomed .lightbox__next {
  display: none;
}

.lightbox__caption {
  color: #fff;
  text-align: center;
  font-size: var(--font-size-base);
  max-width: 80vw;
}

.lightbox__counter {
  position: absolute;
  top: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
  letter-spacing: 0.05em;
}

.lightbox__close,
.lightbox__zoom,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox__close:hover,
.lightbox__zoom:hover,
.lightbox__prev:hover,
.lightbox__next:hover,
.lightbox__close:focus-visible,
.lightbox__zoom:focus-visible,
.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox__close { top: var(--space-6); right: var(--space-6); }
.lightbox__zoom  { top: var(--space-6); left:  var(--space-6); }
.lightbox__prev  { left:  var(--space-6); top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: var(--space-6); top: 50%; transform: translateY(-50%); }

/* Zoom-state indicator. Same circle button visuals as close/prev/next
 * so it reads as part of the lightbox chrome, and swaps between a
 * magnifier-plus and magnifier-minus glyph based on .is-zoomed.
 * Stays anchored to the viewport (position: fixed via .lightbox) even
 * when the image overflows and the lightbox scrolls. */
.lightbox__zoom {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__zoom-icon { display: block; }
.lightbox__zoom-icon--out { display: none; }

.lightbox.is-zoomed .lightbox__zoom-icon--in { display: none; }
.lightbox.is-zoomed .lightbox__zoom-icon--out { display: block; }

.lightbox__prev:disabled,
.lightbox__next:disabled {
  opacity: 0.3;
  cursor: default;
}

@media (max-width: 768px) {
  .lightbox { padding: var(--space-4); }
  .lightbox__close { top: var(--space-3); right: var(--space-3); }
  .lightbox__zoom  { top: var(--space-3); left:  var(--space-3); }
  .lightbox__prev  { left:  var(--space-3); }
  .lightbox__next  { right: var(--space-3); }
  .lightbox__img   { cursor: zoom-in; }
  .lightbox.is-zoomed .lightbox__img { cursor: zoom-out; }
}

/* Zoom is mobile-only — the desktop screenshots are legible at fit
 * size, so we hide the zoom affordance and pin the image at fit. */
@media (min-width: 769px) {
  .lightbox__zoom { display: none; }
}

.tech-tag {
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-family: monospace;
}

/* ─── Contact ────────────────────────────────────────────────────────────── */

/*
 * Contact section two-column grid.
 * Booking card left, contact info right.
 * align-items: stretch makes both cards fill the
 * full height of the grid row automatically,
 * regardless of which card has more content.
 */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: stretch;
  max-width: 780px;
  margin: var(--space-12) auto 0;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
}

/*
 * Kontakt is the last section before the footer. Sized so the anchor
 * scroll bottoms the document out exactly when kontakt-top hits its
 * scroll-margin: kontakt + footer = viewport - scroll-margin. nav.js
 * sets style.minHeight precisely at runtime (footer height varies
 * with viewport width). This CSS value is the no-JS fallback —
 * approximate but close enough to avoid the page coming up short.
 */
#kontakt {
  min-height: calc(100vh - var(--header-height, 72px) - 24px - 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/*
 * Booking card — left column.
 */
/* Base card styles + compact padding come from .card / .card--compact.
 * Not interactive — no hover. */
.booking-card {
  height: 100%;
  box-sizing: border-box;
}

.booking-card h3 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  margin: 0 0 var(--space-2) 0;
}

.booking-card p {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
  line-height: 1.6;
}

/*
 * Full-width CTA button inside booking card.
 */
.booking-card__cta {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  margin-top: 0;
}

/*
 * Contact info card — right column.
 * Displays email and location as labeled rows.
 */
/* Base card styles + compact padding come from .card / .card--compact.
 * Not interactive — no hover. */
.contact-info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
  box-sizing: border-box;
}

/*
 * Single contact info row — label above, value below.
 * Tight gap so the label sits close to its value.
 */
.contact-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-info-item__label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-info-item__value {
  font-size: var(--font-size-base);
  color: var(--color-text);
  text-decoration: none;
}

a.contact-info-item__value {
  color: var(--color-accent);
}

a.contact-info-item__value:hover {
  color: var(--color-accent-hover);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  background-color: #1a2e4a;
  color: rgba(255, 255, 255, 0.7);
  padding-block: var(--space-8);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer__copyright,
.site-footer__cookies {
  font-size: var(--font-size-sm);
  margin: 0;
}

.site-footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-footer__link {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color var(--transition);
}

.site-footer__link:hover {
  color: var(--color-bg-alt);
}

.site-footer__separator {
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Legal pages (impressum, datenschutz) ───────────────────────────────── */

/* Sticky-footer + viewport-aware spacing:
 *
 * - flex: 1 makes the main area grow to fill remaining space so the
 *   footer is pinned to the viewport bottom on short pages (Impressum).
 * - Paddings and section gaps use clamp(min, Xvh, max) so spacing
 *   contracts on shorter viewports — the longer Datenschutz page fits
 *   without scrolling on common desktop heights, while taller screens
 *   keep generous breathing room. */
.legal-page {
  flex: 1;
  padding-top: calc(var(--header-height, 64px) + clamp(var(--space-4), 4vh, var(--space-12)));
  padding-bottom: clamp(var(--space-4), 3vh, var(--space-10));
  background: var(--color-bg);
}

.legal-page__title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-hero);
  color: var(--color-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(var(--space-4), 4vh, var(--space-12));
}

.legal-page__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

.legal-page__back:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.legal-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: clamp(var(--space-3), 2.5vh, var(--space-8));
  max-width: 800px;
}

.legal-block__title {
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-primary);
  margin: 0;
}

.legal-block p {
  color: var(--color-text-muted);
  line-height: 1.75;
  margin: 0;
}

.legal-link {
  color: var(--color-accent);
  text-decoration: underline;
}

.legal-notice {
  margin: 0 0 var(--space-8);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-bg-alt);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
}

/* Pull the notice close to the title. The negative offset scales with
 * the viewport height in lockstep with the title's own bottom margin
 * (both use vh-based clamps), so the visible gap stays small without
 * the notice ever overlapping the title on short viewports. */
.legal-page__title + .legal-notice {
  margin-top: calc(-1 * clamp(var(--space-2), 3vh, var(--space-8)));
}

/*
 * About section divider — thin horizontal rule
 * to visually separate story, team and values
 * within the combined section.
 */
.about-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-12) 0;
}

/*
 * Subtitle within the about section —
 * smaller than the main section headline,
 * introduces team and values subsections.
 */
.about-subtitle {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  color: var(--color-text);
  margin: 0 0 var(--space-8) 0;
  text-align: center;
}
