/* =====================================================================
   RELMOS — relmos.ch
   Dachgesellschaft / Company-Builder. Editorial, ruhig, hochwertig.
   Eine Schrift (Inter), ein Akzent (Terracotta).
   ===================================================================== */

:root {
  --bg:        #F7F5F3;            /* warmes Creme / Off-White */
  --ink:       #141414;            /* fast-schwarz */
  --accent:    #B35B5F;            /* Terracotta */
  --accent-2:  #9a4a4e;            /* Terracotta dunkler (hover) */
  --muted:     #808080;            /* Grau, Sekundaertext */
  --muted-2:   #666666;            /* dunkleres Grau */
  --white:     #FFFFFF;
  --hairline:  rgba(20,20,20,0.15);
  --hairline-2:rgba(20,20,20,0.08);

  --maxw: 1380px;
  --pad:  clamp(20px, 6vw, 96px);
  --section-y: clamp(80px, 13vh, 180px);

  --ff: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ----- Layout helpers ----- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--section-y); position: relative; }
.section + .section { border-top: 1px solid var(--hairline-2); }

/* Anchor-Offset wegen fixiertem Header */
[id] { scroll-margin-top: 92px; }

/* Trennlinien zwischen den Hauptsektionen */
.brands, #wie-wir-arbeiten { border-top: 1px solid var(--hairline-2); }

/* ----- Type ----- */
h1, h2, h3 { font-weight: 200; letter-spacing: -0.02em; line-height: 1.04; }
.h-xxl { font-size: clamp(2.6rem, 8.5vw, 7rem); }
.h-xl  { font-size: clamp(2.4rem, 6.5vw, 5.4rem); }
.h-l   { font-size: clamp(1.9rem, 4vw, 3.2rem); }
.accent { color: var(--accent); }
.dot { color: var(--accent); }

.lead { font-size: clamp(1.05rem, 1.7vw, 1.4rem); color: var(--muted-2); font-weight: 300; line-height: 1.55; }

/* ----- Section label  (01) Wer wir sind ----- */
.label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  display: inline-flex;
  gap: 0.6em;
  align-items: baseline;
}

/* ----- CTA: text + arrow, no box ----- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  padding-block: 0.4em;
  position: relative;
  transition: color 0.3s var(--ease);
}
.cta .arrow { transition: transform 0.4s var(--ease); display: inline-block; }
.cta::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(var(--u, 0.18));
  transform-origin: left;
  opacity: 0.4;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.cta:hover { color: var(--accent); }
.cta:hover .arrow { transform: translateX(6px); }
.cta:hover::after { transform: scaleX(1); opacity: 1; }
.cta--muted { color: var(--muted-2); }

/* =====================================================================
   HEADER
   ===================================================================== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(16px, 2.4vw, 26px) var(--pad);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(247,245,243,0.82);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom-color: var(--hairline-2);
  padding-block: clamp(12px, 1.6vw, 16px);
}
/* Bei offenem Menü verschmilzt der Header mit dem Terracotta-Overlay; alles wird weiss, das Hamburger-Icon zum Schliessen-X */
body.nav-open .site-header { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: transparent; }
body.nav-open .brand-logo img { filter: brightness(0) invert(1); }
body.nav-open .menu-toggle span { background: #fff; }
body.nav-open .lang-switch button { color: rgba(255,255,255,0.6); }
body.nav-open .lang-switch button.is-active { color: #fff; }
body.nav-open .lang-switch .sep { color: rgba(255,255,255,0.4); }
.brand-logo { display: flex; align-items: center; }
.brand-logo img { height: clamp(24px, 2.4vw, 30px); width: auto; }

.header-right { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); }

/* language switch */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; }
.lang-switch button { padding: 4px 6px; color: var(--muted); transition: color 0.25s var(--ease); text-transform: uppercase; }
.lang-switch button.is-active { color: var(--ink); }
.lang-switch .sep { color: var(--hairline); }

