:root {
  /* Anlehnung an zendis.de */
  --bg: #f6f6f6;
  --text: #131f30;
  --muted: #5d6877;
  --mint: #6ce5d3;
  --line: #dfe3e8;
  --gap: clamp(12px, 2.4vmin, 28px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Ein Screen, kein Scrollen */
.screen {
  height: 100dvh;
  padding: max(var(--gap), env(safe-area-inset-top)) max(calc(var(--gap) * 1.5), env(safe-area-inset-right))
           max(var(--gap), env(safe-area-inset-bottom)) max(calc(var(--gap) * 1.5), env(safe-area-inset-left));
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: calc(var(--gap) * 1.5);
}

.products {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: calc(var(--gap) * 2);
  min-height: 0;
}

/* Bereiche ohne Karte/Rahmen */
section {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
}

/* Logo-Zeile: gleiche Höhe, Logos mittig auf einer Ebene */
.section-head {
  height: clamp(56px, 11vmin, 100px);
  display: flex;
  align-items: center;
}
.section-head h1,
.section-head h2 { margin: 0; display: flex; align-items: center; }

.logo { display: block; height: auto; max-width: 100%; }
.logo-zendis { width: clamp(160px, 28vmin, 300px); }
/* openDesk und openCode: optisch gleich groß (gleiche Höhe der Schriftzüge) */
.products { --mark: clamp(30px, 5vmin, 56px); }
.logo-opendesk { width: calc(var(--mark) * 5.59); }
.logo-opencode { width: calc(var(--mark) * 5.92); }

.tiles {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: var(--gap);
}
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Große Touch-Flächen */
.tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 0 clamp(10px, 1.6vmin, 20px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.08s, background 0.08s;
}
.tile:active {
  transform: scale(0.97);
  background: var(--mint);
  border-color: var(--mint);
}
.tile:active .tile-sub { color: var(--text); }
.tile:focus-visible { outline: 4px solid var(--mint); outline-offset: 2px; }

.tile-title {
  font-size: clamp(1rem, 2.5vmin, 1.7rem);
  font-weight: 700;
  line-height: 1.15;
  hyphens: manual; /* nur an Bindestrichen umbrechen, nie mitten im Wort */
}
.tile-sub {
  color: var(--muted);
  font-size: clamp(0.75rem, 1.6vmin, 1.05rem);
  overflow-wrap: break-word;
}

.icon {
  width: clamp(28px, 5vmin, 48px);
  height: clamp(28px, 5vmin, 48px);
  flex: none;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 4px;
}

/* Hochkant (iPad): Bereiche untereinander, Kacheln 2 pro Zeile, Icon links neben dem Text */
@media (orientation: portrait) {
  .screen {
    grid-template-rows: 1.5fr 1fr 1.5fr;
    gap: calc(var(--gap) * 1.2);
    padding-top: max(calc(var(--gap) * 1.5), env(safe-area-inset-top));
    padding-bottom: max(calc(var(--gap) * 1.5), env(safe-area-inset-bottom));
  }
  .products { display: contents; --mark: clamp(36px, 6vmin, 64px); }
  .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .section-head { height: clamp(64px, 12vmin, 120px); }
  .logo-zendis { width: clamp(180px, 32vmin, 340px); }

  .tile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: clamp(14px, 2.4vmin, 28px);
    align-content: center;
    align-items: center;
    padding: 0 clamp(16px, 3vmin, 32px);
  }
  .tile .icon {
    grid-row: 1 / 3;
    width: clamp(40px, 7vmin, 72px);
    height: clamp(40px, 7vmin, 72px);
    margin: 0;
  }
  .tile-title { align-self: end; font-size: clamp(1.1rem, 2.7vmin, 1.8rem); hyphens: manual; }
  .tile-sub { align-self: start; font-size: clamp(0.85rem, 2vmin, 1.25rem); }
}

/* Bildschirmschoner */
#saver {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--text);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s, visibility 0.6s;
  touch-action: manipulation;
}
#saver.active { opacity: 1; visibility: visible; }

.saver-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.saver-slide.on {
  opacity: 1;
  animation: saver-zoom 14s ease-out forwards;
}
@keyframes saver-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }

.saver-hint {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 999px;
  background: rgb(19 31 48 / 0.7);
  color: #fff;
  font-size: clamp(1rem, 2.2vmin, 1.4rem);
  animation: saver-pulse 3s ease-in-out infinite;
}
@keyframes saver-pulse { 50% { opacity: 0.5; } }

@media (prefers-reduced-motion: reduce) {
  .saver-slide.on { animation: none; }
  .saver-hint { animation: none; }
}
