/* ==========================================================================
   STAYER — stayerofficial.com
   Shared stylesheet. Loaded by every page.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  --bg:          #000;
  --surface:     #050505;
  --fg:          #fff;
  --muted:       #8a8a8a;
  --dim:         #5a5a5a;
  --faint:       #444;
  --line:        #222;
  --line-soft:   #1a1a1a;

  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica,
          "Segoe UI", Roboto, Arial, sans-serif;

  --measure: 800px;
  --ease:    cubic-bezier(.16, 1, .3, 1);
  --dur:     .8s;
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background-color: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* Visible keyboard focus everywhere — the previous version had none. */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 999;
  background: var(--fg); color: var(--bg);
  padding: 12px 20px; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }


/* --- Language switcher (fixed, top right) ------------------------------ */
.lang-switch {
  position: fixed;
  top: 22px; right: 24px;
  z-index: 60;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity .6s ease;
}
.lang-switch a { color: var(--dim); text-decoration: none; transition: color .3s ease; }
.lang-switch a:hover, .lang-switch a:focus-visible { color: var(--fg); }
.lang-switch a[aria-current] { color: var(--fg); cursor: default; }
.lang-switch .sep { color: #303030; }

body.nav-away .lang-switch { opacity: 0; pointer-events: none; }

@media (max-width: 600px) {
  .lang-switch { top: 14px; right: 14px; padding: 6px 12px; font-size: 11px; letter-spacing: 1.5px; }
}
@media print { .lang-switch { display: none; } }

/* ==========================================================================
   Document pages (Impressum, Privacy, Terms, 404)
   ========================================================================== */
.doc {
  padding: 80px 40px 0;
}
.doc .back-link { max-width: calc(100% - 90px); }

.doc .container {
  max-width: var(--measure);
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  color: var(--dim);
  text-decoration: none;
  margin-bottom: 40px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 2px;
  transition: color .3s ease;
}
.back-link:hover, .back-link:focus-visible { color: var(--fg); }

.doc h1 {
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
  text-wrap: balance;
}

.doc h2 {
  font-size: clamp(20px, 3.4vw, 24px);
  font-weight: 700;
  color: var(--fg);
  margin: 44px 0 18px;
  scroll-margin-top: 24px;
}

.doc h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  margin: 28px 0 12px;
}

.doc p,
.doc li { color: var(--muted); font-size: 16px; }
.doc p  { margin-bottom: 20px; }
.doc ul,
.doc ol { margin: 0 0 20px 22px; }
.doc li { margin-bottom: 10px; }

.doc strong, .doc b { color: var(--fg); font-weight: 700; }

