/* ApoNoHa Signage — Vollbild 9:16 Portrait (1080×1920)
   CI-Tokens 1:1 aus _server/web/tailwind.config.cjs */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Brand */
  --brand-green: #9ACD32;
  --brand-green-dk: #7AB320;
  --brand-green-lt: #C8E58A;
  --brand-red: #FF0000;
  --brand-red-dk: #CC0000;
  --brand-red-lt: #FFCDCD;
  --brand-warn: #E8843A;

  /* Surface */
  --surface-warm: #FFF9F0;
  --surface-green: #F4F8E8;
  --surface-red: #FFF0F0;

  /* Ink */
  --ink-900: #1A1A1A;
  --ink-700: #404040;
  --ink-500: #707070;
  --ink-300: #C4C4C4;
  --ink-100: #F5F5F5;
  --ink-50: #FAFAFA;

  /* Shadows */
  --shadow-soft: 0 4px 20px -8px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 8px 32px -12px rgba(0, 0, 0, 0.18);

  /* Backwards-compat */
  --brand: var(--brand-green);
  --text: var(--ink-900);
  --text-dim: var(--ink-500);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  color: var(--ink-900);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  overflow: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
  line-height: 1.05;
}

/* Canvas in 1080×1920 */
.canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1080px;
  height: 1920px;
  background: var(--surface-warm);
  transform-origin: center center;
  overflow: hidden;
}

/* ============ SLOT ============ */
.slot {
  position: absolute;
  inset: 0;
  bottom: 160px;
  transition: transform 1.2s ease-in-out;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 500ms ease-in-out;
  padding: 80px;
}

.slide.active { opacity: 1; }

/* ============ ANIMATIONS ============ */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-80px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes kenBurns {
  0%   { transform: scale(1.0) translate(0, 0); }
  100% { transform: scale(1.12) translate(-20px, -10px); }
}
@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
  50%      { box-shadow: 0 0 0 24px rgba(255, 0, 0, 0); }
}

