/* --------------------------------------------------------
 * History — Ambient Environment
 * Minimal brutalist stylesheet.
 * Brand tokens (--color-atelier-*, --font-sans, --spacing-*)
 * are provided by the external brand.css CDN stylesheet.
 * -------------------------------------------------------- */

/* -- Reset ------------------------------------------------ */

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

html,
body {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans, system-ui, sans-serif);
  background: var(--color-atelier-black, #111);
  color: var(--color-atelier-white, #fff);
}

/* -- App container ---------------------------------------- */

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* -- Theme-aware button colors --------------------------------- */

#app[data-theme="light"] {
  --button-color: var(--color-atelier-black);
  --button-color-inv: var(--color-atelier-white);
}

#app[data-theme="dark"] {
  --button-color: var(--color-atelier-white);
  --button-color-inv: var(--color-atelier-black);
}

/* -- Title ---------------------------------------- */

.title {
  color: var(--button-color, var(--color-atelier-white));
  margin-bottom: var(--spacing-6, 2rem);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.6s ease, color 0.3s;
}

/* -- Buttons --------------------------------- */

.button {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 1px solid var(--button-color, var(--color-atelier-black));
  color: var(--button-color, var(--color-atelier-black));
  background: transparent;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  cursor: pointer;
}

.button:hover {
  background-color: var(--button-color, var(--color-atelier-black));
  color: var(--button-color-inv, var(--color-atelier-white));
}

.button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.button--hidden {
  opacity: 0;
  pointer-events: none;
}

/* -- Fullscreen toggle ------------------------------------ */

.fullscreen-btn {
  position: fixed;
  top: var(--spacing-4, 1rem);
  right: var(--spacing-4, 1rem);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.fullscreen-btn--visible {
  opacity: 0.5;
  pointer-events: auto;
}

/* -- Fullscreen state ------------------------------------- */
/* Hide all UI when in fullscreen mode */

:fullscreen #app {
  cursor: none;
}

:fullscreen #app .title,
:fullscreen #app .enter-btn,
:fullscreen #app .fullscreen-btn {
  display: none;
}

:-webkit-full-screen #app {
  cursor: none;
}

:-webkit-full-screen #app .title,
:-webkit-full-screen #app .enter-btn,
:-webkit-full-screen #app .fullscreen-btn {
  display: none;
}

/* -- Touch devices: hide fullscreen button ---------------- */

@media (pointer: coarse) {
  .fullscreen-btn {
    display: none !important;
  }
}

/* -- Immersive mode (double-tap on touch) ----------------- */

.app--immersive .title,
.app--immersive .enter-btn,
.app--immersive .fullscreen-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* -- Reduced motion --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
