/* ==========================================================================
   TSAM Flagship Showcase – "Ihre Marke. Eine eigene Welt."
   ========================================================================== */

/* Manrope (SIL Open Font License) selbst gehostet, variable Stärke 500–800.
   Vorher Google-Fonts-Link: render-blockend (~800 ms auf langsamem Netz) und
   ein Drittanbieter-Request pro Besuch. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --graphite: #141518;
  --graphite-2: #1c1e23;
  --warm-white: #f5f2ea;
  --muted: rgba(245, 242, 234, 0.72);
  --mint: #6fffb0;
  --mint-ink: #06130c;
  --teal: #2bb3ad;
  --copper: #d98d4e;
  --sand: #e9d9bd;

  --font-display: "Manrope", "Segoe UI Variable Display", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Manrope", "Segoe UI Variable Text", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;

  --site-accent: var(--teal);
  --site-accent-ink: #06211f;
}
html[data-design="canyon"] {
  --site-accent: var(--copper);
  --site-accent-ink: #2a1607;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden; /* Safari < 16 */
  overflow-x: clip;
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--graphite);
  color: var(--warm-white);
  font-family: var(--font-body);
  font-weight: 500;
}

body { min-height: 100vh; }

a { color: inherit; }

/* --------------------------------------------------------------------------
   Skip-Link, Navigation
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--warm-white);
  color: var(--graphite);
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.9rem, 2vw, 1.5rem) clamp(1.2rem, 3.4vw, 3rem);
  background: linear-gradient(to bottom, rgba(20, 21, 24, 0.55), rgba(20, 21, 24, 0));
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.nav-right { display: flex; align-items: center; gap: 0.7rem; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(245, 242, 234, 0.12);
  border: 1px solid rgba(245, 242, 234, 0.3);
  border-radius: 999px;
  padding: 3px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lang-btn {
  border: none;
  background: none;
  color: var(--warm-white);
  opacity: 0.72;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, color 0.2s;
}
.lang-btn:hover { opacity: 1; }
.lang-btn.is-active { background: var(--mint); color: var(--mint-ink); opacity: 1; }

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.34em;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  color: var(--warm-white);
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.45rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.btn-primary { background: var(--mint); color: var(--mint-ink); }
.btn-primary:hover { background: #8dffc2; }
.btn-secondary {
  background: rgba(20, 21, 24, 0.35);
  color: var(--warm-white);
  border-color: rgba(245, 242, 234, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { border-color: var(--warm-white); }
.btn-ghost {
  background: rgba(20, 21, 24, 0.25);
  color: var(--warm-white);
  border-color: rgba(245, 242, 234, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 0.62rem 1.15rem;
  font-size: 0.85rem;
}
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--warm-white); color: var(--graphite); }

/* --------------------------------------------------------------------------
   Fixed visual stage
   -------------------------------------------------------------------------- */

.stage {
  position: fixed;
  /* Height = LARGEST viewport (URL bar hidden), never the dynamic one:
     on Android Chrome `inset: 0` only grows after the URL bar has finished
     hiding, which left a black band below the canyon for ~1 s per scroll.
     vh is the large viewport on Android/iOS already; lvh makes it explicit. */
  inset: 0 0 auto 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  z-index: 1;
  background: var(--graphite);
  /* Revealed by JS once canyon + coast are decoded, so the portal opening is
     never seen half-loaded. */
  opacity: 0;
  transition: opacity 0.7s ease;
}
.stage.is-ready { opacity: 1; }

.stage-glow {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(55% 55% at 62% 48%, rgba(43, 179, 173, 0.16), transparent 70%),
    radial-gradient(40% 40% at 20% 80%, rgba(217, 141, 78, 0.08), transparent 70%);
  opacity: 0;
}

/* Canyon with the baked-in portal. The container gets the dolly transform
   on its own compositor layer (no per-frame re-raster on phones); the evenodd
   hole is a clip-path on the CHILD image (JS), so the mask is rasterised in
   software. A clip-path directly on a will-change layer made Chrome paint the
   hole black, hence the split. */
.canyon {
  position: absolute;
  inset: 0;
  will-change: transform;
  backface-visibility: hidden;
}
.canyon img {
  position: absolute;
  display: block;
  max-width: none;
}

.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.shade-hero {
  background:
    linear-gradient(90deg, rgba(20, 21, 24, 0.62) 0%, rgba(20, 21, 24, 0.34) 30%, rgba(20, 21, 24, 0) 58%),
    linear-gradient(0deg, rgba(20, 21, 24, 0.35) 0%, rgba(20, 21, 24, 0) 40%);
}
.shade-coast {
  background:
    linear-gradient(0deg, rgba(10, 30, 36, 0.66) 0%, rgba(10, 30, 36, 0.25) 38%, rgba(10, 30, 36, 0) 65%),
    linear-gradient(90deg, rgba(10, 30, 36, 0.35) 0%, rgba(10, 30, 36, 0) 55%);
  opacity: 0;
}