.doc a { color: #b4b4b4; text-underline-offset: 3px; }
.doc a:hover, .doc a:focus-visible { color: var(--fg); }

.meta { color: var(--dim); font-size: 14px; }

/* Key-value block used by the Impressum */
.facts {
  list-style: none;
  margin: 0 0 20px;
  border-top: 1px solid var(--line-soft);
}
.facts > li {
  display: grid;
  grid-template-columns: minmax(190px, 34%) 1fr;
  gap: 8px 28px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.facts dfn,
.facts .k {
  font-style: normal;
  color: var(--fg);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.facts .v { color: var(--muted); }

.callout {
  border-left: 2px solid var(--line);
  padding: 4px 0 4px 20px;
  margin: 0 0 20px;
}
.callout p:last-child { margin-bottom: 0; }

/* --- Footer shared by every page --------------------------------------- */
.site-footer {
  max-width: var(--measure);
  margin: 80px auto 0;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: baseline;
  justify-content: space-between;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.site-footer a {
  color: var(--dim);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1.5px;
  transition: color .3s ease;
}
.site-footer a:hover, .site-footer a:focus-visible { color: var(--fg); }

@media (max-width: 600px) {
  .doc { padding: 40px 20px 0; }
  .facts > li { grid-template-columns: 1fr; gap: 2px; padding: 12px 0; }
  .site-footer { margin-top: 56px; }
}

/* ==========================================================================
   Home page
   ========================================================================== */
.home {
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
.home body { overflow-x: hidden; }

/* The scrollbar is hidden by design; keyboard and wheel scrolling still work. */
.home body::-webkit-scrollbar { display: none; }
.home body { scrollbar-width: none; -ms-overflow-style: none; }

.bg-layer {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100svh;
  background-image: image-set(url('hero-1280.jpg') 1x, url('hero-2560.jpg') 2x);
  background-image: -webkit-image-set(url('hero-1280.jpg') 1x, url('hero-2560.jpg') 2x);
  background-size: cover;
  background-position: center;
  z-index: 1;
  transform: perspective(2000px) translate3d(0, 0, 0) rotateY(0);
  transition: transform var(--dur) var(--ease), opacity var(--dur) ease;
}
@media (min-width: 800px) {
  .bg-layer { background-image: url('hero-2560.jpg'); }
}

.bottom-gradient {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  height: 35vh;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 100%);
  z-index: 2;
  pointer-events: none;
  transition: opacity var(--dur) ease;
}

.words {
  position: fixed;
  bottom: calc(4vh + env(safe-area-inset-bottom));
  left: 50%;
  width: 100%;
  z-index: 10;
  text-align: center;
  transform: perspective(2000px) translateX(-50%);
  transition: transform var(--dur) var(--ease), opacity var(--dur) ease;
  transform-style: preserve-3d;
}

.nav-word {
  position: absolute;
  bottom: 0; left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(38px, 10vw, 150px);
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  text-shadow: 0 4px 25px rgba(0, 0, 0, .6);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 50px);
  pointer-events: none;
  transition: color .3s ease;
}
.nav-word:hover { color: #ccc; }
.nav-word:focus-visible { opacity: 1 !important; pointer-events: auto; }

.scroll-arrow {
  width: .7em; height: .7em;
  margin-left: 15px;
  animation: floatDown 2s ease-in-out infinite;
}
@keyframes floatDown {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(15px); }
}

/* Height of both is set by home.js so the runway ends exactly on the last word. */
.scroll-section,
.scroll-tail { width: 100%; scroll-snap-align: start; }

.site-footer-link {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 20px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity .6s ease;
}
.site-footer-link a { color: var(--dim); text-decoration: none; transition: color .3s ease; }
.site-footer-link a:hover, .site-footer-link a:focus-visible { color: var(--fg); }

/* --- "Navigated away" state (apps overlay open) ------------------------- */
body.nav-away .bg-layer {
  transform: perspective(2000px) translate3d(-30vw, 0, -200px) rotateY(10deg);
  opacity: 0;
}
body.nav-away .bottom-gradient { opacity: 0; }
body.nav-away .words {
  transform: perspective(2000px) translate3d(calc(-50% - 50vw), 0, -300px) rotateY(15deg);
  opacity: 0;
  pointer-events: none;
}
body.nav-away .site-footer-link { opacity: 0; pointer-events: none; }

/* --- Apps overlay ------------------------------------------------------- */
.apps-overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100svh;
  background-color: var(--bg);
  z-index: 100;
  opacity: 0;
  transform: perspective(2000px) translate3d(100vw, 0, -300px) rotateY(-15deg);
  pointer-events: none;
  visibility: hidden;
  transition: transform var(--dur) var(--ease), opacity var(--dur) ease,
              visibility 0s linear var(--dur);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 100px 40px 80px;
}
.apps-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: perspective(2000px) translate3d(0, 0, 0) rotateY(0);
  pointer-events: auto;
  transition: transform var(--dur) var(--ease), opacity var(--dur) ease,
              visibility 0s;
}

.apps-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 110;
  background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}
.close-btn {
  background: none;
  border: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .3s ease;
}
.close-btn:hover { color: var(--muted); }
.page-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--dim);
  text-transform: uppercase;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
  gap: 30px;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
  list-style: none;
}

.app-card {
  background-color: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  transition: transform .4s ease, border-color .4s ease;
}
.app-card:hover { transform: translateY(-8px); border-color: #333; }

.app-icon {
  width: 60px; height: 60px;
  background-color: #111;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }

.app-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.app-description {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 30px;
  flex-grow: 1;
}

.tags { display: flex; gap: 8px; margin-bottom: 30px; flex-wrap: wrap; list-style: none; }
.tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px;
  background-color: #111;
  border-radius: 4px;
  color: #aaa;
}

.app-links { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.app-link {
  flex: 1 1 130px;
  text-decoration: none;
  color: #000;
  background-color: var(--fg);
  padding: 14px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  transition: background-color .3s ease;
}
.app-link:hover, .app-link:focus-visible { background-color: #ccc; }
.app-link[aria-disabled="true"] {
  background-color: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  cursor: default;
}
.app-link[aria-disabled="true"]:hover { background-color: transparent; }

@media (max-width: 600px) {
  .words { bottom: calc(52px + env(safe-area-inset-bottom)); }
  .apps-overlay { padding: 90px 20px 60px; }
  .apps-header  { padding: 24px 20px; }
  .app-card     { padding: 30px 24px; }
}

/* ==========================================================================
   Motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bg-layer, .words, .apps-overlay { transform: none !important; }
  .apps-overlay.active { transform: none !important; }
}

@media print {
  body { background: #fff; color: #000; padding: 0; }
  .doc p, .doc li, .meta, .facts .v { color: #222; }
  .doc a { color: #000; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
  .back-link, .skip-link { display: none; }
  .site-footer { border-color: #ccc; color: #444; }
}