.slide.active .anim-up      { animation: slideInUp 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide.active .anim-left    { animation: slideInLeft 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide.active .anim-right   { animation: slideInRight 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide.active .anim-scale   { animation: fadeInScale 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Stagger-Delays für Kachel-Reihen — vergeben per inline style="--i: 0..7" */
.stagger-item { animation-delay: calc(var(--i, 0) * 90ms) !important; }

/* ============ SLIDE: IMAGE ============ */
.slide-image {
  padding: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.slide-image .caption,
.slide-video .caption {
  position: absolute;
  bottom: 40px;
  left: 40px;
  right: 40px;
  background: rgba(26,26,26,0.7);
  color: #fff;
  padding: 28px 36px;
  font-size: 44px;
  font-weight: 600;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

/* ============ SLIDE: VIDEO ============ */
.slide-video {
  padding: 0;
  background: #000;
}
.slide-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ SLIDE: HERO ============ */
.slide-hero {
  justify-content: flex-end;
  align-items: flex-start;
  background-color: var(--surface-warm);
  background-size: cover;
  background-position: center;
  position: relative;
}
.slide-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75) 100%);
}
.slide-hero > * { position: relative; z-index: 1; }

.slide-hero .subtitle {
  font-size: 56px;
  color: var(--brand-green);
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.slide-hero h1 {
  font-size: 130px;
  font-weight: 900;
  color: #fff;
  line-height: 0.95;
  margin-bottom: 32px;
}
.slide-hero .body {
  font-size: 42px;
  color: rgba(255,255,255,0.92);
  line-height: 1.35;
  max-width: 900px;
  font-weight: 400;
}

/* Ken-Burns auf Hintergrundbild für Bewegung */
.slide-hero.ken-burns::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  z-index: -1;
  animation: kenBurns 18s ease-in-out infinite alternate;
}

/* ============ SLIDE: INFO ============ */
.slide-info {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--surface-warm);
}
.slide-info h1 {
  font-size: 110px;
  color: var(--brand-green-dk);
  font-weight: 800;
  margin-bottom: 50px;
}
.slide-info p {
  font-size: 48px;
  color: var(--ink-700);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ============ SLIDE: CLAIM ============ */
.slide-claim {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px;
  background: linear-gradient(135deg, var(--surface-green) 0%, #fff 100%);
}
.slide-claim .claim-text {
  font-size: 156px;
  font-weight: 900;
  color: var(--ink-900);
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.slide-claim .claim-text .accent {
  color: var(--brand-green-dk);
}
.slide-claim .claim-foot {
  margin-top: 80px;
  font-size: 42px;
  font-weight: 600;
  color: var(--ink-500);
}

/* ============ SLIDE: TEAM ============ */
.slide-team {
  flex-direction: row;
  gap: 60px;
  padding: 80px;
  background: var(--surface-warm);
  align-items: stretch;
}
.slide-team .team-photo {
  flex: 0 0 480px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #ddd;
}
.slide-team .team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide-team .team-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slide-team .team-eyebrow {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand-green-dk);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.slide-team .team-name {
  font-size: 96px;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 12px;
  line-height: 1;
}
.slide-team .team-role {
  font-size: 44px;
  color: var(--ink-700);
  margin-bottom: 32px;
  font-weight: 500;
}
.slide-team .team-bio {
  font-size: 38px;
  color: var(--ink-700);
  line-height: 1.4;
}

/* ============ SLIDE: DNA-TEST ============ */
.slide-dna {
  padding: 0;
  background: #000;
}
.slide-dna .dna-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.slide-dna .dna-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.85) 100%);
}
.slide-dna .dna-content {
  position: relative;
  z-index: 2;
  padding: 80px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.slide-dna .dna-emoji {
  font-size: 140px;
  margin-bottom: 24px;
}
.slide-dna .dna-eyebrow {
  font-size: 38px;
  color: var(--brand-green);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.slide-dna .dna-name {
  font-size: 160px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 24px;
}
.slide-dna .dna-tagline {
  font-size: 48px;
  color: rgba(255,255,255,0.95);
  margin-bottom: 48px;
  font-weight: 500;
}
.slide-dna .dna-facts {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
.slide-dna .dna-facts li {
  font-size: 30px;
  color: rgba(255,255,255,0.9);
  padding-left: 32px;
  position: relative;
  line-height: 1.3;
}
.slide-dna .dna-facts li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand-green);
  font-weight: 700;
}

/* ============ SLIDE: TILE-GRID ============ */
.slide-tile-grid {
  background: var(--surface-warm);
  padding: 80px;
  justify-content: flex-start;
}
.slide-tile-grid h2 {
  font-size: 88px;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 60px;
  letter-spacing: -0.03em;
}
.slide-tile-grid h2 .accent { color: var(--brand-green-dk); }
.slide-tile-grid .tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  flex: 1;
}
.slide-tile-grid .tile {
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 2px solid transparent;
}
.slide-tile-grid .tile .tile-icon {
  font-size: 72px;
  line-height: 1;
}
.slide-tile-grid .tile .tile-title {
  font-size: 38px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.1;
}
.slide-tile-grid .tile .tile-body {
  font-size: 26px;
  color: var(--ink-500);
  line-height: 1.35;
}

/* ============ SLIDE: NOTDIENST (rotation slot) ============ */
.slide-notdienst {
  background: var(--surface-warm);
}
.slide-notdienst h1 {
  font-size: 104px;
  color: var(--brand-green-dk);
  margin-bottom: 50px;
  font-weight: 800;
}
.notdienst-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.notdienst-card {
  background: #fff;
  border-left: 12px solid var(--brand-green);
  border-radius: 16px;
  padding: 28px 36px;
  box-shadow: var(--shadow-soft);
}
.notdienst-card.self {
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dk) 100%);
  color: #fff;
  border-left-color: #fff;
}
.notdienst-card .nd-name {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
}
.notdienst-card .nd-meta {
  font-size: 28px;
  color: var(--ink-500);
  line-height: 1.4;
}
.notdienst-card.self .nd-meta { color: rgba(255,255,255,0.9); }
.notdienst-card .nd-time {
  font-size: 32px;
  font-weight: 600;
  margin-top: 8px;
  color: var(--ink-900);
}
.notdienst-card.self .nd-time { color: #fff; }

/* ============ FOOTER ============ */
.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: #fff;
  border-top: 4px solid var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
}
.brand-name {
  font-size: 40px;
  font-weight: 800;
  color: var(--brand-green-dk);
  letter-spacing: -0.02em;
}
.brand-claim {
  font-size: 28px;
  color: var(--ink-500);
  margin-top: 4px;
  font-weight: 500;
}
.clock {
  font-size: 64px;
  font-weight: 300;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
}

