/* ============================================================
   insidethebox GmbH — Stylesheet
   Hell, ruhig, reduziert. Mobile-first.
   ============================================================ */

/* ---- Fonts (self-hosted, no external requests) ---- */
/* Instrument Sans (OFL), latin-Subset, variabel 400–700 */
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --bg: #F4F0EC;
  --ink: #3F3B3A;
  --ink-hover: #1F1C1B;
  --linkedin: #5F5854;
  --legal: #6E6763;
  --effect: #A3958B;
  --focus: rgba(63, 59, 58, 0.55);

  --font-sans: "Instrument Sans", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --logo-w: min(62vw, 240px);
}

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

html, body { margin: 0; padding: 0; }

html {
  height: 100%;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* Startseite: ein Bildschirm, kein Scrollen / Pull-to-Refresh.
   Rechtsseiten haben kein .home und bleiben scrollbar. */
body.home {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}

/* ============================================================
   Bühne
   ============================================================ */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Raster + Effekte (ein Canvas) */
.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none; /* Wischen löst den Effekt aus, statt die Seite zu bewegen */
}

/* ---- Logo ---- */
.logo {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 38%;
  width: var(--logo-w);
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none; /* Tippen aufs Logo erreicht das Raster */
  line-height: 0;
}
.logo img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
}

/* nur für Screenreader / Suchmaschinen */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Kontakt + Rechtliches ---- */
.contact {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  pointer-events: none; /* nur die Links selbst sind klickbar */
}
.contact__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.contact a {
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color .2s ease;
}

.contact__email {
  font-size: 16px;
  color: var(--ink);
  /* E-Mail bleibt markier- und kopierbar */
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
.contact__email:hover,
.contact__email:focus-visible { color: var(--ink-hover); }

.contact__linkedin {
  font-size: 14px;
  color: var(--linkedin);
}
.contact__linkedin:hover,
.contact__linkedin:focus-visible { color: var(--ink-hover); }

.contact__legal {
  display: flex;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--legal);
}
.contact .contact__legal a { letter-spacing: 0.1em; }
.contact__legal a:hover,
.contact__legal a:focus-visible { color: var(--ink); }

:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---- Desktop ---- */
@media (min-width: 768px) {
  :root { --logo-w: clamp(400px, 32vw, 440px); }
}

/* ---- Niedrige Bildschirme (Handy quer) ---- */
@media (max-height: 560px) {
  :root { --logo-w: min(40vh, 240px); }
  .logo { top: 22%; }
  .contact { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); gap: 18px; }
  .contact__main { gap: 8px; }
}

/* ============================================================
   Rechtsseiten (Impressum / Datenschutz) – normal scrollbar
   ============================================================ */
.legal {
  min-height: 100svh;
  display: flex;
  justify-content: center;
  background: var(--bg);
}

.legal__inner {
  width: 100%;
  max-width: 680px;
  padding: clamp(48px, 10vh, 104px) 24px 96px;
}

.legal__back {
  display: block;
  margin-bottom: 28px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--legal);
  text-decoration: none;
  transition: color .2s ease;
}
.legal__back:hover,
.legal__back:focus-visible { color: var(--ink); }

.legal h1 {
  margin: 0 0 32px;
  font-weight: 500;
  font-size: clamp(24px, 5.5vw, 30px);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.legal h2 {
  margin: 36px 0 12px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.legal p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--linkedin);
}

.legal a { color: var(--ink); text-underline-offset: 3px; }
.legal a:hover,
.legal a:focus-visible { color: var(--ink-hover); }

/* ---- Sanfter Auftritt (einmalig) ---- */
.logo    { animation: itbRise 1.1s cubic-bezier(.16,.8,.24,1) both; }
.contact { animation: itbFade 1.2s ease .5s both; }
@keyframes itbRise {
  from { opacity: 0; transform: translateX(-50%) translateY(18px); }
  to   { opacity: 1; transform: translateX(-50%); }
}
@keyframes itbFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .logo, .contact { animation: none; }
}