/* hamburger */
.menu-toggle { width: 34px; height: 34px; position: relative; display: inline-flex; align-items: center; justify-content: center; z-index: 80; }
.menu-toggle span { position: absolute; left: 6px; right: 6px; height: 1.5px; background: var(--ink); transition: transform 0.4s var(--ease), opacity 0.3s var(--ease); }
.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { bottom: 12px; }
body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
body.nav-open .menu-toggle span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

/* =====================================================================
   OVERLAY NAV
   ===================================================================== */
.nav-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: linear-gradient(155deg, #B35B5F 0%, #934549 100%);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
body.nav-open .nav-overlay { opacity: 1; visibility: visible; }
.nav-overlay__inner { max-width: var(--maxw); margin-inline: auto; width: 100%; }
.nav-overlay nav { display: flex; flex-direction: column; gap: clamp(8px, 2vh, 22px); }
.nav-overlay nav a {
  font-size: clamp(2.6rem, 9vw, 5.4rem); font-weight: 200; letter-spacing: -0.025em; line-height: 1.08;
  color: #fff;
  width: max-content;
  transform: translateY(18px); opacity: 0;
  transition: color 0.3s var(--ease), transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.nav-overlay nav a:hover { color: rgba(255,255,255,0.6); }
body.nav-open .nav-overlay nav a { transform: translateY(0); opacity: 1; }
body.nav-open .nav-overlay nav a:nth-child(1) { transition-delay: 0.12s; }
body.nav-open .nav-overlay nav a:nth-child(2) { transition-delay: 0.18s; }
body.nav-open .nav-overlay nav a:nth-child(3) { transition-delay: 0.24s; }
body.nav-open .nav-overlay nav a:nth-child(4) { transition-delay: 0.30s; }

/* =====================================================================
   RIGHT RAIL (scroll + dots)
   ===================================================================== */
.rail { position: fixed; right: clamp(14px, 2.2vw, 30px); top: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; pointer-events: none; }
.rail__scroll { writing-mode: vertical-rl; font-size: 0.62rem; letter-spacing: 0.42em; text-transform: uppercase; color: var(--muted); }
.rail__dots { display: flex; flex-direction: column; gap: 14px; pointer-events: auto; }
.rail__dots button { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); background: transparent; transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease); padding: 0; }
.rail__dots button.is-active { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding-top: 120px; padding-bottom: clamp(60px, 12vh, 120px); overflow: hidden; }
.hero__inner { position: relative; z-index: 3; max-width: 1040px; }
.hero h1 { margin-bottom: clamp(22px, 3.5vh, 38px); }
.hero .lead { max-width: 640px; margin-bottom: clamp(34px, 5vh, 52px); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 48px); align-items: center; }

/* Hero-Headline: Buchstaben steigen gestaffelt auf (statt Typewriter) */
.hero h1 .rl-word { display: inline-block; white-space: nowrap; }
.hero h1 .rl { display: inline-block; }
@keyframes heroRise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .rl { opacity: 0; transform: translateY(0.9em); transition: opacity 0.55s var(--ease), transform 0.8s var(--ease); }
  .hero h1.rl-in .rl { opacity: 1; transform: none; }
  .hero__inner > .lead, .hero__inner > .hero__ctas { opacity: 0; animation: heroRise 1s var(--ease) forwards; }
  .hero__inner > .lead { animation-delay: 0.55s; }
  .hero__inner > .hero__ctas { animation-delay: 0.72s; }
}

/* Wasserzeichen: originales RELMOS-Logo, vertikal, zart und elegant am rechten Rand */
.hero__watermark {
  position: absolute; top: 50%; right: clamp(-165px, -11vw, -105px);
  width: min(52vh, 500px); aspect-ratio: 1512 / 337;
  background: url('assets/logos/relmos.svg') no-repeat center / contain;
  opacity: 0.05;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  user-select: none; pointer-events: none; z-index: 1;
}

/* =====================================================================
   (01) WER WIR SIND
   ===================================================================== */