/* The second world: full-viewport image + video behind the canyon; visible
   through the portal opening, later clipped into the browser mock. */
.world {
  position: absolute;
  inset: 0;
  will-change: clip-path;
}
.world-media {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}
.world-media img,
.world-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Hidden (not just transparent) until it actually plays: Android decoders
   can flash green frames while the element initialises. */
.world-media video { opacity: 0; visibility: hidden; }

/* --------------------------------------------------------------------------
   Browser + phone mockups
   -------------------------------------------------------------------------- */

.browser {
  position: absolute;
  --chrome: 38px;
  --r: 14px;
  border-radius: var(--r);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 50px 100px rgba(0, 0, 0, 0.6),
    0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
}
.chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--chrome);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: #1b1d22;
  border-radius: var(--r) var(--r) 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chrome .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3a3d45;
  flex: none;
}
.chrome .dot:nth-child(1) { background: #ff5f57; }
.chrome .dot:nth-child(2) { background: #febc2e; }
.chrome .dot:nth-child(3) { background: #28c840; }
.chrome .url {
  margin-left: 12px;
  flex: 1;
  max-width: 340px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(245, 242, 234, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  padding: 0.28rem 0.9rem;
  white-space: nowrap;
}

.site {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  top: var(--chrome);
  display: flex;
  flex-direction: column;
  opacity: 0;
  overflow: hidden;
  border-radius: 0 0 var(--r) var(--r);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1.1rem 1.6rem;
  background: linear-gradient(180deg, rgba(20, 21, 24, 0.5), rgba(20, 21, 24, 0));
}
.site-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.3em;
  font-size: 0.72rem;
}
.site-links { display: flex; gap: 1.1rem; margin-left: auto; }
.site-links span {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(245, 242, 234, 0.85);
}
.site-cta-mini {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--warm-white);
  color: var(--graphite);
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
}
.site-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0 2rem 2rem;
  background: linear-gradient(0deg, rgba(10, 20, 24, 0.62) 0%, rgba(10, 20, 24, 0.15) 45%, rgba(10, 20, 24, 0) 70%);
}
.site-headline {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
  font-size: clamp(1.1rem, 2.5vw, 2.7rem);
  margin: 0;
  color: var(--warm-white);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.site-tag {
  margin: 0;
  font-size: clamp(0.62rem, 0.85vw, 0.9rem);
  color: rgba(245, 242, 234, 0.8);
  letter-spacing: 0.06em;
}
.site-btn {
  font-size: clamp(0.62rem, 0.8vw, 0.85rem);
  font-weight: 700;
  background: var(--site-accent);
  color: var(--site-accent-ink);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: background-color 0.35s ease, color 0.35s ease;
}
html[data-design="canyon"] .site-hero {
  align-items: center;
  text-align: center;
  justify-content: center;
  padding-bottom: 0;
  background: radial-gradient(60% 60% at 50% 55%, rgba(20, 21, 24, 0.55), rgba(20, 21, 24, 0) 70%);
}
html[data-design="canyon"] .site-nav { justify-content: center; }
html[data-design="canyon"] .site-links { margin-left: 0; }

.phone {
  position: absolute;
  --bezel: 6px;
  border-radius: 13% / 6.4%;
  background: #0b0c0e;
  padding: var(--bezel);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10% / 4.8%;
  overflow: hidden;
  background: #0b0c0e center / cover no-repeat;
  transition: background-image 0.35s ease;
}
.phone-notch {
  position: absolute;
  top: 3%; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 3.2%;
  border-radius: 999px;
  background: #0b0c0e;
}
.phone-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 9% 9% 11%;
  gap: 0.35rem;
  background: linear-gradient(0deg, rgba(10, 20, 24, 0.7) 0%, rgba(10, 20, 24, 0) 55%);
}
.phone-ui .site-headline { font-size: clamp(0.8rem, 1.2vw, 1.25rem); }
.phone-ui .site-btn { font-size: 0.6rem; padding: 0.4rem 0.8rem; }

/* --------------------------------------------------------------------------
   Scroll beats (copy layer)
   -------------------------------------------------------------------------- */

.beats {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.beat { position: relative; }
.beat-hero { height: 120vh; }
.beat-approach { height: 160vh; }
.beat-coast { height: 140vh; }
.beat-retreat { height: 160vh; }
.beat-outro { height: 120vh; }

.copy {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(1.2rem, 6vw, 7rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease, visibility 0s linear 0.55s;
}
.beat.is-active .copy {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease, visibility 0s linear 0s;
}
.copy-inner { max-width: 52rem; }
.copy-inner > * + * { margin-top: 1.1rem; }
.copy .interactive { pointer-events: auto; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin: 0;
  color: var(--warm-white);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
  text-wrap: balance;
}
h1 { font-size: clamp(3rem, 5.6vw, 7rem); }
h2 { font-size: clamp(2.4rem, 5vw, 5.6rem); }

.sub {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.5;
  max-width: 34rem;
}
.sub-plain { letter-spacing: 0; font-weight: 500; }
/* 9.9.2026: .sub { margin: 0 } überschrieb den Abstand aus .copy-inner > * + *; die Unterlänge des "g"
   in "eigene" (line-height 0.96) lief in die Unterzeile, sichtbar seit "Automatisierung" statt "Software". */
.copy-inner > .sub { margin-top: 1.35rem; }

.beat-hero .copy { justify-content: center; }
.beat-hero .copy-inner { max-width: 50vw; }

.beat-approach .copy { align-items: center; text-align: center; }
.beat-approach h2 { font-size: clamp(2.6rem, 6vw, 6.8rem); }

.beat-coast .copy { justify-content: flex-end; padding-bottom: clamp(3rem, 9vh, 7rem); }
.beat-coast h2 { font-size: clamp(2.6rem, 6vw, 6.8rem); }

.beat-retreat .copy,
.beat-outro .copy {
  justify-content: flex-start;
  padding-top: 18vh;
}
.beat-retreat .copy-inner,
.beat-outro .copy-inner { max-width: 24vw; }
.beat-retreat h2,
.beat-outro h2 { font-size: clamp(2rem, 3.5vw, 4.2rem); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.design-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 21, 24, 0.55);
  border: 1px solid rgba(245, 242, 234, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.toggle-btn:hover { color: var(--warm-white); }
.toggle-btn[aria-pressed="true"] { background: var(--warm-white); color: var(--graphite); }
.toggle-btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.toggle-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.fineprint {
  margin-top: 1.6rem;
  font-size: 0.74rem;
  color: rgba(245, 242, 234, 0.5);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   HUD: scroll hint + scene counter
   -------------------------------------------------------------------------- */

.hud {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 3.4vw, 3rem) clamp(1rem, 2.6vh, 1.8rem);
  pointer-events: none;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, 0.75);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: opacity 0.4s ease;
}
.scroll-hint::before {
  content: "";
  width: 1px; height: 28px;
  background: linear-gradient(to bottom, var(--warm-white), transparent);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: translateY(-3px); opacity: 0.6; } 50% { transform: translateY(3px); opacity: 1; } }
.scene-counter { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Static fallback (no JS / reduced motion / init error)
   -------------------------------------------------------------------------- */

.static { display: none; }
html.no-js .static,
html.static-mode .static { display: block; }
html.no-js .stage, html.no-js .beats, html.no-js .hud,
html.static-mode .stage, html.static-mode .beats, html.static-mode .hud { display: none; }

.static {
  position: relative;
  z-index: 3;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 8rem) clamp(1.2rem, 5vw, 3rem) 5rem;
}
.static figure { margin: 0 0 2rem; }
.static img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}
.static figcaption { margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted); }
.static h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); margin-bottom: 1rem; }
.static p { max-width: 40rem; line-height: 1.6; }
.static .cta-row { margin: 1.6rem 0 3rem; }
.static .cta-row .btn { pointer-events: auto; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .beat-retreat .copy-inner, .beat-outro .copy-inner { max-width: 26vw; }
  .beat-retreat h2, .beat-outro h2 { font-size: clamp(1.7rem, 3.4vw, 3rem); }
  .phone { display: none; }
}

