/* gernotwinter.com — app presentation engine ("app-show")
   Shared styles for self-playing app decks (site/apps/*.html).
   Standalone stylesheet: deck pages do NOT load base.css, so fonts and
   reset live here too. */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* v3: light stage — the dark app screenshots carry the contrast.
     theme fallbacks so an untagged body.show still renders sensibly */
  --sh-bg: #f8f5fd;
  --sh-panel: #ffffff;
  --sh-ink: #241a3d;
  --sh-muted: #6b6084;
  --sh-accent: #c05f16;
}

/* theme: WM — light violet stage with darkened orange accent */
body.theme-wm { --sh-bg:#f8f5fd; --sh-panel:#ffffff; --sh-ink:#241a3d; --sh-muted:#6b6084; --sh-accent:#c05f16; }

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

html, body { height: 100%; }

img { max-width: 100%; height: auto; display: block; }

body.show {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--sh-bg);
  color: var(--sh-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---- header ---- */
.show-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 2.5rem;
  background: linear-gradient(to bottom, rgba(255,255,255,.7), rgba(255,255,255,0));
  font-size: 0.85rem;
}
.show-back { color: var(--sh-muted); text-decoration: none; white-space: nowrap; }
.show-back:hover { color: var(--sh-accent); text-decoration: underline; }
.show-name {
  color: var(--sh-muted);
  text-align: center;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- progress bar (injected by JS) ---- */
.show-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--sh-accent);
  z-index: 10;
}

/* ---- stage / slides ---- */
.show-stage { position: absolute; inset: 0; }

.show-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  overflow-y: auto;
}
.show-slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }

.slide-inner { width: 100%; max-width: 1320px; margin: 0 auto; }

/* title + end slides: centered claim */
.slide-title .slide-inner,
.slide-end .slide-inner {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}
.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sh-accent);
}
.claim {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.25;
  color: var(--sh-ink);
}
.subline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: var(--sh-muted);
  max-width: 46ch;
}

/* shot slides: screenshot + caption */
.slide-shot .slide-inner {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.shot {
  flex: 0 0 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(20,15,45,.16);
  box-shadow: 0 20px 50px rgba(20,15,45,.22);
  background: var(--sh-panel);
}
.shot img { width: 100%; height: auto; transform: scale(1); }
@media (prefers-reduced-motion: no-preference) {
  .shot img { transition: transform var(--sh-duration, 8000ms) ease-out; }
  .show-slide.is-active .shot img { transform: scale(1.035); }
}
.caption { flex: 1 1 auto; min-width: 0; }
.caption h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.3;
  margin-bottom: 0.85rem;
  color: var(--sh-ink);
}
.caption p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--sh-muted);
  max-width: 46ch;
}

@media (max-width: 900px) {
  .slide-shot .slide-inner { flex-direction: column; text-align: left; }
  .shot { width: 100%; max-height: 52svh; }
  .shot img { max-height: 52svh; width: auto; max-width: 100%; object-fit: contain; }
  .caption p { max-width: none; }
}

/* facts slide */
.slide-facts .slide-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
}
.slide-facts h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--sh-ink);
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 900px;
  text-align: left;
}
.fact {
  border: 1px solid rgba(20,15,45,.12);
  background: var(--sh-panel);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}
.fact strong {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--sh-accent);
  margin-bottom: 0.5rem;
}
.fact span {
  display: block;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--sh-muted);
}
.fact-note { font-size: 0.8rem; color: var(--sh-muted); opacity: 0.8; }

@media (max-width: 640px) {
  .facts-grid { grid-template-columns: 1fr; }
}

/* end slide extras */
.end-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.show-replay {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  border: 1px solid var(--sh-accent);
  background: transparent;
  color: var(--sh-accent);
  cursor: pointer;
}
.show-replay:hover { background: var(--sh-accent); color: var(--sh-bg); }
.end-back { font-size: 0.9rem; color: var(--sh-muted); text-decoration: none; }
.end-back:hover { color: var(--sh-accent); text-decoration: underline; }

/* ---- controls (built by JS into .show-controls) ---- */
.show-controls {
  position: fixed;
  left: 50%;
  bottom: clamp(1rem, 3vh, 2rem);
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 92vw;
  background: var(--sh-panel);
  border: 1px solid rgba(20,15,45,.12);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 10px 30px rgba(20,15,45,.18);
}
.show-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(20,15,45,.18);
  color: var(--sh-ink);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}
.show-btn:hover { border-color: var(--sh-accent); color: var(--sh-accent); }
.show-btn:disabled { opacity: 0.35; cursor: default; }
.show-dots { display: flex; align-items: center; gap: 0.15rem; }
.show-dot {
  position: relative;
  width: 16px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.show-dot::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(20,15,45,.28);
  transition: background 0.2s ease, width 0.2s ease;
}
.show-dot.is-active::after { background: var(--sh-accent); width: 16px; border-radius: 4px; }

@media (max-width: 480px) {
  .show-name { display: none; }
  .show-top { padding: 0.85rem 1rem 2rem; }
  .show-controls { gap: 0.3rem; padding: 0.4rem 0.6rem; }
  .show-btn { min-width: 40px; min-height: 40px; font-size: 1rem; }
  .show-dot { width: 13px; height: 40px; }
}

.show-btn:focus-visible,
.show-dot:focus-visible,
.show-replay:focus-visible,
.end-back:focus-visible,
.show-back:focus-visible {
  outline: 2px solid var(--sh-accent);
  outline-offset: 2px;
}