.about__grid { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 80px); margin-top: clamp(32px, 6vh, 64px); }
@media (min-width: 900px) { .about__grid { grid-template-columns: 0.8fr 1.4fr; } }
.about__statement p { font-size: clamp(1.4rem, 2.8vw, 2.35rem); font-weight: 200; line-height: 1.32; letter-spacing: -0.015em; }
.about__statement p + p { margin-top: 1em; color: var(--muted-2); }
.about__kicker { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted-2); font-weight: 300; }

/* =====================================================================
   (02) UNSERE MARKEN — gepinnte horizontale Galerie
   ===================================================================== */
.brands { position: relative; }

/* Intro-Panel (Kopf) — liegt in der Spur und scrollt mit */
.brands__intro { padding: var(--section-y) 0 clamp(24px, 4vh, 44px); }
.brands__intro h2 { margin-top: 18px; }
.brands__intro .lead { margin-top: 22px; max-width: 620px; }

/* default (mobile / no-JS / reduced-motion): vertikal gestapelt */
.brands__track { display: flex; flex-direction: column; gap: clamp(28px, 5vh, 56px); padding: 0 var(--pad) var(--section-y); max-width: var(--maxw); margin-inline: auto; }

/* gepinnter Modus (per JS aktiviert) */
.brands.is-pinned .brands__sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.brands.is-pinned .brands__track {
  flex-direction: row; flex-wrap: nowrap; align-items: center;
  gap: clamp(24px, 2.6vw, 48px);
  padding: 0 max(var(--pad), 7vw);
  height: 100%; max-width: none; margin: 0;
  will-change: transform;
}
.brands.is-pinned .brands__intro {
  flex: 0 0 auto; width: min(74vw, 440px); padding: 0;
  margin-right: clamp(8px, 2vw, 36px);
}

/* Brand Card */
.bcard {
  flex: 0 0 auto;
  width: min(86vw, 480px);
  background: var(--white);
  border: 1px solid var(--hairline-2);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(20,20,20,0.03);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.brands.is-pinned .bcard { width: clamp(360px, 34vw, 500px); }
.bcard:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -28px rgba(20,20,20,0.30); border-color: var(--hairline); }

/* Media = Originallogo zentriert auf cleanem, dezent markengetöntem Hintergrund */
.bcard__media { display: grid; place-items: center; position: relative; aspect-ratio: 5 / 4; background: #fdfdfc; overflow: hidden; padding: clamp(22px, 7%, 48px); border-bottom: 1px solid var(--hairline-2); }
.bcard__media::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 100% at 82% 14%, var(--tint, transparent), transparent 62%); opacity: 0.09; }
.bcard__media img { position: relative; width: auto; height: auto; max-width: 80%; max-height: 56%; object-fit: contain; transition: transform 0.6s var(--ease); }
.bcard:hover .bcard__media img { transform: scale(1.04); }

.bcard__body { padding: clamp(22px, 2vw, 32px); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bcard__name { font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 200; }
.bcard__line { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-weight: 500; }
.bcard__with { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.bcard .cta { margin-top: auto; padding-top: 12px; }

/* Fortschritts-Hinweis im gepinnten Modus */
.brands__progress { position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(26px, 5vh, 48px); height: 1px; background: var(--hairline-2); max-width: var(--maxw); margin-inline: auto; }
.brands__progress > i { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--accent); transition: width 0.1s linear; }
.brands:not(.is-pinned) .brands__progress { display: none; }

/* =====================================================================
   (03) WIE WIR ARBEITEN
   ===================================================================== */
.principles { margin-top: clamp(36px, 6vh, 72px); border-top: 1px solid var(--hairline); }
.principle {
  display: grid; grid-template-columns: 1fr;
  padding-block: clamp(26px, 4vh, 44px);
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}
.principle__body { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 820px) { .principle__body { grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4vw, 60px); align-items: baseline; } }
.principle__title { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 200; letter-spacing: -0.015em; }
.principle__text { color: var(--muted-2); font-weight: 300; font-size: clamp(1rem, 1.3vw, 1.12rem); }