@media (max-width: 760px) {
  /* Portrait: the baked-in portal stands in the upper/middle part of the
     frame, so the headline sits below it on the rock ledge. */
  .beat-hero .copy {
    justify-content: flex-end;
    padding-bottom: 12vh;
    align-items: flex-start;
  }
  .beat-hero .copy-inner { max-width: 100%; }
  h1 { font-size: clamp(2rem, 9.6vw, 2.7rem); }
  .site-links, .site-cta-mini { display: none; }
  .sub { font-size: 0.9rem; letter-spacing: 0.05em; }

  .beat-approach h2, .beat-coast h2 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .beat-coast .copy { padding-bottom: 12vh; }

  .beat-retreat .copy, .beat-outro .copy {
    justify-content: flex-start;
    padding-top: 56vh;
    align-items: flex-start;
  }
  .beat-retreat .copy-inner, .beat-outro .copy-inner { max-width: 100%; }
  .beat-retreat h2, .beat-outro h2 { font-size: clamp(1.8rem, 8.5vw, 2.6rem); }
  .beat-outro .copy { padding-top: 54vh; }
  .cta-row { margin-top: 1rem; }
  .btn { padding: 0.75rem 1.2rem; font-size: 0.88rem; }
  .fineprint { margin-top: 1rem; }

  .hud .scene-counter { display: none; }
  .site-nav { padding: 0.8rem 1rem; }
  .site-hero { padding: 0 1.1rem 1.1rem; }
}

@media (max-height: 640px) and (min-width: 761px) {
  .beat-retreat .copy, .beat-outro .copy { padding-top: 12vh; }
}
