/**
 * FA.UN base styles.
 * Dock curves are drawn with SVG paths (see index.html) because
 * clip-path on the same element erases border-radius.
 * Screen radii stay in sync through --r (outer) and --b (border width).
 * One fixed desktop canvas (#stage 1600x900) is uniformly scaled by index.js,
 * so mobile renders exactly the same layout.
 */

:root {
  --cream: #fbf4df;
  --ink: #1a1a1a;
  --bezel: #373131;
  --dock: #8c8e93;
  --docklight: #b0b2b6;
  --dockline: #a3a5aa;
  --shell: #ffe6d2;
  --plus: #ff979b;
  --r: 44px;
  --b: 18px;
}

html {
  height: 100%;
}

body {
  background-color: var(--cream);
  background-image:
    radial-gradient(
      60% 45% at 12% 0%,
      rgba(243, 214, 188, 0.85),
      transparent 70%
    ),
    radial-gradient(
      55% 40% at 88% 0%,
      rgba(214, 231, 231, 0.7),
      transparent 70%
    ),
    linear-gradient(180deg, #faf3e2 0%, var(--cream) 55%, #f6ecd6 100%);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  height: 100vh;
  width: 100vw;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* Visually hidden but announced */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link */
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  transition-property: top;
  transition-duration: 0.2s;
}

.skip:focus-visible {
  top: 1rem;
  outline-color: #fff;
}

/* Shader canvas: fullscreen behind everything */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Click flash wash above everything */
#flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

/* Fixed desktop stage, scaled by JS */
#stage {
  position: fixed;
  inset: 0;
  z-index: 10;
}

#stagescale {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 900px;
  transform-origin: top left;
}

/* Right corner dock pinned to the viewport walls */
#cornerwrap {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 243px;
  height: 180px;
  transform-origin: bottom right;
  z-index: 40;
}


/* Pink circle + button that toggles the Sobre card */
.plusbtn {
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--plus);
  color: #3d3d3f;
  box-shadow:
    0 3px 8px rgba(120, 60, 60, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  transition-property: transform;
  transition-duration: 0.2s;
}

.plusbtn:hover {
  transform: scale(1.07);
}

/* Banner images live in the DB (data URIs): no link, no callout, no drag */
.slide img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.slide img:not([src]) {
  visibility: hidden;
}

/* Circular outline X at the card foot */
.sobre-x {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  flex-shrink: 0;
  transition-property: transform, background-color;
  transition-duration: 0.2s;
}

.sobre-x:hover {
  transform: scale(1.07);
  background-color: rgba(255, 255, 255, 0.25);
}

/* Retro screen: border draws the bezel, inner wrapper follows the curve */
.screen {
  background-color: var(--bezel);
  border: var(--b) solid var(--bezel);
  border-radius: var(--r);
  box-shadow:
    0 25px 50px -12px rgba(60, 50, 40, 0.22),
    inset 0 2px 10px rgba(0, 0, 0, 0.25);
}

.screen-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--r) - var(--b));
}

/* Slides: compositor-friendly opacity only */
.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition-property: opacity;
  transition-duration: 0.5s;
  transition-timing-function: ease-in-out;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Dock SVG shells: the rounded trapezoid lives in the path data */
.docksvg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

/* Social buttons share the dock targets */
.socbtn {
  width: 96px;
  height: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 5px rgba(60, 50, 40, 0.18);
  flex-shrink: 0;
  transition-property: transform, background-color;
  transition-duration: 0.2s;
}

/* Animated brand letters */
.bl {
  display: inline-block;
  will-change: transform, opacity;
}

.socbtn:hover {
  transform: scale(1.08);
  background-color: rgba(255, 255, 255, 0.35);
}

.socbtn[aria-disabled="true"] {
  opacity: 0.45;
}

/* Icon-only camera toggle with red/green state dot, no text */
.cambtn {
  position: relative;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}

.cambtn[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.camdot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #22c55e;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.cambtn[aria-pressed="true"] .camdot {
  background: #ef4444;
}

/* Language pill next to the camera toggle */
.langbtn {
  height: 52px;
  min-width: 52px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}

/* Sobre card */
#sobre-card {
  background-image: linear-gradient(
    165deg,
    rgba(222, 223, 226, 0.85) 0%,
    rgba(195, 197, 201, 0.85) 60%,
    rgba(173, 175, 180, 0.85) 100%
  );
  overscroll-behavior: contain;
  z-index: 2;
  transition-property: opacity, transform, visibility;
  transition-duration: 0.35s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

#sobre-card.hidden-card {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  visibility: hidden;
  pointer-events: none;
}

#sobre-card.visible-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

/* Footer respects notches */
.footerbar {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Reduced motion: transitions off, loops keep running (user choice) */
@media (prefers-reduced-motion: reduce) {
  .slide,
  #sobre-card,
  .skip {
    transition: none;
  }
}