/* =====================================================================
   KONTAKT
   ===================================================================== */
.contact__inner { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 6vh, 60px); }
@media (min-width: 900px) { .contact__inner { grid-template-columns: 1.5fr 1fr; align-items: end; } }
.contact h2 { margin-top: 18px; margin-bottom: clamp(20px, 3vh, 30px); }
.contact .cta { font-size: 0.85rem; }
/* grosse, elegante Terracotta-E-Mail */
.contact__mail { position: relative; display: inline-block; color: var(--accent); font-weight: 300; letter-spacing: -0.01em; font-size: clamp(1.5rem, 3.6vw, 2.6rem); transition: color 0.3s var(--ease); }
.contact__mail::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; opacity: 0.5; transition: transform 0.45s var(--ease); }
.contact__mail:hover { color: var(--accent-2); }
.contact__mail:hover::after { transform: scaleX(1); }
.contact__addr { font-style: normal; color: var(--muted-2); font-weight: 300; line-height: 1.8; font-size: 0.98rem; }
.contact__addr strong { color: var(--ink); font-weight: 500; }
.contact__addr a:hover { color: var(--accent); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { border-top: 1px solid var(--hairline); padding-block: clamp(48px, 8vh, 88px); }
.footer__grid { display: grid; grid-template-columns: 1fr; gap: clamp(34px, 5vw, 60px); }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__logo img { height: 28px; margin-bottom: 18px; }
.footer__tag { color: var(--muted-2); font-weight: 300; max-width: 320px; font-size: 0.96rem; }
.footer__col h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); font-weight: 500; margin-bottom: 16px; }
.footer__col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer__col a { color: var(--muted-2); font-size: 0.95rem; font-weight: 300; transition: color 0.25s var(--ease); }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { max-width: var(--maxw); margin: clamp(40px, 6vh, 70px) auto 0; padding-top: 26px; border-top: 1px solid var(--hairline-2); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer__bottom small { color: var(--muted); font-size: 0.8rem; }
.footer__bottom .lang-switch button { color: var(--muted); }
.footer__bottom .lang-switch button.is-active { color: var(--ink); }

/* =====================================================================
   LEGAL PAGES
   ===================================================================== */
.legal { padding-top: clamp(130px, 20vh, 200px); padding-bottom: var(--section-y); }
.legal__inner { max-width: 760px; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 12px; }
.legal h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 300; margin-top: clamp(34px, 5vh, 52px); margin-bottom: 12px; }
.legal p, .legal li { color: var(--muted-2); font-weight: 300; line-height: 1.8; font-size: 1rem; }
.legal p { margin-bottom: 14px; }
.legal ul { padding-left: 1.2em; margin-bottom: 14px; }
.legal a { color: var(--accent); }
.legal .back { margin-top: clamp(40px, 6vh, 64px); }
.legal__lead { color: var(--ink) !important; font-size: 1.1rem !important; }

/* =====================================================================
   REVEAL ANIMATIONS
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .rail { display: none; }
  .hero__watermark { width: 58vh; right: -24vw; opacity: 0.045; }
}

/* Mobile: gestapelte "Deck"-Galerie — Karten pinnen und schieben sich übereinander */
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .brands:not(.is-pinned) .brands__track { gap: clamp(20px, 5vh, 46px); padding-bottom: 12vh; }
  .brands:not(.is-pinned) .bcard {
    position: sticky;
    top: clamp(84px, 13vh, 116px);
    transform-origin: center top;
    transition: none;
    will-change: transform, filter;
    box-shadow: 0 -1px 0 rgba(255,255,255,0.95), 0 20px 50px -26px rgba(20,20,20,0.34), 0 1px 2px rgba(20,20,20,0.05);
  }
  .brands:not(.is-pinned) .bcard.reveal { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .bcard { width: 100%; }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .cursor { animation: none; }
  .bcard:hover { transform: none; }
}