/* ============ EMERGENCY OVERLAY (Außen, eigener Notdienst) ============ */
.emergency-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dk) 100%);
  color: #fff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px;
}
.emergency-overlay.hidden { display: none; }
.emergency-overlay .pulse {
  font-size: 220px;
  margin-bottom: 40px;
  animation: kenBurns 3s ease-in-out infinite alternate;
}
.emergency-overlay h1 {
  font-size: 160px;
  font-weight: 900;
  line-height: 0.92;
  margin-bottom: 40px;
  color: #fff;
}
.emergency-overlay .info {
  font-size: 56px;
  font-weight: 600;
  margin-bottom: 24px;
}
.emergency-overlay .until {
  font-size: 52px;
  background: rgba(0,0,0,0.18);
  padding: 28px 56px;
  border-radius: 20px;
  margin-top: 40px;
  font-weight: 700;
}

/* ============ MODE: BLACKOUT (Innen, geschlossen, fremde Schicht) ============ */
.canvas.mode-blackout {
  background: #000;
}
.canvas.mode-blackout .slot,
.canvas.mode-blackout .footer { display: none; }

/* ============ MODE: NOTDIENST-PERMANENT (Außen, fremde Schicht, nachts) ============ */
/* Dark-Mode-Optik weil's nachts in der Vitrine viel angenehmer ist als helles Weiß */
.canvas.mode-notdienst-permanent {
  background: linear-gradient(180deg, #0E1116 0%, #1A2030 100%);
}
.canvas.mode-notdienst-permanent .footer {
  background: #1A2030;
  border-top-color: var(--brand-green);
}
.canvas.mode-notdienst-permanent .brand-name { color: var(--brand-green); }
.canvas.mode-notdienst-permanent .brand-claim { color: rgba(255,255,255,0.6); }
.canvas.mode-notdienst-permanent .clock { color: #fff; }

.slide-notdienst-permanent,
.slide-fallback {
  position: absolute;
  inset: 0;
  padding: 100px 80px 80px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 600ms ease-in-out;
  color: #fff;
}
.slide-notdienst-permanent.active,
.slide-fallback.active { opacity: 1; }

.slide-notdienst-permanent h1 {
  font-size: 140px;
  font-weight: 800;
  color: var(--brand-green);
  line-height: 1;
  margin-bottom: 24px;
}
.slide-notdienst-permanent .hint {
  font-size: 38px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 48px;
  line-height: 1.3;
}
.slide-notdienst-permanent .notdienst-card {
  background: rgba(255,255,255,0.06);
  border-left-color: var(--brand-green);
  color: #fff;
  box-shadow: none;
}
.slide-notdienst-permanent .notdienst-card .nd-meta { color: rgba(255,255,255,0.65); }
.slide-notdienst-permanent .notdienst-card .nd-time { color: #fff; }
.slide-notdienst-permanent .emergency-line {
  margin-top: auto;
  font-size: 44px;
  color: #fff;
  text-align: center;
  padding: 32px;
  border-top: 2px solid rgba(255,255,255,0.1);
  font-weight: 600;
}
.slide-fallback {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.slide-fallback h1 {
  font-size: 160px;
  color: var(--brand-green);
  margin-bottom: 40px;
  font-weight: 800;
}
.slide-fallback p {
  font-size: 48px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
  margin-bottom: 24px;
}
.slide-fallback .url {
  font-size: 64px;
  color: #fff;
  font-weight: 700;
  margin-top: 16px;
}

/* ============ DEBUG ============ */
.debug {
  position: fixed;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.85);
  color: var(--brand-green);
  font-family: monospace;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 9999;
  max-width: 400px;
  cursor: text;
}
.hidden { display: none !important; }
